Skip site navigation (1) Skip section navigation (2)

constraints and sql92 information_schema compliance

From: "Clark C(dot) Evans" <cce(at)clarkevans(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: constraints and sql92 information_schema compliance
Date: 2006-02-25 00:03:43
Message-ID: 20060225000343.GA33429@prometheusresearch.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello all.  I've got a question with regard to the INFORMATION_SCHEMA
of PostgreSQL, specificially related to constraints.  In the SQL92
specification, the DEFINITION_SCHEMA.DOMAIN_CONSTRAINTS (the "imaginary"
base for INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS), has a primary key:
  CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME

This would leave me to believe that at constraints must have a unique
name within a given schema; however, this seems not to be the case:

    # create domain test_one text 
    -   constraint test check (value is not null);
    CREATE DOMAIN

    # create domain test_two text 
    -   constraint test check (value is not null);
    CREATE DOMAIN

    # select constraint_catalog, constraint_schema, constraint_name
    -   from information_schema.domain_constraints
    -  where domain_name like 'test_%';

     constraint_catalog | constraint_schema | constraint_name
     --------------------+-------------------+-----------------
      cce                | public            | test
      cce                | public            | test
       (2 rows)

So it would seem that naming rules for constraints in PostgreSQL
isn't exactly compliant with SQL92.  I'm curious what sorts of
constraints are enforced...

Thank you so much,

Clark

Responses

pgsql-hackers by date

Next:From: Josh BerkusDate: 2006-02-25 00:23:19
Subject: Re: constraints and sql92 information_schema compliance
Previous:From: Robert TreatDate: 2006-02-24 23:52:41
Subject: Re: Remove ora2pg from contrib

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group