Re: Need feedback on new feature (\for) - Mailing list pgsql-general

From Tom Lane
Subject Re: Need feedback on new feature (\for)
Date
Msg-id 14331.1061165286@sss.pgh.pa.us
Whole thread Raw
In response to Re: Need feedback on new feature (\for)  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Yes, I see that but it also limits what you could do. For example:

> \for
> select oid from <some funky query here>
> \do
> drop constraint "RI_ConstraintTrigger_:1"
> \done

> .. Incidently, the above
> case could be handled by performing the concatintation in the query.

Yes.  I'd argue that that's a much cleaner approach.  I really dislike
the notion of doing substitutions inside quoted strings.  (You'll notice
that psql does not do that now for :name variables --- I think that
these substitutions should follow the exact same rules.)

In general, you can do any sort of calculation on the strings with ease
in the control query, while the substituter in psql will necessarily be
pretty stupid.  So I think it makes much more sense to push the
complexity into the control query and keep the substitution rules
non-surprising.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Need feedback on new feature (\for)
Next
From: Dennis Gearon
Date:
Subject: Re: Dreamweaver