Não sei se é isso mas eu faria o seguinte select @var=0 from dual;
e depois update teste set coluna1 = (@[EMAIL PROTECTED] + 1) ou criaria uma sequence e update teste set coluna1 = (sequence.nextval) Em 26/10/07, Antonio Nascimento <[EMAIL PROTECTED]> escreveu: > > >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 > pgbr-geral@listas.postgresql.org.br > https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral > > -- Roberto Baselio Lopes e-mail / Google Talk: [EMAIL PROTECTED] msn: [EMAIL PROTECTED] Curriculo: http://www2.curriculum.com.br/ucn/rbaselio
_______________________________________________ pgbr-geral mailing list pgbr-geral@listas.postgresql.org.br https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral