Re: createuser/dropuser username

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Susanne Ebrecht <susanne(at)2ndQuadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Grzegorz Szpetkowski <gszpetkowski(at)gmail(dot)com>, pgsql-docs(at)postgresql(dot)org
Subject: Re: createuser/dropuser username
Date: 2011-09-07 21:48:36
Message-ID: 201109072148.p87LmaM23680@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Tom Lane wrote:
> Susanne Ebrecht <susanne(at)2ndQuadrant(dot)com> writes:
> > PostgreSQL even is so intelligent - that when you say:
> > $ createdb "tEst" - it will ignore the quotes - you will get database
> > named tEst and not
> > named "tEst".
>
> Not true. The reason you don't get quotes there is that the shell
> stripped them off. Try '"tEst"' ...
>
> The current behavior is something that we settled on years ago, after
> thinking about the interaction between shell quoting rules and SQL
> quoting rules. If we don't treat SQL names appearing on command lines
> as spelled literally, then you have to quote them if you don't want them
> downcased --- and doing that in a way that the shell won't mangle is
> unpleasant, as in my example above. So we ruled that all utilities that
> take a SQL name from the command line should auto-quote the name.
>
> I'm pretty sure this is documented somewhere, but perhaps not in the
> place where Grzegorz looked for it ...

Uh, I did some digging after this email report and found it does need
some cleanup, which is done in the attached patch.

It removes quoting for table references in clusterdb and index/table
references in reindexdb, and adds a general documentation overview about
when case is preserved and suggests quoting, and adds documentation
where special quoting happens.

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

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

Attachment Content-Type Size
/rtmp/quoting text/x-diff 6.5 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2011-09-07 22:07:03 Re: createuser/dropuser username
Previous Message Pavel Stehule 2011-09-07 13:40:19 Re: [BUGS] documentation bug - behave of NEW a OLD in plpgsql's triggers