Re: Invalid password for \ and ' characters - Mailing list pgadmin-support

From Dave Page
Subject Re: Invalid password for \ and ' characters
Date
Msg-id E7F85A1B5FF8D44C8A1AF6885BC9A0E4011C95B8@ratbert.vale-housing.co.uk
Whole thread Raw
In response to Invalid password for \ and ' characters  ("Andrus Moor" <eetasoft@online.ee>)
List pgadmin-support

> -----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.


pgadmin-support by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: Help
Next
From: "Dave Page"
Date:
Subject: Re: Mac version can't dump/restore