Re: psql help

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Murthy Nunna <mnunna(at)fnal(dot)gov>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: psql help
Date: 2024-07-05 01:16:32
Message-ID: CAKFQuwaYLtg0W4He0VGfqSTKSj+69sSq_5esqBVTHwSrPfMLmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jul 4, 2024 at 4:56 PM Murthy Nunna <mnunna(at)fnal(dot)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.

In response to

  • psql help at 2024-07-04 23:56:03 from Murthy Nunna

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Murthy Nunna 2024-07-05 03:54:56 RE: psql help
Previous Message David G. Johnston 2024-07-05 01:11:47 Re: JSONPath operator and escaping values in query