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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to