mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Wrap some long queries.
This commit is contained in:
@ -12,7 +12,7 @@
|
|||||||
* by PostgreSQL
|
* by PostgreSQL
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.520 2009/02/16 22:50:41 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.521 2009/02/16 23:06:55 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -4652,8 +4652,10 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
|
|||||||
if (g_fout->remoteVersion >= 70300)
|
if (g_fout->remoteVersion >= 70300)
|
||||||
{
|
{
|
||||||
/* need left join here to not fail on dropped columns ... */
|
/* need left join here to not fail on dropped columns ... */
|
||||||
appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, a.attstattarget, a.attstorage, t.typstorage, "
|
appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, "
|
||||||
"a.attnotnull, a.atthasdef, a.attisdropped, a.attislocal, "
|
"a.attstattarget, a.attstorage, t.typstorage, "
|
||||||
|
"a.attnotnull, a.atthasdef, a.attisdropped, "
|
||||||
|
"a.attislocal, "
|
||||||
"pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname "
|
"pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname "
|
||||||
"FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
|
"FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
|
||||||
"ON a.atttypid = t.oid "
|
"ON a.atttypid = t.oid "
|
||||||
@ -4669,8 +4671,10 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
|
|||||||
* we don't dump it because we can't tell whether it's been
|
* we don't dump it because we can't tell whether it's been
|
||||||
* explicitly set or was just a default.
|
* explicitly set or was just a default.
|
||||||
*/
|
*/
|
||||||
appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, -1 AS attstattarget, a.attstorage, t.typstorage, "
|
appendPQExpBuffer(q, "SELECT a.attnum, a.attname, "
|
||||||
"a.attnotnull, a.atthasdef, false AS attisdropped, false AS attislocal, "
|
"a.atttypmod, -1 AS attstattarget, a.attstorage, "
|
||||||
|
"t.typstorage, a.attnotnull, a.atthasdef, "
|
||||||
|
"false AS attisdropped, false AS attislocal, "
|
||||||
"format_type(t.oid,a.atttypmod) AS atttypname "
|
"format_type(t.oid,a.atttypmod) AS atttypname "
|
||||||
"FROM pg_attribute a LEFT JOIN pg_type t "
|
"FROM pg_attribute a LEFT JOIN pg_type t "
|
||||||
"ON a.atttypid = t.oid "
|
"ON a.atttypid = t.oid "
|
||||||
@ -4682,8 +4686,11 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* format_type not available before 7.1 */
|
/* format_type not available before 7.1 */
|
||||||
appendPQExpBuffer(q, "SELECT attnum, attname, atttypmod, -1 AS attstattarget, attstorage, attstorage AS typstorage, "
|
appendPQExpBuffer(q, "SELECT attnum, attname, atttypmod, "
|
||||||
"attnotnull, atthasdef, false AS attisdropped, false AS attislocal, "
|
"-1 AS attstattarget, attstorage, "
|
||||||
|
"attstorage AS typstorage, "
|
||||||
|
"attnotnull, atthasdef, false AS attisdropped, "
|
||||||
|
"false AS attislocal, "
|
||||||
"(SELECT typname FROM pg_type WHERE oid = atttypid) AS atttypname "
|
"(SELECT typname FROM pg_type WHERE oid = atttypid) AS atttypname "
|
||||||
"FROM pg_attribute a "
|
"FROM pg_attribute a "
|
||||||
"WHERE attrelid = '%u'::oid "
|
"WHERE attrelid = '%u'::oid "
|
||||||
|
Reference in New Issue
Block a user