pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Add primary keys to system catalogs
Date: Tue, 19 Jan 2021 11:46:55 +0100
Message-ID: <e691a22bb4e2d1074c29828f5e65946b7e98b502.camel@cybertec.at> (raw)
In-Reply-To: <266949.1610921277@sss.pgh.pa.us>
References: <dc5f44d9-5ec1-a596-0251-dadadcdede98@2ndquadrant.com>
	<348f3158-bf7e-c5f0-f33b-9e552e3d5481@2ndquadrant.com>
	<266949.1610921277@sss.pgh.pa.us>

On Sun, 2021-01-17 at 17:07 -0500, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> > [ v2-0001-Add-primary-keys-and-unique-constraints-to-system.patch ]
> 
> [...] do we really want to prefer
> using the OID indexes as the primary keys?  In most cases there's some
> other index that seems to me to be what a user would think of as the
> pkey, for example pg_class_relname_nsp_index for pg_class or
> pg_proc_proname_args_nsp_index for pg_proc.  Preferring OID where it
> exists is a nice simple rule, which has some attractiveness, but the
> OID indexes seem to me like a lookup aid rather than the "real" object
> identity.

I disagree.  The OID is the real, immutable identity of an object.
The "relname" of a "pg_class" encatalogtry can change any time.
Since there are no foreign keys that reference catalogs, that won't cause
problems, but I still think that primary keys should change as little as
possible.

Yours,
Laurenz Albe






view thread (39+ messages)  latest in thread

Message-ID: <e691a22bb4e2d1074c29828f5e65946b7e98b502.camel@cybertec.at>
Permalink:  ../e691a22bb4e2d1074c29828f5e65946b7e98b502.camel@cybertec.at/
Also on:    postgresql.org/message-id/e691a22bb4e2d1074c29828f5e65946b7e98b502.camel@cybertec.at

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com
  Subject: Re: Add primary keys to system catalogs
  In-Reply-To: <e691a22bb4e2d1074c29828f5e65946b7e98b502.camel@cybertec.at>
  References: <dc5f44d9-5ec1-a596-0251-dadadcdede98@2ndquadrant.com> <348f3158-bf7e-c5f0-f33b-9e552e3d5481@2ndquadrant.com> <266949.1610921277@sss.pgh.pa.us> <e691a22bb4e2d1074c29828f5e65946b7e98b502.camel@cybertec.at>

* 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