Search Postgresql Archives

Re: Perl::DBI and interval syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allen <dba@xxxxxxxxxxx> writes:
> SELECT count(*) from post where post_ts >= current_date - interval ?

This is not right, and never has been right, even though it may have
accidentally failed to fail with some client libraries.  Try
	CAST(? as interval)			(SQL standard)
	?::interval				(Postgres-ism)

The "interval something" syntax is only legal when "something" is
a bare string literal.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux