pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Martin <stephen@sealteam.demon.co.uk>
Cc: pgsql-interfaces@postgreSQL.org
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [INTERFACES] Date: Sat, 26 Feb 2000 17:01:55 -0800
Date: Sat, 26 Feb 2000 20:47:08 -0500
Message-ID: <22648.951616028@sss.pgh.pa.us> (raw)
In-Reply-To: <NDBBKKNKKLBACABPPCCNGEHPDOAA.stephen@sealteam.demon.co.uk>
References: <NDBBKKNKKLBACABPPCCNGEHPDOAA.stephen@sealteam.demon.co.uk>

"Stephen Martin" <stephen@sealteam.demon.co.uk> writes:
> For example I have a postgres id 'www' present within my pg_shadow/pg_user.
> I recently installed a package and inadvertantly created another 'www' user.

> How can I
> 1) Ensure I canot in future create duplicate names?

There should probably be a unique index on pg_shadow's usename field,
and another one on the usesysid field (otherwise there's not a unique
map from sysids to users, which is bad since we use sysids as
referential keys in other tables).

I'm surprised this hasn't been pointed out before :-(

I'm not sure how difficult it would be to do it.  Just creating
an index with CREATE INDEX will not work, because pg_shadow is
an installation-wide table and its index must be as well.  There's
some routine somewhere in the backend that would have to be taught
about the index.

			regards, tom lane



view thread (2+ messages)

Message-ID: <22648.951616028@sss.pgh.pa.us>
Permalink:  ../22648.951616028@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22648.951616028@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, stephen@sealteam.demon.co.uk, pgsql-hackers@postgreSQL.org
  Subject: Re: [INTERFACES] Date: Sat, 26 Feb 2000 17:01:55 -0800
  In-Reply-To: <22648.951616028@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox