Re: Odd Timestamp Error WAS Re: Function Creation Error - Mailing list pgsql-novice

From Tom Lane
Subject Re: Odd Timestamp Error WAS Re: Function Creation Error
Date
Msg-id 7030.1176044198@sss.pgh.pa.us
Whole thread Raw
In response to Odd Timestamp Error WAS Re: Function Creation Error  (Joshua Kramer <josh@globalherald.net>)
Responses Re: Odd Timestamp Error WAS Re: Function Creation Error
List pgsql-novice
Joshua Kramer <josh@globalherald.net> writes:
> LOG:  statement: INSERT INTO auth_tickets (user_id,
> expire_datetime, init_datetime, init_ip_addr, ticket_serial) VALUES ('2',
> 'now() + 6 * interval ''1 hour''', 'now()', '192.168.2.2',
> '44d6e7d4b2e87632a65cd34501aeea614bffde5f')
> ERROR:  invalid input syntax for type timestamp: "now() + 6 * interval '1
> hour'"

You seem to be confused about the difference between a literal constant
and an expression.  That should just be

LOG:  statement: INSERT INTO auth_tickets (user_id,
expire_datetime, init_datetime, init_ip_addr, ticket_serial) VALUES ('2',
now() + 6 * interval '1 hour', now(), '192.168.2.2',
'44d6e7d4b2e87632a65cd34501aeea614bffde5f')

            regards, tom lane

pgsql-novice by date:

Previous
From: Joshua Kramer
Date:
Subject: Odd Timestamp Error WAS Re: Function Creation Error
Next
From: Joshua Kramer
Date:
Subject: Re: Odd Timestamp Error WAS Re: Function Creation Error