public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bruce Momjian <[email protected]>
To: Josh Berkus <[email protected]>
Cc: [email protected]
Subject: Re: Clarification to catalog-pg-class
Date: Sat, 7 Feb 2009 14:29:29 -0500 (EST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

Josh Berkus wrote:
> Bruce,
> 
> >> Currently, catalog-pg-class is a bit confusing as to where FKs are 
> >> tracked in pg_class.  Please update the lines for relchecks and 
> >> reltriggers to read:
> >>
> >> relchecks	int2	 	 Number of check constraints on the table (but not 
> >> other types of constraints); see pg_constraint catalog
> > 
> > Uh, why do we have to say "but" when we clearly say "check constraints"?
> > Do we need to say "CHECK" contraints?
> 
> Because I've encountered two people on IRC (and a client) who were 
> confused about this, and it confused me briefly when I fielded their 
> questions.  Saying "CHECK constraints" would also probably do it, or 
> saying "check constraints (only)"

Uppercase done, with <literal> tag.

> BTW, why do we still have relukeys etc. around?  If we haven't used them 
> in 5 versions, shouldn't we purge them?

Uh, that one is gone now:

	      Table "pg_catalog.pg_class"
	     Column     |   Type    | Modifiers
	----------------+-----------+-----------
	 relname        | name      | not null
	 relnamespace   | oid       | not null
	 reltype        | oid       | not null
	 relowner       | oid       | not null
	 relam          | oid       | not null
	 relfilenode    | oid       | not null
	 reltablespace  | oid       | not null
	 relpages       | integer   | not null
	 reltuples      | real      | not null
	 reltoastrelid  | oid       | not null
	 reltoastidxid  | oid       | not null
	 relhasindex    | boolean   | not null
	 relisshared    | boolean   | not null
	 relkind        | "char"    | not null
	 relnatts       | smallint  | not null
	 relchecks      | smallint  | not null
	 relhasoids     | boolean   | not null
	 relhaspkey     | boolean   | not null
	 relhasrules    | boolean   | not null
	 relhastriggers | boolean   | not null
	 relhassubclass | boolean   | not null
	 relfrozenxid   | xid       | not null
	 relacl         | aclitem[] |
	 reloptions     | text[]    |

> 
> > 
> >> reltriggers	int2	 	Number of triggers on the table, including 
> >> constraint-triggers for foreign keys; see pg_trigger catalog
> > 
> > pg_class doesn't have that column anymore, it has relhastriggers.
> 
> Ah.  Where are we tracking FKs at this point, then?

The count was only used to determine if we should check for triggers, so
we now use a boolean;  the code checks are the same.

-- 
  Bruce Momjian  <[email protected]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +



view thread (10+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Clarification to catalog-pg-class
  In-Reply-To: <[email protected]>

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

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