Commit 9fecf302 authored by Bruce Momjian's avatar Bruce Momjian

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 <rbt@rbt.ca>
parent 187e8651
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* by PostgreSQL * by PostgreSQL
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.336 2003/07/23 08:47:30 petere Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.337 2003/07/25 19:37:21 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -3304,13 +3304,13 @@ dumpOneDomain(Archive *fout, TypeInfo *tinfo) ...@@ -3304,13 +3304,13 @@ dumpOneDomain(Archive *fout, TypeInfo *tinfo)
* Fetch and process CHECK constraints for the domain * Fetch and process CHECK constraints for the domain
*/ */
if (g_fout->remoteVersion >= 70400) if (g_fout->remoteVersion >= 70400)
appendPQExpBuffer(chkquery, "SELECT conname," appendPQExpBuffer(chkquery, "SELECT conname, "
"pg_catalog.pg_get_constraintdef(oid) AS consrc " "pg_catalog.pg_get_constraintdef(oid) AS consrc "
"FROM pg_catalog.pg_constraint " "FROM pg_catalog.pg_constraint "
"WHERE contypid = '%s'::pg_catalog.oid", "WHERE contypid = '%s'::pg_catalog.oid",
tinfo->oid); tinfo->oid);
else else
appendPQExpBuffer(chkquery, "SELECT conname, 'CHECK (' || consrc || ')'" appendPQExpBuffer(chkquery, "SELECT conname, 'CHECK (' || consrc || ')' AS consrc "
"FROM pg_catalog.pg_constraint " "FROM pg_catalog.pg_constraint "
"WHERE contypid = '%s'::pg_catalog.oid", "WHERE contypid = '%s'::pg_catalog.oid",
tinfo->oid); tinfo->oid);
...@@ -5267,8 +5267,8 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo) ...@@ -5267,8 +5267,8 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo)
if (g_fout->remoteVersion >= 70400) if (g_fout->remoteVersion >= 70400)
appendPQExpBuffer(query, "SELECT conname, " appendPQExpBuffer(query, "SELECT conname, "
" pg_catalog.pg_get_constraintdef(c1.oid) AS consrc " " pg_catalog.pg_get_constraintdef(c1.oid) AS consrc "
" from pg_catalog.pg_constraint c1" " from pg_catalog.pg_constraint c1 "
" where conrelid = '%s'::pg_catalog.oid " " where conrelid = '%s'::pg_catalog.oid "
" and contype = 'c' " " and contype = 'c' "
" and not exists " " and not exists "
" (select 1 from " " (select 1 from "
...@@ -5286,7 +5286,7 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo) ...@@ -5286,7 +5286,7 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo)
tbinfo->oid); tbinfo->oid);
else if (g_fout->remoteVersion >= 70300) else if (g_fout->remoteVersion >= 70300)
appendPQExpBuffer(query, "SELECT conname, " appendPQExpBuffer(query, "SELECT conname, "
" 'CHECK (' || consrc || ')'" " 'CHECK (' || consrc || ')' AS consrc"
" from pg_catalog.pg_constraint c1" " from pg_catalog.pg_constraint c1"
" where conrelid = '%s'::pg_catalog.oid " " where conrelid = '%s'::pg_catalog.oid "
" and contype = 'c' " " and contype = 'c' "
...@@ -6063,7 +6063,7 @@ dumpConstraints(Archive *fout, TableInfo *tblinfo, int numTables) ...@@ -6063,7 +6063,7 @@ dumpConstraints(Archive *fout, TableInfo *tblinfo, int numTables)
resetPQExpBuffer(query); resetPQExpBuffer(query);
appendPQExpBuffer(query, appendPQExpBuffer(query,
"SELECT oid, conname, " "SELECT oid, conname, "
"pg_catalog.pg_get_constraintdef(oid) as condef " "pg_catalog.pg_get_constraintdef(oid) as condef "
"FROM pg_catalog.pg_constraint " "FROM pg_catalog.pg_constraint "
"WHERE conrelid = '%s'::pg_catalog.oid " "WHERE conrelid = '%s'::pg_catalog.oid "
"AND contype = 'f'", "AND contype = 'f'",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment