diff options
author | Dave Arter <davea@mysociety.org> | 2020-05-26 13:34:34 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2020-05-27 10:28:44 +0100 |
commit | 7b7e00c16f6d31ff77b9f28e63aac3b608f2bfbb (patch) | |
tree | b0799178a05a0c6640ac0f24a1107e061042a6d5 /bin | |
parent | c6e723a2fee40f7009de3f04de5870693e12889e (diff) |
Fix update-schema constraint check on Postgres 12
pg_constraint.consrc has been removed in Postgres 12, and this is the recommended replacement.
See https://www.postgresql.org/docs/12/release-12.html
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/update-schema | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/update-schema b/bin/update-schema index 8f31085c9..44e299b91 100755 --- a/bin/update-schema +++ b/bin/update-schema @@ -319,7 +319,7 @@ sub constraint_exists { # Returns true if a check constraint contains a certain string sub constraint_contains { my ( $constraint, $check ) = @_; - my ($consrc) = $db->dbh->selectrow_array('select consrc from pg_constraint where conname = ?', {}, $constraint); + my ($consrc) = $db->dbh->selectrow_array('select pg_get_expr(conbin, conrelid) from pg_constraint where conname = ?', {}, $constraint); return unless $consrc; return $consrc =~ /$check/; } |