Output shell variable from psql

From: Murthy Nunna <mnunna(at)fnal(dot)gov>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Output shell variable from psql
Date: 2024-04-08 15:17:45
Message-ID: DM8PR09MB667723C1012EDD032EC1BE22B8002@DM8PR09MB6677.namprd09.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

Is there a way to output shell variable from psql?

export TEST_V=7
echo Value is ${TEST_V}
Value is 7

psql -U postgres -p 5439
\echo Value is ${TEST_V}
Value is ${TEST_V}

Thanks!

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message jaya kumar 2024-04-08 15:23:52 Re: Autovacuum------Doubts
Previous Message Laurenz Albe 2024-04-08 14:38:08 Re: Autovacuum------Doubts