dbTalk Databases Forums  

unique constraint on multiple colums does not work

comp.databases.postgresql comp.databases.postgresql


Discuss unique constraint on multiple colums does not work in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: unique constraint on multiple colums does not work - 01-22-2008 , 08:29 AM






Coniglio Sgabbiato ha scritto:
Quote:
[CUT]
can you post the definition of your table, so we can see what's
unknown> to
us?

CREATE TABLE interfaces
(
unknown
CONSTRAINT if_uniq UNIQUE (name, device)
)
;

here:

CREATE TABLE interfaces
(
id serial NOT NULL,
device integer NOT NULL,
name character varying(255) NOT NULL,
inet_addr inet,
CONSTRAINT interfaces_pkey PRIMARY KEY (id),
CONSTRAINT interfaces_device_fkey FOREIGN KEY (device)
REFERENCES devices (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT if_uniq UNIQUE (name, device),
CONSTRAINT interfaces_inet_addr_key UNIQUE (inet_addr)
)
WITH (OIDS=FALSE);
ALTER TABLE interfaces OWNER TO postgres;
I'm sorry, I finally found the problem and fixed it by myself: among
thousands of records collected on the network and inserted in automated
way there was only one I missed that held "dirty" data.
Sorry for the waste of your time, and thank you very much for the help.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.