DataRow message for Integer(int4) returns result as text?

Поиск
Список
Период
Сортировка
От Tyler Brock
Тема DataRow message for Integer(int4) returns result as text?
Дата
Msg-id CACr_h8QSz4k9KckE7MTspYnHbkLLKmM0WyvfNpWzVF50SZMoPw@mail.gmail.com
обсуждение исходный текст
Ответы Re: DataRow message for Integer(int4) returns result as text?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: DataRow message for Integer(int4) returns result as text?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I think this makes sense but I wanted to get confirmation:

I created a table with a column having the type int4 (integer). When I insert a row with a number into that column and get it back out I've observed a discrepancy:

The DataRow message has the field encoded as an ASCII ‘7’ with a column length of 1 despite the RowDescription having a column length 4. I assume that this is because it’s a simple query (Q) and therefore the format code for all columns is 0 (for text format).

It makes sense that at the time the RowDescription is written out that it can’t possibly know how many bytes the textual representation of each int will take so it just uses the length of the underlying type.

Is this accurate? 

-Tyler

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: preserving db/ts/relfilenode OIDs across pg_upgrade (was Re: storing an explicit nonce)
Следующее
От: "David G. Johnston"
Дата:
Сообщение: doc: New cumulative stats subsystem obsoletes comment in maintenance.sgml