Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
exekias committed Nov 3, 2023
1 parent 02ac4ee commit 676a197
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ BEGIN
),
'primaryKey', (
SELECT json_agg(pg_attribute.attname) AS primary_key_columns
FROM pg_index, pg_class, pg_attribute, pg_namespace
FROM pg_index, pg_attribute
WHERE
pg_class.oid = t.oid::regclass AND
indrelid = pg_class.oid AND
t.oid = t.oid::regclass AND
indrelid = t.oid AND
nspname = schemaname AND
pg_class.relnamespace = pg_namespace.oid AND
pg_attribute.attrelid = pg_class.oid AND
t.relnamespace = ns.oid AND
pg_attribute.attrelid = t.oid AND
pg_attribute.attnum = any(pg_index.indkey)
AND indisprimary
),
Expand Down

0 comments on commit 676a197

Please sign in to comment.