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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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