Opa,

Corrigindo.

insert into tabela(data) values ((select localtimestamp));

[]s


Em 29/10/07, João Paulo <[EMAIL PROTECTED]> escreveu:
>
> Olá,
>
> Pode usar também o current_date ou o localtimestamp.
>
> insert into tabela(data) values ((select current_date));
>
> ou
>
> insert into tabela(data) values ((select localtimestampo));
>
> []s
>
> Em 28/10/07, Bruno Moreno <[EMAIL PROTECTED]> escreveu:
> >
> > blza, valeu cara!!
> >
> > Em 28/10/07, Claudimir Zavalik < [EMAIL PROTECTED]>
> > escreveu:
> > >
> > >  Use a função "now()" para isso.
> > >
> > >
> > > fielcontabil=# create table apague(codigo int2,datainsercao
> > > timestamp);
> > > CREATE TABLE
> > > fielcontabil=# \d apague;
> > >                  Table "public.apague"
> > >     Column    |            Type             | Modifiers
> > > --------------+-----------------------------+-----------
> > >  codigo       | smallint                    |
> > >  datainsercao | timestamp without time zone |
> > >
> > > fielcontabil=# insert into apague(codigo,datainsercao) values
> > > (1,now());
> > > INSERT 22718 1
> > > fielcontabil=# insert into apague(codigo,datainsercao) values
> > > (2,now());
> > > INSERT 22719 1
> > > fielcontabil=# select * from apague;
> > >  codigo |        datainsercao
> > > --------+----------------------------
> > >       1 | 2007-10-28 16:59:26.498523
> > >       2 | 2007-10-28 16:59:33.577255
> > > (2 rows)
> > >
> > >
> > >
> > > []s
> > > Claudimir Zavalik
> > > APOENA Software Livre
> > >
> > >
> > > ----- Original Message -----
> > >  *From:* Bruno Moreno <[EMAIL PROTECTED]>
> > > *To:* Lista de Discursão PostgreSQL<[email protected]>
> > > *Sent:* Sunday, October 28, 2007 4:34 PM
> > > *Subject:* [pgbr-geral] Data atual por default
> > >
> > > Pessoal, tem como quando eu inserir um dado em uma tabela, armazena em
> > > um campo timestamp a data atual?
> > >
> > > []'s
> > >
> > > --
> > > Bruno Neiva Moreno
> > > http://indiota.blogspot.com
> > >
> > > Graduando em Ciência da Computação - UFPB
> > > LARHENA - Laboratório de Recursos Hídricos e Engenharia Ambiental
> > >
> > > "Tudo posso naquele que me fortalece" Fl. 4:13
> > >
> > > ------------------------------
> > >
> > > _______________________________________________
> > > pgbr-geral mailing list
> > > [email protected]
> > > https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
> > >
> > > ------------------------------
> > >
> > > No virus found in this incoming message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.503 / Virus Database: 269.15.12/1096 - Release Date:
> > > 27/10/2007 11:02
> > >
> > >
> > > _______________________________________________
> > > pgbr-geral mailing list
> > > [email protected]
> > > https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
> > >
> > >
> >
> >
> > --
> > Bruno Neiva Moreno
> > http://indiota.blogspot.com
> >
> > Graduando em Ciência da Computação - UFPB
> > LARHENA - Laboratório de Recursos Hídricos e Engenharia Ambiental
> >
> > "Tudo posso naquele que me fortalece" Fl. 4:13
> >
> > _______________________________________________
> > pgbr-geral mailing list
> > [email protected]
> > https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
> >
> >
>
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a