From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Fabrice Chapuis <fabrice636861@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: \set to create shortcut
Date: Thu, 22 Feb 2024 09:45:54 +0100
Message-ID: <ce0e10642ab15ffe5c300b983a078d9b0b7fc3d4.camel@cybertec.at> (raw)
In-Reply-To: <CAA5-nLAtwOJQjFkqTTQouU8FA9OwTGzPVTDTJ-6p7jfU32e_WA@mail.gmail.com>
References: <CAA5-nLAtwOJQjFkqTTQouU8FA9OwTGzPVTDTJ-6p7jfU32e_WA@mail.gmail.com>
On Thu, 2024-02-22 at 09:32 +0100, Fabrice Chapuis wrote:
> I want to persist a shortcut between session.
>
> > postgres [157394]=# \set cs 'select current_schema';
> > postgres [157394]=# :cs
> > ┌────────────────┐
> > │ current_schema │
> > ├────────────────┤
> > │ public │
> > └────────────────┘
> > (1 row)
>
> I put it in .pgsql_profile but it does not work
>
> any idea?
It works for me if I put the semicolon inside the single quotes.
Yours,
Laurenz Albe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: laurenz.albe@cybertec.at, fabrice636861@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: \set to create shortcut
In-Reply-To: <ce0e10642ab15ffe5c300b983a078d9b0b7fc3d4.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox