Re: Optimizar Update

From: mauricio pullabuestan <jmauriciopb(at)yahoo(dot)es>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Postgres ayuda <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Optimizar Update
Date: 2023-09-08 17:41:34
Message-ID: 499881891.9626637.1694194894602@mail.yahoo.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola Alvaro.

>> CREATE TABLE bodegas   /*la tabla es mucho más ancha*/
>> (
>>
>>   bodega character varying(3) NOT NULL,
>>   item character varying(15) NOT NULL,
>>   buffer numeric(12,3) DEFAULT 0,
>>   pedidos_clientes numeric(12,3) DEFAULT 0,
>>   comprometido_pedido numeric(10,3) DEFAULT 0,
>>   CONSTRAINT pk_bodegas PRIMARY KEY (bodega, item),
>>   CONSTRAINT fk_bodegas_id_bodegas FOREIGN KEY (bodega)
>>   REFERENCES id_bodegas (bodega) MATCH FULL
>>       ON UPDATE NO ACTION ON DELETE NO ACTION,
>>   CONSTRAINT fk_bodegas_item FOREIGN KEY (item)
>>       REFERENCES items (item) MATCH SIMPLE
>>       ON UPDATE NO ACTION ON DELETE NO ACTION

>> )

>¿tienes una llave foránea que dice que la bodega existe en la misma
>tabla bodegas?  ¿es decir, la tabla se autoreferencia?  Suena medio
>estúpido esto.  ¿Qué sentido tiene?

La tabla bodega tiene un FK a la tabla id_bodegas, no se autoreferencia.

Saludos.

--
Álvaro Herrera        PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"People get annoyed when you try to debug them."  (Larry Wall)

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message mauricio pullabuestan 2023-09-08 17:56:59 Re: Optimizar Update
Previous Message Alvaro Herrera 2023-09-08 17:29:35 Re: Optimizar Update