On Wed, 2023-03-22 at 10:12 +0100, Peter Eisentraut wrote: > Sending type names is kind of useless if what comes back with the > result > (RowDescription) are OIDs anyway. > > The client would presumably have some code like > > if (typeoid == 555) > parseThatType(); > > So it already needs to know about the OIDs of all the types it is > interested in.
Technically it's still an improvement because you can avoid an extra round-trip. The client library can pipeline a query like: SELECT typname, oid FROM pg_type WHERE typname IN (...list of supported type names...); when the client first connects, and then go ahead and send whatever queries you want without waiting for the response. When you get back the result of the pg_type query, you cache the mapping, and use it to process any other results you get. That avoids introducing an extra round-trip. I'm not sure if that's a reasonable thing to expect the client to do, so I agree that we should offer a better way. Regards, Jeff Davis