Re: [GENERAL] pg_restore casts check constraints differently

2016-03-30 Thread Tom Lane
Amit Langote writes: > destdb=# ALTER TABLE c ADD CONSTRAINT p_a_check CHECK (a IN ('a', 'b', 'c')); > destdb=# \d c > ... > Check constraints: > "p_a_check" CHECK (a::text = ANY (ARRAY['a'::character varying, > 'b'::character varying, 'c'::character

Re: [GENERAL] pg_restore casts check constraints differently

2016-03-30 Thread Amit Langote
On Wed, Mar 30, 2016 at 6:45 AM, Tom Lane wrote: > Joshua Ma writes: >> This might not be a common case, but we're using pg_dump in a testing >> environment to check migrations - 1) we initialize the db from HEAD, >> pg_dump it, 2) we initialize the db

Re: [GENERAL] pg_restore casts check constraints differently

2016-03-29 Thread David G. Johnston
On Tue, Mar 29, 2016 at 7:40 PM, Tom Lane wrote: > "David G. Johnston" writes: > > On Tue, Mar 29, 2016 at 2:45 PM, Tom Lane wrote: > >> It's not really different. What you're seeing is pg_dump (or actually > >> ruleutils.c)

Re: [GENERAL] pg_restore casts check constraints differently

2016-03-29 Thread Tom Lane
"David G. Johnston" writes: > On Tue, Mar 29, 2016 at 2:45 PM, Tom Lane wrote: >> It's not really different. What you're seeing is pg_dump (or actually >> ruleutils.c) choosing to dump some implicit casts explicitly to ensure >> that the

Re: [GENERAL] pg_restore casts check constraints differently

2016-03-29 Thread David G. Johnston
On Tue, Mar 29, 2016 at 2:45 PM, Tom Lane wrote: > Joshua Ma writes: > > This might not be a common case, but we're using pg_dump in a testing > > environment to check migrations - 1) we initialize the db from HEAD, > > pg_dump it, 2) we initialize the db

Re: [GENERAL] pg_restore casts check constraints differently

2016-03-29 Thread Tom Lane
Joshua Ma writes: > This might not be a common case, but we're using pg_dump in a testing > environment to check migrations - 1) we initialize the db from HEAD, > pg_dump it, 2) we initialize the db from migration_base.sql, apply > migrations, pg_dump it, and 3) compare the

[GENERAL] pg_restore casts check constraints differently

2016-03-29 Thread Joshua Ma
This might not be a common case, but we're using pg_dump in a testing environment to check migrations - 1) we initialize the db from HEAD, pg_dump it, 2) we initialize the db from migration_base.sql, apply migrations, pg_dump it, and 3) compare the two dumps to verify that our migrations are