Re: \set to create shortcut

From: Fabrice Chapuis <fabrice636861(at)gmail(dot)com>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: \set to create shortcut
Date: 2024-02-22 11:19:04
Message-ID: CAA5-nLA8HK6YQZEmQHY-8OCx_YLisR5T5zS4rX4d7NK_An+P9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ok I put it .psqlrc file. It works. Thanks to you
Fabrice

On Thu, Feb 22, 2024 at 10:32 AM Erik Wienhold <ewie(at)ewie(dot)name> wrote:

> On 2024-02-22 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?
>
> What output do you get?
>
> You should put that \set or \ir .pgsql_profile in .psqlrc which is the
> standard file read by psql.
>
> --
> Erik
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message James Pang 2024-02-22 12:33:10 print cached SQL plans of a backend
Previous Message Erik Wienhold 2024-02-22 09:32:01 Re: \set to create shortcut