Re: RowDescription for a function does not include table OID

From: Maxwell Dreytser <Maxwell(dot)Dreytser(at)assistek(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: RowDescription for a function does not include table OID
Date: 2024-06-21 15:41:09
Message-ID: LV3PR16MB60016206D56BF62B51D0568BE6C92@LV3PR16MB6001.namprd16.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

On Friday, June 21, 2024 11:28 AM David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> Interesting, then I suppose it is semantics.  There is no table involved - you are referencing the type of that name, not the table - so no TableOID.  There is no guarantee the row you are holding came from a table - and I'd interpret the current behavior as conveying that fact.  Though the current wording: "If the field can be identified as a column of a specific table, the object ID of the table; otherwise zero."; and the observation that at least a human "can identify" a related column, leads one to reasonably infer the system should be able to make such an identification as well.

This is exactly my point. If the return type of the function is strongly linked (directly in the function schema) to the table according to pg_catalog, the field can obviously be tied to a specific column of that specific table. The RowDescription not having that value filled in is a violation of that promise.

> In short, the system doesn't generate the information you need, where you need it, to tie these pieces together.  Modifying existing elements of the backend protocol is not presently in the cards.

From my perspective this is clearly a bug as there is no way to define a function in a way that provides enough data to the reader.

Regards,
Maxwell.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2024-06-21 15:51:18 Re: RowDescription for a function does not include table OID
Previous Message David G. Johnston 2024-06-21 15:28:56 Re: RowDescription for a function does not include table OID

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2024-06-21 15:51:18 Re: RowDescription for a function does not include table OID
Previous Message David G. Johnston 2024-06-21 15:28:56 Re: RowDescription for a function does not include table OID