Re: RowDescription for a function does not include table OID - Mailing list pgsql-general

From David G. Johnston
Subject Re: RowDescription for a function does not include table OID
Date
Msg-id CAKFQuwY76Jc=6JJOPzAt98RLuGCgCdNnS6syB0T4hF6iA=+uoQ@mail.gmail.com
Whole thread Raw
In response to RowDescription for a function does not include table OID  (Maxwell Dreytser <Maxwell.Dreytser@assistek.com>)
Responses Re: RowDescription for a function does not include table OID
List pgsql-general
On Fri, Jun 21, 2024 at 7:42 AM Maxwell Dreytser <Maxwell.Dreytser@assistek.com> wrote:
I am working on a meta-programming use-case where I need to scrape some detailed information about the results of a function that "RETURNS TABLE (LIKE physical_table)"

Yes, but the bug is yours.  The definition you want is:  RETURNS SETOF physical_table (not tested though)

What you did was produce a one-column table whose column type is a composite (and whose name is like - what with case-folding of unquoted identifiers).  Since that table doesn't exist anywhere in the catalogs it has no TableOID.

David J.

pgsql-general by date:

Previous
From: Maxwell Dreytser
Date:
Subject: RowDescription for a function does not include table OID
Next
From: Maxwell Dreytser
Date:
Subject: Re: RowDescription for a function does not include table OID