Truncating 'now' to seconds

From: Nathan Schile <nate(at)shiftyeyes(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Truncating 'now' to seconds
Date: 2004-05-14 15:12:06
Message-ID: 40A4E1C6.6040206@shiftyeyes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to run the following query:

INSERT INTO public."Bug Status" ("Tracking Number", "Assigned Analyst",
status, "Changed By", "Updated Date") VALUES
(111111111, 'NS', 'Reported', 'NS', DATE_TRUNC('second', 'now'));

I recieve the following error:

ERROR: unterminated string
CONTEXT: compile of PL/pgSQL function "update_status" near line 3

I am basically wanting to truncate the timestamp to seconds, so that I
don't get milliseconds. Does anyone know what I am doing wrong? Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Theo Dickinson 2004-05-14 16:02:08 ROW LEVEL UPDATE TRIGGER column detect problem
Previous Message Tom Lane 2004-05-14 14:03:17 Re: Scary behavior after power failure