提交 9fecf302 编写于 作者: B 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>
上级 187e8651
......@@ -12,7 +12,7 @@
* by PostgreSQL
*
* 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)
* Fetch and process CHECK constraints for the domain
*/
if (g_fout->remoteVersion >= 70400)
appendPQExpBuffer(chkquery, "SELECT conname,"
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 || ')'"
appendPQExpBuffer(chkquery, "SELECT conname, 'CHECK (' || consrc || ')' AS consrc "
"FROM pg_catalog.pg_constraint "
"WHERE contypid = '%s'::pg_catalog.oid",
tinfo->oid);
......@@ -5267,8 +5267,8 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo)
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 "
" from pg_catalog.pg_constraint c1 "
" where conrelid = '%s'::pg_catalog.oid "
" and contype = 'c' "
" and not exists "
" (select 1 from "
......@@ -5286,7 +5286,7 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo)
tbinfo->oid);
else if (g_fout->remoteVersion >= 70300)
appendPQExpBuffer(query, "SELECT conname, "
" 'CHECK (' || consrc || ')'"
" 'CHECK (' || consrc || ')' AS consrc"
" from pg_catalog.pg_constraint c1"
" where conrelid = '%s'::pg_catalog.oid "
" and contype = 'c' "
......@@ -6063,7 +6063,7 @@ dumpConstraints(Archive *fout, TableInfo *tblinfo, int numTables)
resetPQExpBuffer(query);
appendPQExpBuffer(query,
"SELECT oid, conname, "
"pg_catalog.pg_get_constraintdef(oid) as condef "
"pg_catalog.pg_get_constraintdef(oid) as condef "
"FROM pg_catalog.pg_constraint "
"WHERE conrelid = '%s'::pg_catalog.oid "
"AND contype = 'f'",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册