Tom Lane wrote:
> "Peter Eisentraut" <[EMAIL PROTECTED]> writes:
> > While I don't really agree that this is a problem, better solutions would
> > be to not quote the thing at all or write something like Table "%s"
> > (Schema "%s").  However, the message style guidelines are very clear on
> > this point, and before we deviate I'd like to see an adjusted proposal.
> 
> As Bruce pointed out, this isn't really a message; it's just a column
> heading, and so it's not clear that the message style guidelines apply.
> 
> I kinda like the idea of not quoting it at all, actually, since that is
> a far simpler solution.

I looked into doing no quotes at all.  Look at this.  I have a table "xx y":
        
        test=> \d
                List of relations
         Schema | Name | Type  |  Owner
        --------+------+-------+----------
         public | test | table | postgres
         public | xx   | table | postgres
         public | xx y | table | postgres
        (3 rows)
        
        test=> \d xx y
               Table public.xx                  <-- wrong table
         Column |  Type   | Modifiers
        --------+---------+-----------
         y      | integer |
        Indexes:
            ii btree (y)
        
        \d: extra argument "y" ignored          <-- fails without quotes

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

        test=> create table "Xa" (y int);
        CREATE TABLE

        test=> \d Xa
        Did not find any relation named "Xa".   <-- again, requires quotes
        test=> \d "Xa"
              Table public."Xa"
         Column |  Type   | Modifiers
        --------+---------+-----------
         y      | integer |


Because the backslash commands require quotes to access specific tables,
and because queries will require quotes, I thought displaying quotes
when appropriate was a good idea and a good reminder to users.  I also
thought that spaces in names could lead to confusing displays where the
spaces don't clearly identify where the object name begins and ends in
the display --- something Peter was concerned about.

-- 
  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 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to