Quoting of psql \d output

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Quoting of psql \d output
Date: 2003-12-23 05:09:53
Message-ID: 200312230509.hBN59r003126@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

psql \d always double-quotes table names:

Table "public.xx"
Column | Type | Modifiers
--------+---------+-----------
y | integer |
Indexes:
"ii" btree (y)

With this patch, double-quotes are not used when not required:

test=> \d xx
Table public.xx
Column | Type | Modifiers
--------+---------+-----------
y | integer |
Indexes:
ii btree (y)

but does in this case:

test=> \d "xx y"
Table public."xx y"
Column | Type | Modifiers
--------+---------+-----------
y | integer |
Indexes:
vv btree (y)

This patch uses pg_dump fmtId() to double-quote only when necessary.

--
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

Attachment Content-Type Size
unknown_filename text/plain 6.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-12-23 05:27:30 Re: Quoting of psql \d output
Previous Message Bruce Momjian 2003-12-23 04:58:37 Re: [GENERAL] Temporary tables and miscellaneous schemas

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-12-23 05:27:30 Re: Quoting of psql \d output
Previous Message Bruce Momjian 2003-12-23 04:58:37 Re: [GENERAL] Temporary tables and miscellaneous schemas