On 5/16/14, Tom Lane <t...@sss.pgh.pa.us> wrote:
> patrick keshishian <pkesh...@gmail.com> writes:
>> I started to look into using pg_query_params() with some
>> php scripts, but ran into this issue where I get:
>
>> PHP message: PHP Warning: pg_query_params(): Query failed: ERROR:
>> invalid input syntax for type timestamp: "$1"
>> LINE 1: ... date_trunc('day', now()), date_trunc('day', TIMESTAMP '$1')
>
> You probably want just this:
>
> ... date_trunc('day', now()), date_trunc('day', $1::timestamp)

This worked.

Thank you for your quick response!
--patrick

>
> The syntax TIMESTAMP '...' is only for plain literal constants.
>
>                       regards, tom lane
>


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to