PQftype(copy_rset) returns zero OIDs???

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема PQftype(copy_rset) returns zero OIDs???
Дата
Msg-id CAFCRh-8BMj86X6DfpfQuV3NnTaH4eU+4=-MAwyhVKT98EThFMg@mail.gmail.com
обсуждение исходный текст
Ответы Re: PQftype(copy_rset) returns zero OIDs???
Список pgsql-general
Hi.

For the first time, I'm checking the OIDs returned
(via the result set's PQftype API), by "regular" SELECT:

`select ... from tab`

and by a COPY TO BINARY:

`COPY (
 select ...
   from tab
) TO STDOUT WITH (FORMAT BINARY)`

And to my surprise, they are not!
The ones from the COPY are all zeros.

Is that normal?

The BINARY record format encodes the byte-size, not the OIDs of the (scalar) fields.
How is one supposed to "infer" the OIDs then?

Also, given that the select-clause can use expressions I think,
including casts, instead of just naming columns, "describing" the table doesn't help.

But even for a "plain" COPY, having to describe explicitly is one more round-trip,
and seems asymmetrical compared to the result-set of a regular select.

I'm both surprised and confused by this behavior.
And would appreciate some clarifications. Thanks, --DD

PS: libpq v16.1. v12 server.

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Behavior of debug_parallel_query=regress
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: PostgreSQL Guard