Re: \set to create shortcut

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Fabrice Chapuis <fabrice636861(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: \set to create shortcut
Date: 2024-02-22 08:45:54
Message-ID: ce0e10642ab15ffe5c300b983a078d9b0b7fc3d4.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Erik Wienhold 2024-02-22 09:32:01 Re: \set to create shortcut
Previous Message Ulf Bengtner 2024-02-22 08:43:36 Problems installing APT version