\set to create shortcut

From: Fabrice Chapuis <fabrice636861(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: \set to create shortcut
Date: 2024-02-22 08:32:31
Message-ID: CAA5-nLAtwOJQjFkqTTQouU8FA9OwTGzPVTDTJ-6p7jfU32e_WA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,
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?

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ulf Bengtner 2024-02-22 08:43:36 Problems installing APT version
Previous Message Fabrice Chapuis 2024-02-22 08:05:22 Re: pg_restore option --clean