Hola amigos... tengo este codigo sql CREATE TABLE public.fruits_in_stock( NAME INTEGER PRIMARY KEY, in_stock INTEGER NOT NULL, reserved INTEGER NOT NULL DEFAULT 0, CHECK(in_stock BETWEEN 0 AND 1000), CHECK(reserved <= in_stock) );
CREATE TABLE public.fruits_offer( offer_id SERIAL PRIMARY KEY, recipient_name TEXT, offer_date TIMESTAMP DEFAULT current_timestamp, fruit_name INTEGER REFERENCES public.fruits_in_stock(NAME) ON DELETE CASCADE ); esto cuando lo ejecuto en el PyCharm Professional Edition me da el siguiente error: sql> CREATE TABLE public.fruits_offer( offer_id SERIAL PRIMARY KEY, recipient_name TEXT, offer_date TIMESTAMP DEFAULT current_timestamp, fruit_name INTEGER REFERENCES fruits_in_stock(NAME) ON DELETE CASCADE ) [2015-02-12 15:47:07] [42P01] ERROR: relation "fruits_in_stock" does not exist si lo ejecuto en el Navicat me da el mismo error, pero si lo ejecuto en el PgAdmin3 se ejecuta perfectamente bien y se crean las tablas.... ¿hay algún problema ahí que el PgAdmin3 me resuelve por defecto?? saludos ============================================= "El tamaño de tus logros depende del tamaño de tus metas." C++ and Qt Senior Developer Lic. Computer Science Buenos Aires, Argentina