Re: Invalid password for \ and ' characters

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>, "Andrus Moor" <eetasoft(at)online(dot)ee>
Cc: <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Invalid password for \ and ' characters
Date: 2006-03-20 09:30:31
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E4011C95B8@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

> -----Original Message-----
> From: pgadmin-support-owner(at)postgresql(dot)org
> [mailto:pgadmin-support-owner(at)postgresql(dot)org] On Behalf Of
> Andreas Pflug
> Sent: 19 March 2006 11:19
> To: Andrus Moor
> Cc: pgadmin-support(at)postgresql(dot)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.

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2006-03-20 11:30:26 Re: Mac version can't dump/restore
Previous Message Hiroshi Saito 2006-03-20 09:11:10 Re: Help