>CREATE TABLE teste
>(
> coluna1 integer NOT NULL,
>CONSTRAINT chaveprimaria PRIMARY KEY (coluna1)
>)
>WITHOUT OIDS;

>INSERT INTO teste(coluna1) VALUES (1);
>INSERT INTO teste(coluna1) VALUES (2);

Depois dos inserts (After inserts)

{teste}
|coluna1|
|     1    |
|     2*   |

>update teste set coluna1 = (coluna1 + 1)

coluna1 =  1   +   1
coluna1 = 2*

>ERRO: duplicar chave viola a restrição de unicidade "chaveprimaria"
>SQL state: 23505
primary key violation...

Antonio
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a