Revision 14262
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/util.sql | ||
---|---|---|
6224 | 6224 |
ROW(ROW((s.table_)::regclass, (s.name)::text), s.def)::check_constraint_def AS constraint_ |
6225 | 6225 |
FROM ( SELECT pg_constraint.conrelid AS table_, |
6226 | 6226 |
pg_constraint.conname AS name, |
6227 |
trim_parens(pg_get_expr(pg_constraint.conbin, pg_constraint.conrelid, false)) AS def |
|
6227 |
trim_parens(pg_get_expr(pg_constraint.conbin, pg_constraint.conrelid, pretty_print := false)) AS def
|
|
6228 | 6228 |
FROM pg_constraint |
6229 | 6229 |
WHERE (pg_constraint.contype = 'c'::"char")) s; |
6230 | 6230 |
|
... | ... | |
6236 | 6236 |
COMMENT ON VIEW check_constraint IS ' |
6237 | 6237 |
conrelid: don''t cast to regclass so can use index scan |
6238 | 6238 |
|
6239 |
pg_get_expr(conbin, conrelid, /*pretty-print:*/false):
|
|
6239 |
def:
|
|
6240 | 6240 |
can''t use consrc because this doesn''t get auto-updated with column renames. |
6241 |
must use our wrapper so that the right search_path is used. |
|
6241 | 6242 |
*don''t* use pretty-print, because this format does not match util.canon_sql(). |
6242 | 6243 |
need to remove the enclosing () to be consistent everywhere. |
6243 | 6244 |
'; |
Also available in: Unified diff
bugfix: schemas/util.sql: check_constraint view: def: must use our wrapper so that the right search_path is used