Peter Eisentraut wrote:
> Bruce Momjian writes:
> > But it isn't a message:
> >
> >            Table "public.xx"
> >      Column |  Type   | Modifiers
> >     --------+---------+-----------
> >      y      | integer |
> >     Indexes:
> >         "ii" btree (y)
> 
> By definition, everything that is printed out for human consumption is a
> message.
> 
> Everything that is printed out for consumption by an SQL parser (e.g., in
> pg_dump) is encouraged to use SQL quoting rules.  But everything that is

I see pg_dump using the same rules that I am proposing:
        
        CREATE TABLE "xx y" (
            y integer
        ) WITH OIDS;
        
        CREATE TABLE xx (
            y integer
        ) WITH OIDS;

[ We need that WITH OIDS fixed before 7.5.  I think Neil is working on it.]

> intended to be read by humans should use quoting rules that are common in
> real-life publishing.

To me quoting the table name is like quoting the name of a section
heading (which people don't do), and that's really what we are
displaying:

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

"Table public.xx" is the section heading, and before you complain that I
quoted it in this sentence, I had to because it is part of a sentence,
not on its own as it is in psql \d display.

You were suggesting no quotes at all.  Would this display be OK?
        
        test=> \d "xx y"
             Table public.xx y
         Column |  Type   | Modifiers
        --------+---------+-----------
         y      | integer |
        Indexes:
            vv btree (y)

Note I had to quote the table name to get \d to accept it.  To me that
'y' just sitting along looks strange.

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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to