Change your table definition and specify a defeault value for your timestamp
column this way -- when nothing is given on insert --> it will
populate...
CREATE TABLE test (
id serial not null primary key,
defaultdate timestamp not null default now()
);
"" Martin Pohl"" <[EMAIL PRO
On Thu, Jan 19, 2006 at 02:43:26PM +0100, Martin Pohl wrote:
> Hi,
>
> > > Not directly. I suppose you could create a view that converted the
> > > value to the right date on insert.
> > I think a trigger might make more sense.
>
> That was a very good idea! I tought it would solve my problem.
TED]>
To: Doug McNaught <[EMAIL PROTECTED]>
Cc: pgsql-general@postgresql.org
Sent: Thu, 19 Jan 2006 14:43:26 +0100 (MET)
Subject: Re: [GENERAL] Insert a default timestamp when nothing given
> Hi,
>
> > > Not directly. I suppose you could create a view that converted the
Hi,
> > Not directly. I suppose you could create a view that converted the
> > value to the right date on insert.
> I think a trigger might make more sense.
That was a very good idea! I tought it would solve my problem. Unfortunately
it didn't: I still get the "invalid syntax" error (I ensured th
Martijn van Oosterhout writes:
> Not directly. I suppose you could create a view that converted the
> value to the right date on insert.
I think a trigger might make more sense.
-Doug
---(end of broadcast)---
TIP 9: In versions below 8.0, the pla
am 19.01.2006, um 12:55:44 +0100 mailte Martin Pohl folgendes:
>
> Hi,
>
> I have to port an application from MS SQL7 to Postgresql (7.4).
>
> When I have a column with a datetime on MS SQL7 the following is possible:
> INSERT INTO mytable (mydate) values ('');
wrong date!
>
> In this ca
On Thu, Jan 19, 2006 at 12:55:44PM +0100, Martin Pohl wrote:
>
> Hi,
>
> I have to port an application from MS SQL7 to Postgresql (7.4).
>
> When I have a column with a datetime on MS SQL7 the following is possible:
> INSERT INTO mytable (mydate) values ('');
>
> In this case MSSQL will inser