pg_class not updated correctly?

From: "Darrin Ladd" <darrin_ladd(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_class not updated correctly?
Date: 2000-08-23 11:35:08
Message-ID: F259m9OciPXkmCJiLyN00000e16@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howdy,

I am creating my first *real* tables in Postgres and noticed something that
concerned me. It appears that the pg_class table is not being updated
correctly to reflect the constraints on the table. Here is my example...

I created a table code:

CREATE TABLE code (
code_type_no int,
code_no int,
code_desc varchar,
CONSTRAINT pk_code
PRIMARY KEY (code_type_no, code_no),
CONSTRAINT fk_code_codetype_code_type_no
FOREIGN KEY (code_type_no)
REFERENCES code_type (code_type_no)
);

As you can see it has a primary key and a foreign key. But when looking at
the pg_class table:
pg_class.relname = code
reltriggers = 2 yes
relukeys = 0 maybe as long as primary shouldn't be
displayed here as unique
relfkeys = 0 NO!
relhaspkey = f NO!

This is not the only table that I have created, all of them have at least a
primary key, and none of them are showing a number > 0 for ukeys or anything
but an f for haspkey.

Am I reading this table incorrectly, or is there something wrong with the
way Postgres is updating this table?

Thanks!
Darrin
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2000-08-23 11:38:05 Re: [Solved] SQL Server to PostgreSQL
Previous Message Martijn van Oosterhout 2000-08-23 11:22:12 Re: DateStyle causes drama during upgrade