problems with postgres foreign keys
I am trying to create a primary key and foreign key which are referenced to that primary key in the same table.
But, I Can do it with Mysql.
here are my examples:
-- trying this
CREATE TABLE menu (
menu_id int auto_increment primary key,
menu_id_father int
) type=InnoDB;
ALTER TABLE menu add foreign key (menu_id_father) references menu ( menu_id);
error: Can't create table './proyect3/#sql-3db_36.frm' (errno: 150)
-- trying this:
CREATE TABLE menu (
menu_id int auto_increment primary key, foreign key (menu_id_father) references menu ( menu_id),
menu_id_father int
) type=InnoDB;
error: Can't create table './proyect3/#sql-3db_36.frm' (errno: 150)
please help
Subject
Views
Written By
Posted
problems with postgres foreign keys
6461
August 25, 2005 01:22PM
3982
August 25, 2005 03:34PM
3414
August 26, 2005 09:29PM
3658
March 21, 2006 10:52PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.