Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 338B7632D7B for ; Sat, 7 Feb 2009 15:29:34 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 25136-07 for ; Sat, 7 Feb 2009 15:29:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id E63D5632CE2 for ; Sat, 7 Feb 2009 15:29:30 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id n17JTTX13008; Sat, 7 Feb 2009 14:29:29 -0500 (EST) From: Bruce Momjian Message-Id: <200902071929.n17JTTX13008@momjian.us> Subject: Re: Clarification to catalog-pg-class In-Reply-To: <498DDB52.6070207@agliodbs.com> To: Josh Berkus Date: Sat, 7 Feb 2009 14:29:29 -0500 (EST) CC: pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/3 X-Sequence-Number: 5049 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 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 http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. +