Parameter for query - Mailing list pgsql-general

From Robert James
Subject Parameter for query
Date
Msg-id CAGYyBgi=jsYughrTRzA0F_Jj+fWmgD3f_AGOazqHoQZYg8g+wA@mail.gmail.com
Whole thread Raw
Responses Re: Parameter for query
Re: Parameter for query
List pgsql-general
Is there any way to set a variable or parameter for a query?

I have a long query where a certain variable needs to be easy to
change.  I'd like to do something like:

threshold = 10.3

SELECT... WHERE x > $threshold... AND y * 1.3 > $threshold...

Currently, I need to do this in a scripting language.  Is there a
straightforward way to do this directly in Postgres?


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Using pg_start_backup() and pg_stop_backup()
Next
From: Michael Paquier
Date:
Subject: Re: Parameter for query