From: . <@babolo.ru>
To: pgman@candle.pha.pa.us
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [INTERFACES] sqlbang
Date: Sun, 21 Apr 2002 03:33:06 +0400 (MSD)
Message-ID: <200204202333.DAA24386@aaz.links.ru> (raw)
In-Reply-To: <200204180349.g3I3nBv04245@candle.pha.pa.us>
Nobody interested?
I prepare my ISP Management System (ispms)
to publish and want reduce number of patches
needed to install it.
SQLbangs widely ised in it:
0cicuta~(1)>grep -r '^#\!/usr/local/bin/psql' /usr/local/libexec/ispms | wc -l
61
The most reason for patch are paremeters,
because without parameters
#!/usr/local/bin/psql -flags
can be substituted for:
#!/bin/sh
/usr/local/bin/psql -flags << "EOF"
but for substitute shell's ${1}, ${2} so on
for real parameters "EOF" in above example
MUST be without quotes.
So all SQL text will be preprocessored
by shell. Things are worst - some
of SQLbangs prepare simple shell's
programs with some shell
variables and quotes in it which must
be escaped to be not expanded
when SQL executes.
Yes, I have m4 build system to do such
escaping:
0cicuta~(2)>find w/ispms -name \*.m4 | wc -l
71
for WWW interface mostly, but without
SQLbangs escape level will be 1 level more,
shell has some errors (or features, I dont
know) with high level escaping and
I do not want depend on this errors
(or features) in base ispms system
(WWW interface has low rights)
Bruce Momjian writes:
> Can someone comment on this feature?
>
> ---------------------------------------------------------------------------
>
> "."@babolo.ru wrote:
> > Sorry I don't know if this is right list.
> >
> > I use scripts of such a kind (I say "SQLbang")
> >
> > #!/usr/local/bin/psql -qQ
> > \a \t \pset fieldsep ' '
> >
> > \set router '\'' :1 '\''
> >
> > SELECT ispdb_sfbsdr_allow(network(inet),niface)
> > FROM ispdb_sfbsdr_riaddr, nets
> > WHERE nrouter = :router
> > AND int_type = index_int_type('int')
> > AND network(inet) <<= network(net)
> > AND nets.control
> >
> > Parameters after sqlbang's name goes to :1, :2 so on.
<patch skiped>
> > I propose to include this feature.
> > Sorry for bad English.
--
@BABOLO http://links.ru/
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: pgsql-interfaces@postgresql.org
Cc: @babolo.ru, pgman@candle.pha.pa.us, pgsql-hackers@postgreSQL.org
Subject: Re: [INTERFACES] sqlbang
In-Reply-To: <200204202333.DAA24386@aaz.links.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox