Re: [ADMIN] Cannot connect to the database (PG 7.3)

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michiel Lange <michiel(at)minas(dot)demon(dot)nl>, pgsql-hackers(at)postgreSQL(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: [ADMIN] Cannot connect to the database (PG 7.3)
Date: 2003-01-29 01:44:55
Message-ID: Pine.LNX.4.21.0301290142170.2839-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Tue, 28 Jan 2003, Tom Lane wrote:

> I wrote:
> > Michiel Lange <michiel(at)minas(dot)demon(dot)nl> writes:
> >> It is, somehow, not possible to connect as a user which name is completely
> >> numeric.
>
> > I muttered "nonsense!" to myself, but darned if you're not right:
>
> > regression=# create user "12345";
> > CREATE USER
> > regression=# \q
> > $ psql -U 12345 regression
> > psql: FATAL: SET SESSION AUTHORIZATION: permission denied
>
> > Will look into it.
>
> After some looking, it appears the culprit is
> assign_session_authorization() in commands/variable.c, which is assuming
> that a numeric-looking parameter string should be taken as a numeric
> user sysid, rather than an actual user name.
>
> The reason this was done was to avoid the need to do catalog lookups
> when restoring a prior setting during error recovery. That's still a
> valid concern, so right offhand I don't see an easy fix. Any ideas?

How about throwing an error if an all digit user name is given to create
user as already alluded to?

Seems that would be simple, not that I know anything about the parser, but does
that break any standards?

--
Nigel J. Andrews

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-01-29 02:00:52 Re: [ADMIN] Cannot connect to the database (PG 7.3)
Previous Message Marc G. Fournier 2003-01-28 23:57:46 Re: Replication

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-01-29 01:50:58 Testing for int64 (was Re: [COMMITTERS] pgsql-server/ /configure /configure.in...)
Previous Message Kris Allsop 2003-01-28 23:56:09 unsubscribe