pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Fabien COELHO <fabien.coelho@ensmp.fr>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: PostgreSQL Bugs List <pgsql-bugs@postgresql.org>
Subject: Re: issue about information_schema REFERENTIAL_CONSTRAINTS
Date: Sat, 19 Feb 2011 18:22:11 -0500 (EST)
Message-ID: <201102192322.p1JNMBx26553@momjian.us> (raw)
In-Reply-To: <alpine.DEB.2.00.1009031939250.2622@localhost.localdomain>

Fabien COELHO wrote:
> 
> > If you're going to use something which is PostgreSQL-specific, you may 
> > as well write your own views or use the "native" tables and views 
> > directly.
> 
> I wish I could write portable code, if possible:-)
> 
> I'm basically writing views on top of the information_schema under the 
> assumption that what is expected to be a key is a key. The information 
> schema is *useless* otherwise as wrong tuples are built on join, and 
> derived information is not reliable.
> 
> I guess I must the only actual user of the information_schema, and it will 
> soon be back to zero user, which will be fine from the developers point of 
> view.

Based on this report and later discussion, I have applied the attached
documentation patch to warn users about the Postgres behavior of
information_schema.referential_constraints.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Attachments:

/rtmp/constraint.diff (text/x-diff, 890B) download diff --git a/doc/src/sgml/information_schema.sgml b/doc/src/sgml/information_schema.sgml index 52407a7..91c2dd4 100644 *** a/doc/src/sgml/information_schema.sgml --- b/doc/src/sgml/information_schema.sgml *************** ORDER BY c.ordinal_position; *** 3211,3216 **** --- 3211,3229 ---- </tbody> </tgroup> </table> + + <note> + <para> + The SQL standard requires constraint names to be unique within a + schema; <productname>PostgreSQL</productname>, however, does not + enforce this restriction. If duplicate-named constraints are + stored in the same <productname>PostgreSQL</productname> schema, a + standard-compliant query that expects to return one row might + return several, one for each matching constraint stored in the + specified schema. + </para> + </note> + </sect1> <sect1 id="infoschema-role-column-grants">

view thread (33+ messages)  latest in thread

Message-ID: <201102192322.p1JNMBx26553@momjian.us>
Permalink:  ../201102192322.p1JNMBx26553@momjian.us/
Also on:    postgresql.org/message-id/201102192322.p1JNMBx26553@momjian.us

 ·  · 

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-docs@postgresql.org
  Cc: bruce@momjian.us, fabien.coelho@ensmp.fr, Kevin.Grittner@wicourts.gov, pgsql-bugs@postgresql.org
  Subject: Re: issue about information_schema REFERENTIAL_CONSTRAINTS
  In-Reply-To: <201102192322.p1JNMBx26553@momjian.us>
  References: <alpine.DEB.2.00.1009031939250.2622@localhost.localdomain> <201102192322.p1JNMBx26553@momjian.us>

* 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