postgresql/src/backend/utils/adt
Bruce Momjian 2f98ece4de The brackets aren't put on the CHECK constraints properly.
Before patch:

test=# select pg_get_constraintdef(oid) from pg_constraint;
                                       pg_get_constraintdef
-------------------------------------------------------------------------------------------------
  CHECK (VALUE >= 0)
  CHECK ((((a)::text = 'asdf'::text) OR ((a)::text = 'fdsa'::text)) OR
((a)::text = 'dfd'::text))
  PRIMARY KEY (b)
  FOREIGN KEY (a) REFERENCES test2(b)
  UNIQUE (b)
(5 rows)

test=# select pg_get_constraintdef(oid, true) from pg_constraint;
                                pg_get_constraintdef
-----------------------------------------------------------------------------------
  CHECK VALUE >= 0
  CHECK a::text = 'asdf'::text OR a::text = 'fdsa'::text OR a::text =
'dfd'::text
  PRIMARY KEY (b)
  FOREIGN KEY (a) REFERENCES test2(b)
  UNIQUE (b)
(5 rows)

After patch:

test=# select pg_get_constraintdef(oid) from pg_constraint;
                                       pg_get_constraintdef
-------------------------------------------------------------------------------------------------
  CHECK (VALUE >= 0)
  CHECK ((((a)::text = 'asdf'::text) OR ((a)::text = 'fdsa'::text)) OR
((a)::text = 'dfd'::text))
  PRIMARY KEY (b)
  FOREIGN KEY (a) REFERENCES test2(b)
  UNIQUE (b)
(5 rows)

test=# select pg_get_constraintdef(oid, true) from pg_constraint;
                                pg_get_constraintdef
-----------------------------------------------------------------------------------
  CHECK (VALUE >= 0)

`  CHECK (a::text = 'asdf'::text OR a::text = 'fdsa'::text OR a::text =
'dfd'::text)
  PRIMARY KEY (b)
  FOREIGN KEY (a) REFERENCES test2(b)
  UNIQUE (b)
(5 rows)

It's important that those brackets are there to (a) match all other
constraints and (b) so that people can just copy and paste them and it
will work as SQL.


Christopher Kings-Lynne
2003-09-29 18:55:56 +00:00
..
acl.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
array_userfuncs.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
arrayfuncs.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
arrayutils.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
ascii.c Various message fixes, among those fixes for the previous round of fixes 2003-09-26 15:27:37 +00:00
bool.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
cash.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
char.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
date.c Various message fixes, among those fixes for the previous round of fixes 2003-09-26 15:27:37 +00:00
datetime.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
datum.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
encode.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
float.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
format_type.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
formatting.c More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
geo_ops.c More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
geo_selfuncs.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
inet_net_ntop.c pgindent run. 2003-08-04 00:43:34 +00:00
inet_net_pton.c pgindent run. 2003-08-04 00:43:34 +00:00
int.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
int8.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
like.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
like_match.c Fix some copyright notices that weren't updated. Improve copyright tool 2003-08-04 23:59:41 +00:00
lockfuncs.c Fix some copyright notices that weren't updated. Improve copyright tool 2003-08-04 23:59:41 +00:00
mac.c More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
Makefile Add binary I/O routines for a bunch more datatypes. Still a few to go, 2003-05-12 23:08:52 +00:00
misc.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
nabstime.c More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
name.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
network.c More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
not_in.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
numeric.c More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
numutils.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
oid.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
oracle_compat.c Another pgindent run with updated typedefs. 2003-08-08 21:42:59 +00:00
pg_locale.c Fix some copyright notices that weren't updated. Improve copyright tool 2003-08-04 23:59:41 +00:00
pg_lzcompress.c This patch fixes a bunch of spelling mistakes in comments throughout the 2003-03-10 22:28:22 +00:00
pgstatfuncs.c OK, some of these syntax errors should be given other codes. 2003-09-15 20:03:37 +00:00
pseudotypes.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
quote.c Fix some copyright notices that weren't updated. Improve copyright tool 2003-08-04 23:59:41 +00:00
regexp.c Another pgindent run with updated typedefs. 2003-08-08 21:42:59 +00:00
regproc.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
ri_triggers.c More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
ruleutils.c The brackets aren't put on the CHECK constraints properly. 2003-09-29 18:55:56 +00:00
selfuncs.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
sets.c OK, some of these syntax errors should be given other codes. 2003-09-15 20:03:37 +00:00
tid.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
timestamp.c More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
varbit.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
varchar.c Remove --enable-recode feature, since it's been broken by IPv6 changes, 2003-08-04 04:03:10 +00:00
varlena.c Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
version.c Functions on 'text' type updated to new fmgr style. 'text' is 2000-07-06 05:48:31 +00:00
xid.c Update copyrights to 2003. 2003-08-04 02:40:20 +00:00