Unix Technical Forum

BUG #2690: GRANT does not allow periods in database or schema names

This is a discussion on BUG #2690: GRANT does not allow periods in database or schema names within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2690 Logged by: Nick Johnson Email address: pgsql@spatula.net PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 11:17 AM
Nick Johnson
 
Posts: n/a
Default BUG #2690: GRANT does not allow periods in database or schema names


The following bug has been logged online:

Bug reference: 2690
Logged by: Nick Johnson
Email address: pgsql@spatula.net
PostgreSQL version: 8.1.1
Operating system: FreeBSD 6.1
Description: GRANT does not allow periods in database or schema names
Details:

Though you can create a database with a period in the name (e.g.,
"example.com"), you cannot issue a GRANT on that database name from the
command line.

pgsql=# GRANT ALL ON DATABASE example.com TO someuser;
ERROR: syntax error at or near "." at character 30
LINE 1: GRANT ALL ON DATABASE example.com TO someuser;

The same syntax works okay for databases without a period in the name.

Either GRANT should work on any database name that works when creating a
database, or CREATE should disallow the same things that GRANT disallows.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 11:17 AM
Alvaro Herrera
 
Posts: n/a
Default Re: BUG #2690: GRANT does not allow periods in database or schema names

Nick Johnson wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2690
> Logged by: Nick Johnson
> Email address: pgsql@spatula.net
> PostgreSQL version: 8.1.1
> Operating system: FreeBSD 6.1
> Description: GRANT does not allow periods in database or schema names
> Details:
>
> Though you can create a database with a period in the name (e.g.,
> "example.com"), you cannot issue a GRANT on that database name from the
> command line.


Sure you can. Just quote the name:

GRANT ALL ON DATABASE "example.com" TO someuser;

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 11:17 AM
Peter Eisentraut
 
Posts: n/a
Default Re: BUG #2690: GRANT does not allow periods in database or schema names

Nick Johnson wrote:
> Though you can create a database with a period in the name (e.g.,
> "example.com"), you cannot issue a GRANT on that database name from
> the command line.
>
> pgsql=# GRANT ALL ON DATABASE example.com TO someuser;
> ERROR: syntax error at or near "." at character 30


You are making the faulty assumption that example.com and "example.com"
are the same thing.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 11:17 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #2690: GRANT does not allow periods in database or schema names

"Nick Johnson" <pgsql@spatula.net> writes:
> Though you can create a database with a period in the name (e.g.,
> "example.com"), you cannot issue a GRANT on that database name from the
> command line.


You need some double quotes:
http://www.postgresql.org/docs/8.1/s...AX-IDENTIFIERS

This is by no means unique to GRANT, nor to database names.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:14 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com