Re: Username with a hyphen character (grant failing?)

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Username with a hyphen character (grant failing?)
Date: 2001-06-02 09:22:07
Message-ID: 20010602042207.B28201@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, May 25, 2001 at 11:38:50AM -0400, Doug McNaught wrote:
> Sean Chittenden <sean-pgsql-general(at)chittenden(dot)org> writes:
>
> > > > What's the scoop with username constraints? I setup and
> > > > created a user with a '-' character in the middle (worked).
> > >
> > > Double quotes are your friend when dealing with names that don't
> > > follow the usual constraints for identifiers.
> >
> > Are single quotes treated differently than double? I tried
> > single, but didn't have any luck... -sc
>
> Yes. Single quotes are for strings; double quotes are for
> identifiers.

meaning, for example:

create table info (
"this field" text,
"that-field" integer,
"it's alarming" serial
);
insert into info("this-field")values('here\'s the contents for that column in the table');

or

grant select on "table named with spaces" to "some-oddball-user";

select 'this is a string value, not a field or table name';

--
#95: We are waking up and linking to each other. We are watching. But
we are not waiting. -- www.cluetrain.com

will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2001-06-02 09:26:28 Re: having problems with a simple query
Previous Message will trillich 2001-06-02 09:17:28 Re: pl-perl setup?