Re: psql and regex not like - Mailing list pgsql-general

From Hans Schou
Subject Re: psql and regex not like
Date
Msg-id CAApBw36EV+nVtSLp1Oq-ovSSNq6dN=Owr95Ju8kBe+=YQ7JjdA@mail.gmail.com
Whole thread Raw
In response to psql and regex not like  (Ron Johnson <ronljohnsonjr@gmail.com>)
List pgsql-general
On Thu, Mar 6, 2025 at 10:38 AM Ron Johnson <ronljohnsonjr@gmail.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 ' !'"

pgsql-general by date:

Previous
From: Renan Alves Fonseca
Date:
Subject: Re: psql and regex not like
Next
From: Durgamahesh Manne
Date:
Subject: Re: Query optimization