Re: RowDescription for a function does not include table OID

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Maxwell Dreytser <Maxwell(dot)Dreytser(at)assistek(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 14:48:16
Message-ID: CAKFQuwY76Jc=6JJOPzAt98RLuGCgCdNnS6syB0T4hF6iA=+uoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

On Fri, Jun 21, 2024 at 7:42 AM Maxwell Dreytser <
Maxwell(dot)Dreytser(at)assistek(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Maxwell Dreytser 2024-06-21 15:03:58 Re: RowDescription for a function does not include table OID
Previous Message Maxwell Dreytser 2024-06-21 14:41:55 RowDescription for a function does not include table OID

Browse pgsql-interfaces by date

  From Date Subject
Next Message Maxwell Dreytser 2024-06-21 15:03:58 Re: RowDescription for a function does not include table OID
Previous Message Maxwell Dreytser 2024-06-21 14:41:55 RowDescription for a function does not include table OID