Date variables in psql

From: Francisco Reyes <lists(at)natserv(dot)com>
To: pgsql General List <pgsql-general(at)postgresql(dot)org>
Subject: Date variables in psql
Date: 2004-10-07 17:14:58
Message-ID: 20041007130940.F64746@zoraida.natserv.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Trying the following simple sql file:
\set proc_date 6/30/2004
\echo Date is :proc_date
select * from feeds where date = :proc_date limit 20;

If I start psql with the "-a" option I see the output:
\set proc_date 6/30/2004
\echo Date is :proc_date
Date is 6/30/2004
select * from feeds where date = :proc_date limit 20;

and get no records
If I type the exact same query manually it workds
select * from feeds where date = '6/30/2004' limit 20;

Any ideas of the variable may not be recognized on the select statement?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-10-07 17:25:50 Re: Date variables in psql
Previous Message Ron St-Pierre 2004-10-07 17:10:55 Re: [NOVICE] Conditional Relationships?