On Friday, June 21, 2024 10:48 AM David G. Johnston <david.g.johnston@xxxxxxxxx>wrote: >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. SETOF also does not return correct RowDescription data. Table OID and column number are still both 0. Both versions have the exact same pg_proc.prorettype. If I join this onto pg_type, the pg_type.typrelid = 'physical_table'::regclass. Regards, Maxwell