Re: psql help - Mailing list pgsql-general

From David G. Johnston
Subject Re: psql help
Date
Msg-id CAKFQuwaYLtg0W4He0VGfqSTKSj+69sSq_5esqBVTHwSrPfMLmw@mail.gmail.com
Whole thread Raw
In response to psql help  (Murthy Nunna <mnunna@fnal.gov>)
Responses RE: psql help
List pgsql-general
On Thu, Jul 4, 2024 at 4:56 PM Murthy Nunna <mnunna@fnal.gov> wrote:

 

How can I rewrite the above in psql


The only real trick is using a psql variable instead of the shell-injection of the environment variable.  Use the --set CLI argument to assign the environment variable to a psql variable then refer to it in the query using :'timout_mins'

Removing the limit 1 should be as simple as not typing limit 1 when you bring the query into the psql script.

David J.

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: JSONPath operator and escaping values in query
Next
From: Murthy Nunna
Date:
Subject: RE: psql help