public inbox for [email protected]  
help / color / mirror / Atom feed
From: Hans Schou <[email protected]>
To: [email protected]
Subject: Re: psql and regex not like
Date: Fri, 14 Mar 2025 00:09:16 +0100
Message-ID: <CAApBw36EV+nVtSLp1Oq-ovSSNq6dN=Owr95Ju8kBe+=YQ7JjdA@mail.gmail.com> (raw)
In-Reply-To: <CANzqJaCmmqNjSNitxWPekwM7mQesZCfAdXjOprKao8Ted35E-w@mail.gmail.com>
References: <CANzqJaCmmqNjSNitxWPekwM7mQesZCfAdXjOprKao8Ted35E-w@mail.gmail.com>

On Thu, Mar 6, 2025 at 10:38 AM Ron Johnson <[email protected]> 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 ' !'"


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: psql and regex not like
  In-Reply-To: <CAApBw36EV+nVtSLp1Oq-ovSSNq6dN=Owr95Ju8kBe+=YQ7JjdA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox