Skip to content

Commit fbb0bba

Browse files
committed
adds ordering check constraints by oid
1 parent 40705e2 commit fbb0bba

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/lib/PostgresMetaColumns.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ BEGIN
343343
AND cardinality(conkey) = 1
344344
AND conrelid = ${literal(old!.table_id)}
345345
AND conkey[1] = ${literal(old!.ordinal_position)}
346+
ORDER BY oid asc
346347
LIMIT 1;
347348
348349
IF v_conname IS NOT NULL THEN

src/lib/sql/columns.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ FROM
9393
) AS "definition"
9494
FROM pg_constraint
9595
WHERE contype = 'c' AND cardinality(conkey) = 1
96+
ORDER BY oid asc
9697
) AS check_constraints ON check_constraints.table_id = c.oid AND check_constraints.ordinal_position = a.attnum
9798
WHERE
9899
NOT pg_is_other_temp_schema(nc.oid)

0 commit comments

Comments
 (0)