Files
pgweb/pkg/statements/sql/table_constraints.sql
Dan Sosedoff e3085a44ba Add PostgreSQL 18 support to Github Actions (#816)
* Run against PostgreSQL 18
* Handle constraints for pg18
* Bump golangci-linter to 1.62.2 (#772)
* Bump golangci-linter to 1.62.2
* Address linting warning via change or ignore
2025-11-11 11:30:42 -08:00

16 lines
276 B
SQL

SELECT
conname AS name,
pg_get_constraintdef(c.oid, true) AS definition
FROM
pg_constraint c
JOIN
pg_namespace n ON n.oid = c.connamespace
JOIN
pg_class cl ON cl.oid = c.conrelid
WHERE
n.nspname = $1
AND relname = $2
AND contype != 'n'
ORDER BY
contype DESC