Re: Cannot connect to the database (PG 7.3)

From: Michiel Lange <michiel(at)minas(dot)demon(dot)nl>
To: Michiel Lange <michiel(at)minas(dot)demon(dot)nl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Cannot connect to the database (PG 7.3)
Date: 2003-01-28 21:20:52
Message-ID: 5.1.0.14.0.20030128221603.00b33d50@192.168.1.3
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

OK, I figured it out now:

It is, somehow, not possible to connect as a user which name is completely
numeric. I did a few tests on the same machine, and this is the outcome:

psql -h myhost -d mydb -U postgres -> connects fine
CREATE USER "12345" WITH PASSWORD 'secret';
CREATE USER
\q
psql -h myhost -d mydb -U 12345 -> error
psql -h myhost -d mydb -U "12345" -> error
psql -h myhost -d mydb -U '12345' -> error

psql -h myhost -d mydb -U postgres
DROP USER "12345";
DROP USER
CREATE USER n12345 WITH PASSWORD 'secret';
CREATE USER
\q
psql -h myhost -d mydb -U n12345 -> connects fine!

I think this is a bug, I will report it as one anyways... who knows what
comes from it...
it is not nice that the DBMS does not prevent me from creating a user that
cannot connect...
so either it should be prevented or possible...

But thanks for thinking along with me...

Michiel

At 14:19 27-1-2003 +0100, Michiel Lange wrote:
>it is at connect-time, so there is nothing done with set session
>authorization.
>I just want to connect, and read data from a table to which the group the
>user is in has read-access.
>I have tried if it would differ when I try to connect with a user created
>like:
>CREATE USER 20020003 WITH ENCRYPTED PASSWORD 'secret';
>or
>CREATE USER 20020004 WITH UNENCRYPTED PASSWORD 'secred';
>it would not matter... even if there really is a trust-relation between my
>computer and the other machine in pg_hba.conf
>it is pretty strange... might it be a bug?
>
>Thanks for the try though,
>Michiel
>At 19:42 26-1-2003 -0500, Tom Lane wrote:
>>Michiel Lange <michiel(at)minas(dot)demon(dot)nl> writes:
>> > I get this error message:
>> > psql: FATAL: permission denied
>>
>>As near as I can tell, you must have some code that is trying to do
>>SET SESSION AUTHORIZATION --- which only a superuser is allowed to do.
>>Evidently user 20020003 isn't one.
>>
>> regards, tom lane
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-01-28 21:43:22 Re: Cannot connect to the database (PG 7.3)
Previous Message Andrew Sullivan 2003-01-28 21:12:32 Re: Replication

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-01-28 21:40:53 Replication talk
Previous Message Zac Hillier 2003-01-28 19:29:04 unsubscribe