Re: PostgreSQL pollutes the file system - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: PostgreSQL pollutes the file system
Date
Msg-id 20190329193854.GC19154@msg.df7cb.de
Whole thread Raw
In response to Re: PostgreSQL pollutes the file system  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Re: Pavel Stehule 2019-03-29 <CAFj8pRAFpZcDGL5i1wMQiHZ43y5Qd=22=+2vTCFOrak_mrUxjw@mail.gmail.com>
> > Other idea: If we don't want to reinvent a new tool, how about
> > supporting prepared statements in psql?
> >
> >   psql -c 'create user %i' --args 'bob w. space'
> >
> 
> Prepared statements cannot be DDL commands.

"Prepared" in the sense of what format() does. (I should have used %I.)

> But psql has safe escaping via :"xxx" notation. So some like
> 
> psql -c 'create role :"role"' -v role='my role' ...

That's totally horrible to write, get correct, and to read again
later. We need something that people can actually use.

> But what I know the psql variables are not evaluated for -c query

I hate -c. It has so many caveats.

Christoph



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: Enable data checksums by default
Next
From: Jesper Pedersen
Date:
Subject: Re: partitioned tables referenced by FKs