postgresql/src/backend/utils
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
..
adt The brackets aren't put on the CHECK constraints properly. 2003-09-29 18:55:56 +00:00
cache Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
error Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
fmgr Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
hash Improve dynahash.c's API so that caller can specify the comparison function 2003-08-19 01:13:41 +00:00
init Various message fixes, among those fixes for the previous round of fixes 2003-09-26 15:27:37 +00:00
mb Message editing: remove gratuitous variations in message wording, standardize 2003-09-25 06:58:07 +00:00
misc More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
mmgr Avoid corner cases where aset.c would unnecessarily make malloc() 2003-09-13 22:25:38 +00:00
sort Create a 'type cache' that keeps track of the data needed for any particular 2003-08-17 19:58:06 +00:00
time Get rid of ReferentialIntegritySnapshotOverride by extending Executor API 2003-09-25 18:58:36 +00:00
.cvsignore Cleanup to ensure good state of derived files in tarballs. 2000-06-09 02:38:36 +00:00
Gen_fmgrtab.sh Fix some copyright notices that weren't updated. Improve copyright tool 2003-08-04 23:59:41 +00:00
Makefile Remove all traces of multibyte and locale options. Clean up comments 2002-09-03 21:45:44 +00:00