Skip site navigation (1) Skip section navigation (2)

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-08 01:37:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-docs
Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > 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,
> Uh, surely that breaks things.  Or did you miss my statement that the
> current behavior is what is intended?

I saw that, but how is that consistent with other command-line tools? 
What is the logic that has some tools preserve case and others not?

> > and adds a general documentation overview about
> > when case is preserved and suggests quoting, and adds documentation
> > where special quoting happens.
> I don't find the documentation changes to be improvements either.
> Possibly instead of
> > !         Specifies the default tablespace for the database (double-quoted internally).
> you could do something like
>          Specifies the default tablespace for the database.  (This name
>          is not subject to case-folding.)


> > +    <para>
> > +     When specified on the command line, user and databases names have
> > +     their case preserved &mdash; the presence of spaces or special
> > +     characters might require quoting.  Table names and other identifiers
> > +     do not have their case preserved, except where documented, and
> > +     might require quoting.
> > +    </para>
> This latter sentence is just plain wrong.

Really?  Pg_dump doesn't preserve case for table names:

	pg_dump -t Test test

	$ pg_dump -t Test test
	pg_dump: No matching tables were found
	$ pg_dump -t '"Test"' test
	-- PostgreSQL database dump

and vacuumdb certainly does not:

	vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy

	$ vacuumdb --analyze --verbose --table 'Test (x)' test
	vacuumdb: vacuuming of table "Test (x)" in database "test" failed: ERROR:  relation "test" does not exist
	$ vacuumdb --analyze --verbose --table '"Test" (x)' test
	INFO:  vacuuming "public.Test"
	INFO:  "Test": found 0 removable, 0 nonremovable row versions in 0 out of 0 pages

Who does?  reindexdb and clusterdb did before my patch, but that hardly
seems consistent.

  Bruce Momjian  <bruce(at)momjian(dot)us>

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

In response to


pgsql-docs by date

Next:From: Bruce MomjianDate: 2011-09-08 13:14:26
Subject: Re: createuser/dropuser username
Previous:From: Tom LaneDate: 2011-09-07 22:07:03
Subject: Re: createuser/dropuser username

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group