(trivial patch) remove superfluous semicolons from pg_dump

Lists: pgsql-hackers
From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: (trivial patch) remove superfluous semicolons from pg_dump
Date: 2013-07-03 15:12:11
Message-ID: CAB8KJ=hF=fPCDFAhhYLVbiG52Cv+xWaSEwjpWqv0xO1BnpuHYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I noticed an instance of 'appendPQExpBuffer(query, ";");' in pg_dump.c which
seems pointless and mildly confusing. There's another seemingly
useless one in pg_dumpall.c. Attached patch removes both (if that
makes any sense).

Regards

Ian Barwick

Attachment Content-Type Size
pg_dump-cull-semicolons.patch application/octet-stream 950 bytes

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: (trivial patch) remove superfluous semicolons from pg_dump
Date: 2013-07-31 15:37:27
Message-ID: 20130731153727.GB3716@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Applied.

---------------------------------------------------------------------------

On Thu, Jul 4, 2013 at 12:12:11AM +0900, Ian Lawrence Barwick wrote:
> I noticed an instance of 'appendPQExpBuffer(query, ";");' in pg_dump.c which
> seems pointless and mildly confusing. There's another seemingly
> useless one in pg_dumpall.c. Attached patch removes both (if that
> makes any sense).
>
>
> Regards
>
> Ian Barwick

> diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
> index 9ee9ea2..3d43b3b 100644
> --- a/src/bin/pg_dump/pg_dump.c
> +++ b/src/bin/pg_dump/pg_dump.c
> @@ -12751,7 +12751,6 @@ createViewAsClause(Archive *fout, TableInfo *tbinfo)
> appendPQExpBuffer(query, "SELECT definition AS viewdef "
> "FROM pg_views WHERE viewname = ");
> appendStringLiteralAH(query, tbinfo->dobj.name, fout);
> - appendPQExpBuffer(query, ";");
> }
>
> res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
> diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
> index 78f702f..283b3d9 100644
> --- a/src/bin/pg_dump/pg_dumpall.c
> +++ b/src/bin/pg_dump/pg_dumpall.c
> @@ -1428,8 +1428,6 @@ dumpDatabaseConfig(PGconn *conn, const char *dbname)
> if (server_version >= 90000)
> appendPQExpBuffer(buf, ")");
>
> - appendPQExpBuffer(buf, ";");
> -
> res = executeQuery(conn, buf->data);
> if (PQntuples(res) == 1 &&
> !PQgetisnull(res, 0, 0))

>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +