Re: \set to create shortcut - Mailing list pgsql-admin

From Erik Wienhold
Subject Re: \set to create shortcut
Date
Msg-id s3ga2tdu6dh6pxh4vya6h72hkczb52q6wndmoccpkgcbbbw6uc@37yww6j7ig6g
Whole thread Raw
In response to \set to create shortcut  (Fabrice Chapuis <fabrice636861@gmail.com>)
Responses Re: \set to create shortcut
List pgsql-admin
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



pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: \set to create shortcut
Next
From: Fabrice Chapuis
Date:
Subject: Re: \set to create shortcut