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.

Reply via email to