Table Constraints Bug

View: New views
2 Messages — Rating Filter:   Alert me  

Table Constraints Bug

by Matthew Arp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
pgAdminIII will not allow you to add a self-referential constraint while using the GUI table editor, see the below example:
 
CREATE TABLE "role"
(
  uid integer NOT NULL,
  "name" character varying(32) NOT NULL,
  parent integer NOT NULL DEFAULT 1,
  CONSTRAINT role_pkey PRIMARY KEY (uid),
  CONSTRAINT role_parent_fkey FOREIGN KEY (parent)
      REFERENCES "role" (uid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE RESTRICT
)
WITH (OIDS=FALSE);
ALTER TABLE "role" OWNER TO glasshook_admin;

Re: Table Constraints Bug

by Guillaume Lelarge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matthew Arp a écrit :

> pgAdminIII will not allow you to add a self-referential constraint while
> using the GUI table editor, see the below example:
>  
> CREATE TABLE "role"
> (
>   uid integer NOT NULL,
>   "name" character varying(32) NOT NULL,
>   parent integer NOT NULL DEFAULT 1,
>   CONSTRAINT role_pkey PRIMARY KEY (uid),
>   CONSTRAINT role_parent_fkey FOREIGN KEY (parent)
>       REFERENCES "role" (uid) MATCH SIMPLE
>       ON UPDATE NO ACTION ON DELETE RESTRICT
> )
> WITH (OIDS=FALSE);
> ALTER TABLE "role" OWNER TO glasshook_admin;

Can we have more details? because I can add a foreign key which refers
to the same table with the GUI table editor.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

--
Sent via pgadmin-support mailing list (pgadmin-support@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support
LightInTheBox - Buy quality products at wholesale price!