> 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
> )

Se me ocurre en la definición de REFERENCES pongas:
public.fruits_in_stock(NAME)


Saludos,
Gilberto Castillo
La Habana, Cuba
--- 
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at 
host imx3.etecsa.cu
Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
-
Enviado a la lista de correo pgsql-es-ayuda (pgsql-es-ayuda@postgresql.org)
Para cambiar tu suscripción:
http://www.postgresql.org/mailpref/pgsql-es-ayuda

Responder a