Wanted: Trick for granting permissions to users with hyphens

Started by Herbert Liechtiover 22 years ago3 messagesgeneral
Jump to latest
#1Herbert Liechti
herbie@thinx.ch

Hello

I like to grant some permissions to the user www-data (default user
for apache under debian)

GRANT SELECT, UPDATE, INSERT, DELETE ON customer TO herbie, www-data;

The statements throws the following error:
ERROR: parser: parse error at or near "-" at character 64

Seems to me that hyphens are not allowed for user names. But a �createuser
www-data� is working correct an I can access the database with that
user.

I tried to quote the www-data with 'www-data', www\-data with
the same result.

Any hints? I'm using 7.3.2

Thanks and best regards
Herbie
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti http://www.thinx.ch
The content management company. Visit http://www.contentx.ch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#2Bruno Wolff III
bruno@wolff.to
In reply to: Herbert Liechti (#1)
Re: Wanted: Trick for granting permissions to users with hyphens

On Wed, Nov 19, 2003 at 16:48:49 +0100,
Herbert Liechti <herbie@thinx.ch> wrote:

Hello

I like to grant some permissions to the user www-data (default user
for apache under debian)

GRANT SELECT, UPDATE, INSERT, DELETE ON customer TO herbie, www-data;

The statements throws the following error:
ERROR: parser: parse error at or near "-" at character 64

Seems to me that hyphens are not allowed for user names. But a �createuser
www-data� is working correct an I can access the database with that
user.

I tried to quote the www-data with 'www-data', www\-data with
the same result.

Any hints? I'm using 7.3.2

Single quotes are for data; use double quotes for including special characters
in names.

#3Bruce Momjian
bruce@momjian.us
In reply to: Herbert Liechti (#1)
Re: Wanted: Trick for granting permissions to users with hyphens

Herbert Liechti wrote:

Hello

I like to grant some permissions to the user www-data (default user
for apache under debian)

GRANT SELECT, UPDATE, INSERT, DELETE ON customer TO herbie, www-data;

The statements throws the following error:
ERROR: parser: parse error at or near "-" at character 64

Seems to me that hyphens are not allowed for user names. But a ?createuser
www-data? is working correct an I can access the database with that
user.

I tried to quote the www-data with 'www-data', www\-data with
the same result.

Any hints? I'm using 7.3.2

Double-quotes:

test=> GRANT SELECT, UPDATE, INSERT, DELETE ON test TO "www-data";

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073