Re: Problema en INSERT !

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Carlos Rivas <carlos(dot)rivas(at)multicredit(dot)com(dot)gt>
Cc: dkuroki(at)dbas(dot)com(dot)ar, "pgsql-es-ayuda(at)postgresql(dot)org" <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Problema en INSERT !
Date: 2006-04-28 19:28:17
Message-ID: 20060428192817.GE9592@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Carlos Rivas escribió:

Primero que nada, que version de Postgres estas usando?

> Table "cifb.master1"
> Column | Type | Modifiers
> ----------+---------------+-----------
> code | character(6) | not null
> surn | character(60) | not null
> name | character(40) | not null
> tipo | character(1) | not null
> iden | character(18) | not null
> lega | character(40) | not null
> sexo | character(1) | not null
> fechanac | character(8) | not null
> nacional | numeric(3,0) | not null
> fing | character(8) | not null
> compaing | numeric(4,0) | not null
> fumo | character(8) | not null
> cifcorp | character(16) | not null
> Indexes:
> "pk_master1" primary key, btree (code)
> "apellido" btree (surn)
> "cifcorpo" btree (cifcorp)
> "iden" btree (iden)

Primero que nada bota esta tabla y crea una tabla asi:

> code | character(6) | not null
> surn | character varying(60) | not null
> name | character varying(40) | not null
> tipo | character(1) | not null
> iden | character varying(18) | not null
> lega | character varying(40) | not null
> sexo | character(1) | not null
> fechanac | date | not null
> nacional | int | not null
> fing | character(8) | not null
> compaing | int | not null
> fumo | character(8) | not null
> cifcorp | character(16) | not null
> Indexes:
> "pk_master1" primary key, btree (code)
> "apellido" btree (surn)
> "cifcorpo" btree (cifcorp)
> "iden" btree (iden)

Me llama la atencion que teniendo campos como "nacionalidad" no tengas
llaves foraneas. Estas seguro que esto es asi?

Te recomiendo que de ser posible, reemplaces el "code" por un int.

Si "fing", "fumo" y "cifcorp" son de largo variable, cambialos por
varchar tambien.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2006-04-28 19:31:52 Re: Llamar una funcion dentro de una función.
Previous Message dkuroki 2006-04-28 19:18:54 Re: Problema en INSERT !