On Thu, Mar 6, 2025 at 10:38 AM Ron Johnson 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
Another dirty hack:
MAGIC=\! psql -Xc "select datname from pg_database WHERE datname $MAGIC~
'template|postgres' ORDER BY datname;"
Em qui., 6 de mar. de 2025 às 10:38, Ron Johnson
escreveu:
> This statement runs great from the psql prompt. Does exactly what I want.
> select datname from pg_da
On Thu, Mar 6, 2025 at 6:11 AM hubert depesz lubaczewski
wrote:
> On Thu, Mar 06, 2025 at 04:37:56AM -0500, Ron Johnson wrote:
> > This statement runs great from the psql prompt. Does exactly what I
> want.
> > select datname from pg_database WHERE datname !~ 'template|postgres'
> ORDER
> > BY d
On Thu, Mar 6, 2025 at 11:24 AM Ron Johnson wrote:
> I already do that. This is part of a long chain of commands so I'm trying to
> minimize the length of commands.
but given that your regexp patterns are not anchored, they are not
equivalent. I think mine is "more correct".
> Anyway, it would
This statement runs great from the psql prompt. Does exactly what I want.
select datname from pg_database WHERE datname !~ 'template|postgres' ORDER
BY datname;
But it doesn't work so well from the bash prompt. Not escaping the "!"
generates a bunch of garbage, while escaping throws an sql synta
On Thu, Mar 06, 2025 at 04:37:56AM -0500, Ron Johnson wrote:
> This statement runs great from the psql prompt. Does exactly what I want.
> select datname from pg_database WHERE datname !~ 'template|postgres' ORDER
> BY datname;
> But it doesn't work so well from the bash prompt. Not escaping the
Hi,
On 3/6/25 10:37, Ron Johnson wrote:
This statement runs great from the psql prompt. Does exactly what I want.
select datname from pg_database WHERE datname !~ 'template|postgres' ORDER BY
datname;
But it doesn't work so well from the bash prompt. Not escaping the "!"
generates a bunch o
On Thu, Mar 6, 2025 at 4:59 AM Dominique Devienne
wrote:
> On Thu, Mar 6, 2025 at 10:38 AM Ron Johnson
> wrote:
> > This statement runs great from the psql prompt. Does exactly what I
> want.
> > select datname from pg_database WHERE datname !~ 'template|postgres'
> ORDER BY datname;
> >
> > Bu
On Thu, Mar 6, 2025 at 10:38 AM Ron Johnson wrote:
> This statement runs great from the psql prompt. Does exactly what I want.
> select datname from pg_database WHERE datname !~ 'template|postgres' ORDER BY
> datname;
>
> But it doesn't work so well from the bash prompt. Not escaping the "!"
>