Am Samstag, 5. April 2008 schrieb Gregory Stark:
On Apr 10, 2008, at 7:50 AM, Peter Eisentraut wrote:
I also don't see any point in allowing aliases which call other psql
commands.


Why disallow it? I think it could be very useful. One thing I sometimes find myself doing is wanting to run a command on a list of tables. That can be accomplished via:

SELECT 'ALTER TABLE ' || oid::regclass || 'blah;' FROM pg_class WHERE ...
\g | psql blah blah blah

I'd love to be able to alias something like that.

Another real example is being able to force certain output functions for certain queries. In particular, it would be handy if I had an alias that was SELECT now()-query_start,* FROM pg_stat_activity WHERE current_query != '<IDLE>' ORDER BY 1 and force that to be brought into less (which I could probably do via \g | less).
--
Decibel!, aka Jim C. Nasby, Database Architect  [EMAIL PROTECTED]
Give your computer some brain candy! www.distributed.net Team #1828


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to