4.79 ms (33.33%)
|
1 |
SELECT quote_ident(n.nspname) AS schema_name,
quote_ident(c.relname) AS table_name,
quote_ident(a.attname) AS field,
t.typname AS type,
format_type(a.atttypid, a.atttypmod) AS complete_type,
bt.typname AS domain_type,
format_type(bt.oid, t.typtypmod) AS domain_complete_type,
a.attnotnull AS isnotnull,
a.attidentity,
( SELECT
CASE
WHEN a.attgenerated = 's' THEN NULL
ELSE pg_get_expr(adbin, adrelid)
END
FROM pg_attrdef
WHERE c.oid = pg_attrdef.adrelid
AND pg_attrdef.adnum=a.attnum) AS "default",
dsc.description AS comment,
CASE
WHEN coll.collprovider = 'c'
THEN coll.collcollate
WHEN coll.collprovider = 'd'
THEN NULL
ELSE coll.collname
END AS collation
FROM pg_attribute a
JOIN pg_class c
ON c.oid = a.attrelid
JOIN pg_namespace n
ON n.oid = c.relnamespace
JOIN pg_type t
ON t.oid = a.atttypid
LEFT JOIN pg_type bt
ON t.typtype = 'd'
AND bt.oid = t.typbasetype
LEFT JOIN pg_collation coll
ON coll.oid = a.attcollation
LEFT JOIN pg_depend dep
ON dep.objid = c.oid
AND dep.deptype = 'e'
AND dep.classid = (SELECT oid FROM pg_class WHERE relname = 'pg_class')
LEFT JOIN pg_description dsc
ON dsc.objoid = c.oid AND dsc.objsubid = a.attnum
LEFT JOIN pg_inherits i
ON i.inhrelid = c.oid
LEFT JOIN pg_class p
ON i.inhparent = p.oid
AND p.relkind = 'p'
WHERE n.nspname = ANY(current_schemas(false)) AND c.relname = ? AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')
AND c.relkind IN ('r', 'p')
AND a.attnum > 0
AND dep.refobjid IS NULL
AND p.oid IS NULL
ORDER BY n.nspname,
c.relname,
a.attnum
Parameters: [
"doctrine_migration_versions"
]
SELECT quote_ident(n.nspname) AS schema_name,
quote_ident(c.relname) AS table_name,
quote_ident(a.attname) AS field,
t.typname AS type,
format_type(a.atttypid, a.atttypmod) AS complete_type,
bt.typname AS domain_type,
format_type(bt.oid, t.typtypmod) AS domain_complete_type,
a.attnotnull AS isnotnull,
a.attidentity,
( SELECT
CASE
WHEN a.attgenerated = 's' THEN NULL
ELSE pg_get_expr(adbin, adrelid)
END
FROM pg_attrdef
WHERE c.oid = pg_attrdef.adrelid
AND pg_attrdef.adnum=a.attnum) AS "default",
dsc.description AS comment,
CASE
WHEN coll.collprovider = 'c'
THEN coll.collcollate
WHEN coll.collprovider = 'd'
THEN NULL
ELSE coll.collname
END AS collation
FROM pg_attribute a
JOIN pg_class c
ON c.oid = a.attrelid
JOIN pg_namespace n
ON n.oid = c.relnamespace
JOIN pg_type t
ON t.oid = a.atttypid
LEFT JOIN pg_type bt
ON t.typtype = 'd'
AND bt.oid = t.typbasetype
LEFT JOIN pg_collation coll
ON coll.oid = a.attcollation
LEFT JOIN pg_depend dep
ON dep.objid = c.oid
AND dep.deptype = 'e'
AND dep.classid = (SELECT oid FROM pg_class WHERE relname = 'pg_class')
LEFT JOIN pg_description dsc
ON dsc.objoid = c.oid AND dsc.objsubid = a.attnum
LEFT JOIN pg_inherits i
ON i.inhrelid = c.oid
LEFT JOIN pg_class p
ON i.inhparent = p.oid
AND p.relkind = 'p'
WHERE n.nspname = ANY(current_schemas(false)) AND c.relname = 'doctrine_migration_versions' AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')
AND c.relkind IN ('r', 'p')
AND a.attnum > 0
AND dep.refobjid IS NULL
AND p.oid IS NULL
ORDER BY n.nspname,
c.relname,
a.attnum;
|
1.82 ms (12.65%)
|
1 |
SELECT
quote_ident(n.nspname) AS schema_name,
quote_ident(c.relname) AS table_name,
quote_ident(ic.relname) AS relname,
i.indisunique,
i.indisprimary,
i.indkey,
i.indrelid,
pg_get_expr(indpred, indrelid) AS "where",
quote_ident(attname) AS attname
FROM pg_index i
JOIN pg_class AS c ON c.oid = i.indrelid
JOIN pg_namespace n ON n.oid = c.relnamespace
JOIN pg_class AS ic ON ic.oid = i.indexrelid
JOIN LATERAL UNNEST(i.indkey) WITH ORDINALITY AS keys(attnum, ord)
ON TRUE
JOIN pg_attribute a
ON a.attrelid = c.oid
AND a.attnum = keys.attnum
WHERE n.nspname = ANY(current_schemas(false)) AND c.relname = ? AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')
ORDER BY 1, 2, keys.ord;
Parameters: [
"doctrine_migration_versions"
]
SELECT
quote_ident(n.nspname) AS schema_name,
quote_ident(c.relname) AS table_name,
quote_ident(ic.relname) AS relname,
i.indisunique,
i.indisprimary,
i.indkey,
i.indrelid,
pg_get_expr(indpred, indrelid) AS "where",
quote_ident(attname) AS attname
FROM pg_index i
JOIN pg_class AS c ON c.oid = i.indrelid
JOIN pg_namespace n ON n.oid = c.relnamespace
JOIN pg_class AS ic ON ic.oid = i.indexrelid
JOIN LATERAL UNNEST(i.indkey) WITH ORDINALITY AS keys(attnum, ord)
ON TRUE
JOIN pg_attribute a
ON a.attrelid = c.oid
AND a.attnum = keys.attnum
WHERE n.nspname = ANY(current_schemas(false)) AND c.relname = 'doctrine_migration_versions' AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')
ORDER BY 1, 2, keys.ord;;
|
0.97 ms (6.76%)
|
1 |
SELECT
quote_ident(tn.nspname) AS schema_name,
quote_ident(tc.relname) AS table_name,
quote_ident(r.conname) as conname,
pg_get_constraintdef(r.oid, true) as condef,
r.condeferrable,
r.condeferred
FROM pg_constraint r
JOIN pg_class AS tc ON tc.oid = r.conrelid
JOIN pg_namespace tn ON tn.oid = tc.relnamespace
WHERE r.conrelid IN
(
SELECT c.oid
FROM pg_class c
JOIN pg_namespace n
ON n.oid = c.relnamespace
WHERE n.nspname = ANY(current_schemas(false)) AND c.relname = ? AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast'))
AND r.contype = 'f'
ORDER BY 1, 2
Parameters: [
"doctrine_migration_versions"
]
SELECT
quote_ident(tn.nspname) AS schema_name,
quote_ident(tc.relname) AS table_name,
quote_ident(r.conname) as conname,
pg_get_constraintdef(r.oid, true) as condef,
r.condeferrable,
r.condeferred
FROM pg_constraint r
JOIN pg_class AS tc ON tc.oid = r.conrelid
JOIN pg_namespace tn ON tn.oid = tc.relnamespace
WHERE r.conrelid IN
(
SELECT c.oid
FROM pg_class c
JOIN pg_namespace n
ON n.oid = c.relnamespace
WHERE n.nspname = ANY(current_schemas(false)) AND c.relname = 'doctrine_migration_versions' AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast'))
AND r.contype = 'f'
ORDER BY 1, 2;
|
0.57 ms (3.96%)
|
1 |
SELECT quote_ident(n.nspname) AS schema_name,
quote_ident(c.relname) AS table_name,
CASE c.relpersistence WHEN 'u' THEN true ELSE false END as unlogged,
obj_description(c.oid, 'pg_class') AS comment
FROM pg_class c
INNER JOIN pg_namespace n
ON n.oid = c.relnamespace
WHERE
c.relkind = 'r'
AND n.nspname = ANY(current_schemas(false)) AND c.relname = ? AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')
Parameters: [
"doctrine_migration_versions"
]
SELECT quote_ident(n.nspname) AS schema_name,
quote_ident(c.relname) AS table_name,
CASE c.relpersistence WHEN 'u' THEN true ELSE false END as unlogged,
obj_description(c.oid, 'pg_class') AS comment
FROM pg_class c
INNER JOIN pg_namespace n
ON n.oid = c.relnamespace
WHERE
c.relkind = 'r'
AND n.nspname = ANY(current_schemas(false)) AND c.relname = 'doctrine_migration_versions' AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast');
|