Re: Syntax error when combining --set and --command has me stumped

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Syntax error when combining --set and --command has me stumped
Date: 2022-08-02 13:07:44
Message-ID: 2bc84dca-4740-f6ba-f1a2-62751d6da75e@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/29/22 04:05, Gianni Ceccarelli wrote:
> If you can use bash, or set up some redirections from whatever you're
> using to execute ``psql``, you can do::
>
> $ psql somedb --set num=42 <<<'select :num'
> Timing is on.
> Expanded display is used automatically.
> Line style is unicode.
> Border style is 2.
> ┌──────────┐
> │ ?column? │
> ├──────────┤
> │ 42 │
> └──────────┘
> (1 row)
>
> Time: 0.517 ms
>
> or (more classically)::
>
> echo 'select :num' | psql somedb --set num=42

Since my process uses the same variable in multiple bash statements, I
decided to use a bash environment variable.

--
Angular momentum makes the world go 'round.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-08-02 13:43:19 Re: Strange collation names ("hu_HU.UTF-8")
Previous Message Durumdara 2022-08-02 12:18:36 Strange collation names ("hu_HU.UTF-8")