diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index b93dd8bf3c1acfd5ed65cdc41a0df1afc4cd7a25..07050cd08f08b5c18d0b246d7410a0a7d0032ca9 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -13044,7 +13044,7 @@ dumpCollation(Archive *fout, CollInfo *collinfo) collinfo->dobj.catId.oid); else appendPQExpBuffer(query, "SELECT " - "'c'::char AS collprovider, " + "'c' AS collprovider, " "collcollate, " "collctype, " "NULL AS collversion " @@ -16351,13 +16351,16 @@ dumpSequence(Archive *fout, TableInfo *tbinfo) /* * Before PostgreSQL 10, sequence metadata is in the sequence itself, * so switch to the sequence's schema instead of pg_catalog. + * + * Note: it might seem that 'bigint' potentially needs to be + * schema-qualified, but actually that's a keyword. */ /* Make sure we are in proper schema */ selectSourceSchema(fout, tbinfo->dobj.namespace->dobj.name); appendPQExpBuffer(query, - "SELECT 'bigint'::name AS sequence_type, " + "SELECT 'bigint' AS sequence_type, " "start_value, increment_by, max_value, min_value, " "cache_value, is_cycled FROM %s", fmtId(tbinfo->dobj.name)); @@ -16368,7 +16371,7 @@ dumpSequence(Archive *fout, TableInfo *tbinfo) selectSourceSchema(fout, tbinfo->dobj.namespace->dobj.name); appendPQExpBuffer(query, - "SELECT 'bigint'::name AS sequence_type, " + "SELECT 'bigint' AS sequence_type, " "0 AS start_value, increment_by, max_value, min_value, " "cache_value, is_cycled FROM %s", fmtId(tbinfo->dobj.name)); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 70548d828b0f731b0f23690114d113f7262bc3c0..5b775d37c211fa6d51f74257d3773b358abc3858 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -1596,7 +1596,7 @@ describeOneTableDetails(const char *schemaname, else { printfPQExpBuffer(&buf, - "SELECT pg_catalog.format_type('bigint'::regtype, NULL) AS \"%s\",\n" + "SELECT 'bigint' AS \"%s\",\n" " start_value AS \"%s\",\n" " min_value AS \"%s\",\n" " max_value AS \"%s\",\n" @@ -2483,7 +2483,7 @@ describeOneTableDetails(const char *schemaname, { printfPQExpBuffer(&buf, "SELECT r.rulename, trim(trailing ';' from pg_catalog.pg_get_ruledef(r.oid, true)), " - "'O'::char AS ev_enabled\n" + "'O' AS ev_enabled\n" "FROM pg_catalog.pg_rewrite r\n" "WHERE r.ev_class = '%s' ORDER BY 1;", oid);