Seems my check constraint change did break stuff.

Alias the appropriate columns back to their original name.

Fixed formatting of a few other places as I went along (indenting)
-- 
Rod Taylor <[EMAIL PROTECTED]>

PGP Key: http://www.rbt.ca/rbtpub.asc
Ite ndex: src/bin/pg_dump/pg_dump.c
===================================================================
RCS file: /home/rbt/work/postgresql/cvs/pgsql-server/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.335
diff -c -r1.335 pg_dump.c
*** src/bin/pg_dump/pg_dump.c   25 Jun 2003 04:08:19 -0000      1.335
--- src/bin/pg_dump/pg_dump.c   26 Jun 2003 13:56:55 -0000
***************
*** 3304,3316 ****
         * Fetch and process CHECK constraints for the domain
         */
        if (g_fout->remoteVersion >= 70400)
!               appendPQExpBuffer(chkquery, "SELECT conname,"
                                                  
"pg_catalog.pg_get_constraintdef(oid) AS consrc "
                                                  "FROM pg_catalog.pg_constraint "
                                                  "WHERE contypid = 
'%s'::pg_catalog.oid",
                                                  tinfo->oid);
        else
!               appendPQExpBuffer(chkquery, "SELECT conname, 'CHECK (' || consrc || 
')'"
                                                  "FROM pg_catalog.pg_constraint "
                                                  "WHERE contypid = 
'%s'::pg_catalog.oid",
                                                  tinfo->oid);
--- 3304,3316 ----
         * Fetch and process CHECK constraints for the domain
         */
        if (g_fout->remoteVersion >= 70400)
!               appendPQExpBuffer(chkquery, "SELECT conname, "
                                                  
"pg_catalog.pg_get_constraintdef(oid) AS consrc "
                                                  "FROM pg_catalog.pg_constraint "
                                                  "WHERE contypid = 
'%s'::pg_catalog.oid",
                                                  tinfo->oid);
        else
!               appendPQExpBuffer(chkquery, "SELECT conname, 'CHECK (' || consrc || 
')' AS consrc "
                                                  "FROM pg_catalog.pg_constraint "
                                                  "WHERE contypid = 
'%s'::pg_catalog.oid",
                                                  tinfo->oid);
***************
*** 5267,5274 ****
                        if (g_fout->remoteVersion >= 70400)
                                appendPQExpBuffer(query, "SELECT conname, "
                                                                  " 
pg_catalog.pg_get_constraintdef(c1.oid) AS consrc "
!                                                                 " from 
pg_catalog.pg_constraint c1"
!                                                               " where conrelid = 
'%s'::pg_catalog.oid "
                                                                  "   and contype = 
'c' "
                                                                  "   and not exists "
                                                                  "  (select 1 from "
--- 5267,5274 ----
                        if (g_fout->remoteVersion >= 70400)
                                appendPQExpBuffer(query, "SELECT conname, "
                                                                  " 
pg_catalog.pg_get_constraintdef(c1.oid) AS consrc "
!                                                                 " from 
pg_catalog.pg_constraint c1 "
!                                                                 " where conrelid = 
'%s'::pg_catalog.oid "
                                                                  "   and contype = 
'c' "
                                                                  "   and not exists "
                                                                  "  (select 1 from "
***************
*** 5286,5292 ****
                                                                  tbinfo->oid);
                        else if (g_fout->remoteVersion >= 70300)
                                appendPQExpBuffer(query, "SELECT conname, "
!                                                                 " 'CHECK (' || 
consrc || ')'"
                                                                  " from 
pg_catalog.pg_constraint c1"
                                                                " where conrelid = 
'%s'::pg_catalog.oid "
                                                                  "   and contype = 
'c' "
--- 5286,5292 ----
                                                                  tbinfo->oid);
                        else if (g_fout->remoteVersion >= 70300)
                                appendPQExpBuffer(query, "SELECT conname, "
!                                                                 " 'CHECK (' || 
consrc || ')' AS consrc"
                                                                  " from 
pg_catalog.pg_constraint c1"
                                                                " where conrelid = 
'%s'::pg_catalog.oid "
                                                                  "   and contype = 
'c' "
***************
*** 6063,6069 ****
                resetPQExpBuffer(query);
                appendPQExpBuffer(query,
                                                  "SELECT oid, conname, "
!                                               "pg_catalog.pg_get_constraintdef(oid) 
as condef "
                                                  "FROM pg_catalog.pg_constraint "
                                                  "WHERE conrelid = 
'%s'::pg_catalog.oid "
                                                  "AND contype = 'f'",
--- 6063,6069 ----
                resetPQExpBuffer(query);
                appendPQExpBuffer(query,
                                                  "SELECT oid, conname, "
!                                                 
"pg_catalog.pg_get_constraintdef(oid) as condef "
                                                  "FROM pg_catalog.pg_constraint "
                                                  "WHERE conrelid = 
'%s'::pg_catalog.oid "
                                                  "AND contype = 'f'",

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to