Another RI question

From: wieck(at)debis(dot)com (Jan Wieck)
To: pgsql-hackers(at)postgreSQL(dot)org (PostgreSQL HACKERS)
Subject: Another RI question
Date: 1999-09-23 02:17:37
Message-ID: m11TyS1-0003kzC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Me again,

I'm just collecting info's for later. What I need to know is
how PK/FK constraints are defined in the standard.

Is it ALLWAYS the case, that a FK constraint refers to the PK
of another table? Or could arbitraty attributes of another
table be referenced by a FK too?

Is it guaranteed that I find the PK definition of a table
allways in the index <tablename>_pkey? If so it would be nice
to ensure that an index with that name created manually is
defined unique and/or cannot be created/dropped explicitly -
this is important for RI.

Another (my preferred) way would be to name the automatically
created PK index something like "pg_pkey_<tableoid>". This
would have the advantage that we never run out of 32 char
limit on name and that the user cannot create/drop this index
by hand.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-09-23 03:01:10 Re: [HACKERS] Compile timing
Previous Message Tom Lane 1999-09-23 01:22:06 Re: Progress report: buffer refcount bugs and SQL functions