Re: nitpick consistency patch for pg_dump.c

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: nitpick consistency patch for pg_dump.c
Date: 2003-07-22 01:01:19
Message-ID: 200307220101.h6M11JA06482@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Later patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

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

Andrew Dunstan wrote:
>
> This is a totally trivial patch for something that was a very minor nit that
> annoyed me the other day while I was documenting my current project. It
> makes pg_dump use the same layout for types as for tables, by putting "\n\t"
> before the first field and "\n" before the final ");"
>
> Can't really justify this too much except to say I had an itch and I
> scratched it ;-)
>
> cheers
>
> andrew
>
>
>
> *** pg_dump.c~ 2003-06-25 00:08:19.000000000 -0400
> --- pg_dump.c 2003-07-17 15:34:52.000000000 -0400
> ***************
> *** 3412,3418 ****
> i_attname = PQfnumber(res, "attname");
> i_atttypdefn = PQfnumber(res, "atttypdefn");
>
> ! appendPQExpBuffer(q, "CREATE TYPE %s AS (",
> fmtId(tinfo->typname));
>
> for (i = 0; i < ntups; i++)
> --- 3412,3418 ----
> i_attname = PQfnumber(res, "attname");
> i_atttypdefn = PQfnumber(res, "atttypdefn");
>
> ! appendPQExpBuffer(q, "CREATE TYPE %s AS (\n",
> fmtId(tinfo->typname));
>
> for (i = 0; i < ntups; i++)
> ***************
> *** 3423,3433 ****
> attname = PQgetvalue(res, i, i_attname);
> atttypdefn = PQgetvalue(res, i, i_atttypdefn);
>
> ! if (i > 0)
> ! appendPQExpBuffer(q, ",\n\t");
> ! appendPQExpBuffer(q, "%s %s", fmtId(attname), atttypdefn);
> }
> ! appendPQExpBuffer(q, ");\n");
>
> /*
> * DROP must be fully qualified in case same name appears in
> --- 3423,3431 ----
> attname = PQgetvalue(res, i, i_attname);
> atttypdefn = PQgetvalue(res, i, i_atttypdefn);
>
> ! appendPQExpBuffer(q, "\n\t%s %s", fmtId(attname),
> atttypdefn); }
> ! appendPQExpBuffer(q, "\n);\n");
>
> /*
> * DROP must be fully qualified in case same name appears in
>
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-07-22 03:50:17 Re: Adding Rendezvous support to postmaster
Previous Message Bruce Momjian 2003-07-22 00:15:43 Re: psql patches for win32