The brackets aren't put on the CHECK constraints properly.
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

xuegang/gpdb,kaknikhil/gpdb,ovr/postgres-xl,randomtask1155/gpdb,atris/gpdb,janebeckman/gpdb,janebeckman/gpdb,pavanvd/postgres-xl,snaga/postgres-xl,0x0FFF/gpdb,cjcjameson/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,randomtask1155/gpdb,oberstet/postgres-xl,foyzur/gpdb,rvs/gpdb,royc1/gpdb,lintzc/gpdb,Quikling/gpdb,zaksoup/gpdb,adam8157/gpdb,janebeckman/gpdb,kaknikhil/gpdb,postmind-net/postgres-xl,royc1/gpdb,atris/gpdb,xuegang/gpdb,ahachete/gpdb,arcivanov/postgres-xl,jmcatamney/gpdb,yazun/postgres-xl,tangp3/gpdb,chrishajas/gpdb,rvs/gpdb,zaksoup/gpdb,greenplum-db/gpdb,lpetrov-pivotal/gpdb,janebeckman/gpdb,zaksoup/gpdb,edespino/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,yazun/postgres-xl,Chibin/gpdb,CraigHarris/gpdb,tpostgres-projects/tPostgres,CraigHarris/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,greenplum-db/gpdb,yazun/postgres-xl,atris/gpdb,rvs/gpdb,foyzur/gpdb,randomtask1155/gpdb,tpostgres-projects/tPostgres,edespino/gpdb,chrishajas/gpdb,randomtask1155/gpdb,zeroae/postgres-xl,50wu/gpdb,xuegang/gpdb,zaksoup/gpdb,atris/gpdb,rubikloud/gpdb,Chibin/gpdb,tangp3/gpdb,foyzur/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,royc1/gpdb,ahachete/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,Quikling/gpdb,ovr/postgres-xl,cjcjameson/gpdb,royc1/gpdb,techdragon/Postgres-XL,tangp3/gpdb,50wu/gpdb,ashwinstar/gpdb,techdragon/Postgres-XL,CraigHarris/gpdb,rvs/gpdb,greenplum-db/gpdb,xinzweb/gpdb,0x0FFF/gpdb,jmcatamney/gpdb,ahachete/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,janebeckman/gpdb,lisakowen/gpdb,0x0FFF/gpdb,rvs/gpdb,xinzweb/gpdb,Quikling/gpdb,snaga/postgres-xl,lpetrov-pivotal/gpdb,randomtask1155/gpdb,rubikloud/gpdb,xuegang/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,tangp3/gpdb,ahachete/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,lintzc/gpdb,atris/gpdb,Quikling/gpdb,ovr/postgres-xl,royc1/gpdb,foyzur/gpdb,adam8157/gpdb,lpetrov-pivotal/gpdb,cjcjameson/gpdb,janebeckman/gpdb,50wu/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,atris/gpdb,cjcjameson/gpdb,jmcatamney/gpdb,xuegang/gpdb,CraigHarris/gpdb,snaga/postgres-xl,kaknikhil/gpdb,xuegang/gpdb,tpostgres-projects/tPostgres,50wu/gpdb,greenplum-db/gpdb,chrishajas/gpdb,snaga/postgres-xl,Chibin/gpdb,janebeckman/gpdb,chrishajas/gpdb,Chibin/gpdb,adam8157/gpdb,lintzc/gpdb,randomtask1155/gpdb,rvs/gpdb,Quikling/gpdb,lpetrov-pivotal/gpdb,zeroae/postgres-xl,xinzweb/gpdb,Postgres-XL/Postgres-XL,edespino/gpdb,atris/gpdb,Postgres-XL/Postgres-XL,foyzur/gpdb,edespino/gpdb,edespino/gpdb,lpetrov-pivotal/gpdb,adam8157/gpdb,ashwinstar/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,Chibin/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,0x0FFF/gpdb,jmcatamney/gpdb,oberstet/postgres-xl,xuegang/gpdb,Chibin/gpdb,adam8157/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,Chibin/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,kmjungersen/PostgresXL,postmind-net/postgres-xl,foyzur/gpdb,tangp3/gpdb,zeroae/postgres-xl,lisakowen/gpdb,yazun/postgres-xl,tangp3/gpdb,xinzweb/gpdb,xinzweb/gpdb,CraigHarris/gpdb,50wu/gpdb,0x0FFF/gpdb,lintzc/gpdb,edespino/gpdb,lintzc/gpdb,zaksoup/gpdb,royc1/gpdb,0x0FFF/gpdb,ahachete/gpdb,0x0FFF/gpdb,rubikloud/gpdb,0x0FFF/gpdb,edespino/gpdb,Quikling/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,tangp3/gpdb,rvs/gpdb,ovr/postgres-xl,Quikling/gpdb,rubikloud/gpdb,adam8157/gpdb,yuanzhao/gpdb,edespino/gpdb,tpostgres-projects/tPostgres,zeroae/postgres-xl,arcivanov/postgres-xl,techdragon/Postgres-XL,Chibin/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,lisakowen/gpdb,chrishajas/gpdb,greenplum-db/gpdb,ahachete/gpdb,yuanzhao/gpdb,foyzur/gpdb,edespino/gpdb,janebeckman/gpdb,rubikloud/gpdb,ahachete/gpdb,kmjungersen/PostgresXL,lintzc/gpdb,tpostgres-projects/tPostgres,yazun/postgres-xl,jmcatamney/gpdb,Quikling/gpdb,pavanvd/postgres-xl,xuegang/gpdb,zaksoup/gpdb,xuegang/gpdb,Chibin/gpdb,royc1/gpdb,adam8157/gpdb,pavanvd/postgres-xl,greenplum-db/gpdb,cjcjameson/gpdb,pavanvd/postgres-xl,zaksoup/gpdb,xinzweb/gpdb,lisakowen/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,techdragon/Postgres-XL,50wu/gpdb,lisakowen/gpdb,randomtask1155/gpdb,lisakowen/gpdb,kaknikhil/gpdb,rvs/gpdb,ashwinstar/gpdb,atris/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,rubikloud/gpdb,ashwinstar/gpdb,janebeckman/gpdb,yuanzhao/gpdb,Quikling/gpdb,lpetrov-pivotal/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,lintzc/gpdb,kaknikhil/gpdb,rvs/gpdb,lintzc/gpdb,xinzweb/gpdb,jmcatamney/gpdb,edespino/gpdb,lpetrov-pivotal/gpdb,greenplum-db/gpdb,Quikling/gpdb,Postgres-XL/Postgres-XL,kmjungersen/PostgresXL,ovr/postgres-xl,snaga/postgres-xl,rubikloud/gpdb,techdragon/Postgres-XL,50wu/gpdb,CraigHarris/gpdb,postmind-net/postgres-xl,chrishajas/gpdb,adam8157/gpdb,randomtask1155/gpdb,tangp3/gpdb,rvs/gpdb,yuanzhao/gpdb,janebeckman/gpdb,kmjungersen/PostgresXL,lintzc/gpdb,zaksoup/gpdb,kaknikhil/gpdb,rubikloud/gpdb,Chibin/gpdb,ahachete/gpdb,50wu/gpdb,kaknikhil/gpdb,royc1/gpdb,chrishajas/gpdb,kmjungersen/PostgresXL,foyzur/gpdb,chrishajas/gpdb