Re: Types info on binary copy

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Types info on binary copy
Дата
Msg-id 3387244.1609872809@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Types info on binary copy  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список pgsql-hackers
Daniele Varrazzo <daniele.varrazzo@gmail.com> writes:
> Naively, it would seem that once a "COPY ... FROM STDIN" is executed
> successfully, the server has a pretty good idea of what data types it
> is expecting. I'm wondering: is it absurd to ask for this info to be
> returned as RowDescription and to be exposed by the libpq PQftype()?

It'd be a protocol break, unfortunately, since no such message is
sent as part of the COPY protocol.  The 'G' (begin copy in) message
only carries the number of columns and column format codes.  I agree
that for an intelligent source agent it might be useful to know the
column datatypes, but that idea didn't occur to us at the time :-(.

Now having said that, I believe we do have the ability now for a
client to request protocol extension(s) at connection start.  So
maybe you could make it work that way.  Probably a RowDescription
message before "begin copy out" would be useful too.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: macOS SIP, next try
Следующее
От: "Joel Jacobson"
Дата:
Сообщение: Re: set_config() documentation clarification