RE: Errores con PK

From: Edwin Quijada <listas_quijada(at)hotmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: RE: Errores con PK
Date: 2011-08-09 15:36:59
Message-ID: BAY155-W5480BE72CF37A833D5CDAAE3200@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda


Lo probe en una version mas anterior la 8.3.1 y salio todo bien.BTW: Mis mensajes estan llegando bastante retrasados al parecer estan necesitando aprobacion del administrador de la lista. Alvaro, puedes quitarme este problema.?

*-------------------------------------------------------*
*-Edwin Quijada
*-Developer DataBase
*-JQ Microsistemas

*-Soporte PostgreSQL

*-www.jqmicrosistemas.com
*-809-849-8087
*-------------------------------------------------------*

> CC: pgsql-es-ayuda(at)postgresql(dot)org
> Subject: Re: [pgsql-es-ayuda] Errores con PK
> From: alvherre(at)alvh(dot)no-ip(dot)org
> To: listas_quijada(at)hotmail(dot)com
> Date: Mon, 8 Aug 2011 22:25:08 -0400
>
> Excerpts from Edwin Quijada's message of lun ago 08 19:29:00 -0400 2011:
> >
> > Hola!Estoy teniendo errores extranos con una clave primaria en PostgresTengo esta tabla
> > CREATE TABLE "public"."t_factura_alquiler" ( "f_tipo" VARCHAR(10) NOT NULL, "f_numero" INTEGER DEFAULT 0 NOT NULL, "f_fecha" TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT now() NOT NULL, "f_id_cliente" INTEGER DEFAULT 0, "f_ncf" VARCHAR(20), "f_monto" NUMERIC(15,2) DEFAULT 0 NOT NULL, "f_tax" NUMERIC(15,2) DEFAULT 0 NOT NULL, "f_balance" NUMERIC(15,2) DEFAULT 0 NOT NULL, "f_hechopor" INTEGER DEFAULT 0 NOT NULL, "f_pagada" BOOLEAN DEFAULT false NOT NULL, "f_descu" NUMERIC(15,2), CONSTRAINT "t_factura_alquiler_pkey" PRIMARY KEY("f_tipo", "f_numero"), CONSTRAINT "t_factura_alquiler_fk" FOREIGN KEY ("f_id_cliente") REFERENCES "public"."t_clientes"("f_id") ON DELETE NO ACTION ON UPDATE CASCADE NOT DEFERRABLE) WITH OIDS;
> >
> > --- Insertinsert into public.t_factura_alquiler(f_tipo,f_numero,f_id_cliente,f_monto) VALUES('FDD',1,1,300);
> > -- ErrorERROR: duplicate key value violates unique constraint "t_factura_alquiler_pkey"ERROR: duplicate key value violates unique constraint "t_factura_alquiler_pkey"
> >
> > -- version------------------------------------------------------------------------------------- PostgreSQL 8.3.7 on i686-pc-linux-gnu, compiled by GCC gcc (Debian 4.3.2-1.1) 4.3.2(1 row)
> > --db_alquipller=# select * from public.t_factura_alquiler where f_tipo = 'FDD' and f_numero = 1; f_tipo | f_numero | f_fecha | f_id_cliente | f_ncf | f_monto | f_tax | f_balance | f_hechopor | f_pagada | f_descu--------+----------+---------+--------------+-------+---------+-------+-----------+------------+----------+---------(0 rows)
> >
> > No se como me dice que esta duplicada la clave si no hay nada en esta tabla.
>
> Es bien raro. Deberías actualizar a 8.3.15 y si quieres simplemente
> arreglar el problema hacerle reindex a esa tabla (o truncate).
>
> Si me pasas los archivos de la tabla y el índice a lo mejor puedo
> mirarlos para ver cuál es el problema.
>
> --
> Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
> -
> Enviado a la lista de correo pgsql-es-ayuda (pgsql-es-ayuda(at)postgresql(dot)org)
> Para cambiar tu suscripci�n:
> http://www.postgresql.org/mailpref/pgsql-es-ayuda

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Rodrigo Gonzalez 2011-08-09 15:39:49 Re: Archivo rpm para pl/pgsql
Previous Message Alvaro Herrera 2011-08-09 15:34:37 RE: Errores con PK