Re: ALTER ROLE role-name-with-hyphen

From: Lennin Caro <lennin(dot)caro(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org, Tom Copeland <tom(at)infoether(dot)com>
Subject: Re: ALTER ROLE role-name-with-hyphen
Date: 2008-08-08 21:24:21
Message-ID: 701507.84034.qm@web59509.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

use the double quotes (")

ALTER USER "foo-bar" WITH ENCRYPTED PASSWORD 'foo-bar'

--- On Fri, 8/8/08, Tom Copeland <tom(at)infoether(dot)com> wrote:

> From: Tom Copeland <tom(at)infoether(dot)com>
> Subject: [GENERAL] ALTER ROLE role-name-with-hyphen
> To: pgsql-general(at)postgresql(dot)org
> Date: Friday, August 8, 2008, 8:49 PM
> Hi all -
>
> This is probably a new bee question... but, how do I change
> the
> password of a role that has a hyphen in the name?
>
> ======================
> $ createuser --no-superuser --createdb --no-createrole
> foo-bar
> $ psql
> Welcome to psql 8.3.0, the PostgreSQL interactive terminal.
>
> Type: \copyright for distribution terms
> \h for help with SQL commands
> \? for help with psql commands
> \g or terminate with semicolon to execute query
> \q to quit
>
> postgres=# ALTER USER foo-bar WITH ENCRYPTED PASSWORD
> 'foo-bar';
> ERROR: syntax error at or near "-"
> LINE 1: ALTER USER foo-bar WITH ENCRYPTED PASSWORD
> 'foo-bar';
> ^
> ======================
>
> So I can create the role but I can't figure out how to
> modify it.
> I've tried a variety of quoting and backslashing and
> such, but no luck
> yet.... any ideas?
>
> Thanks,
>
> Tom
>
>
>
>
> --
> Sent via pgsql-general mailing list
> (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2008-08-08 22:57:41 Re: Checkpoints writes
Previous Message Tom Copeland 2008-08-08 21:09:13 Re: ALTER ROLE role-name-with-hyphen