Re: psql and regex not like

From: Hans Schou <hans(dot)schou(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: psql and regex not like
Date: 2025-03-13 23:09:16
Message-ID: CAApBw36EV+nVtSLp1Oq-ovSSNq6dN=Owr95Ju8kBe+=YQ7JjdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 6, 2025 at 10:38 AM Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:

> psql -Xc "select datname from pg_database WHERE datname \!~
> 'template|postgres' ORDER BY datname;"
>

Remove the space:

psql -Xc "select datname from pg_database WHERE datname!~
'template|postgres' ORDER BY datname"

I'm not really sure why as this one works:
psql -c "SELECT ' !'"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Durgamahesh Manne 2025-03-14 02:18:01 Re: Query optimization
Previous Message Renan Alves Fonseca 2025-03-13 21:48:05 Re: psql and regex not like