Problem creating UNIQUE constraint

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Problem creating UNIQUE constraint
Date: 2000-06-28 15:55:10
Message-ID: 200006281555.e5SFtAC02725@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Version: 7.0.2

There seems to be a problem with creating a unique constraint, like this:

bray=# CREATE TABLE supplier ( terms CHAR(2) ,ac_code CHAR(5)
UNIQUE) INHERITS (organisation);
NOTICE: CREATE TABLE/UNIQUE will create implicit index 'supplier_ac_code_key'
for table 'supplier'
ERROR: RelationClearRelation: relation 2951924 modified while in use

but without UNIQUE:

bray=# create table supplier (terms char(2), acs_code char(5)) inherits
(organisation);
CREATE

bray=# \d organisation
Table "organisation"
Attribute | Type | Modifier
------------+----------+--------------------
ptype | smallint |
id | char(10) | not null
name | text | not null
address | integer |
salutation | text | default 'Dear Sir'
envelope | text |
email | text |
www | text |
contact | char(10) |
structure | char(1) |
department | text |
parent_id | char(10) |
Constraints: (((department ISNULL) AND (parent_id ISNULL)) OR ((department >
''::text) AND (parent_id > ''::bpchar)))
((((structure = 'L'::bpchar) OR (structure = 'C'::bpchar)) OR
(structure = 'U'::bpchar)) OR (structure = 'O'::bpchar))
Rules: organisation_type_ins_rule,
organisation_type_upd_rule
Triggers: RI_ConstraintTrigger_2950794,
RI_ConstraintTrigger_2950240

bray=#

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"The Spirit of the Lord is upon me, because he hath
anointed me to preach the gospel to the poor; he hath
sent me to heal the brokenhearted, to preach
deliverance to the captives, and recovering of sight
to the blind, to set at liberty them that are
bruised..." Luke 4:18

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2000-06-28 16:09:05 Re: MySQL has gone GPL
Previous Message Tom Lane 2000-06-28 15:37:06 Re: Big 7.1 open items