-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
From the PG docs: A table can inherit from more than one parent table, in which case it has the union of the columns defined by the parent tables.
That means we can have many parents for one child table which make the concept of the PG table inheritance confusing ;-)
If we create table which have many parents, then we will have SQL error with schemainspect: more than one row returned by a subquery used as an expression
| where child.oid = c.oid) |
I would propose returning array of parent tables, but not sure if that is supported by the rest of the schemainspect
Here is the problematic SQL:
| '"' || nmsp_parent.nspname || '"."' || parent.relname || '"' as parent |
You can use
SELECT json_agg(
'"' || nmsp_parent.nspname || '"."' || parent.relname || '"') as parentor
SELECT array_agg(
'"' || nmsp_parent.nspname || '"."' || parent.relname || '"') as parentand probably even
SELECT array_agg( format('%I.%I', nmsp_parent.nspname, parent.relname)) as parentBut you may want to set quote_all_identifiers to ensure that all names are always quoted with ".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels