> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org
> [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of
> Andreas Pflug
> Sent: 19 March 2006 11:19
> To: Andrus Moor
> Cc: pgadmin-support@postgresql.org
> Subject: Re: [pgadmin-support] Invalid password for \ and ' characters
>
> Andrus Moor wrote:
> > If password set by pgadmin contains \ or ' character, it is
> not possible to
> > login to pgAdmin
> >
> > PROBLEM WITH \ character is password
> >
> > To reproduce
> >
> > 1. Create new login role in pgadmin
> > 2. Enter \ to password field.
> > 3. Select SQL tab
> >
> > Observed:
> >
> > CREATE ROLE test LOGIN PASSWORD '\\'
> >
> > Expected
> >
> > CREATE ROLE test LOGIN PASSWORD '\'
> >
> > Postres does NOT require backslashes in password strings.
> > PgAdmin probably uses its qtString for password strings.
>
> AFAIR Dave recently changed that. Please check the CHANGELOG
> and try a
> newer version.
Yes, I did, but that was for the logon code where the rules of libpq are
observed rather than SQL.
As per the example given, Andrus has it backwards. The password string
in PostgreSQL is just like any other string and will always require that
quotes and backslashes are escaped. Note in psql, how the prompt shows
the string is to be completed if a backslash is not quoted:
postgres=> alter role dpage with password '\';
postgres'>
Regards, Dave.