Anonymous PL functions?

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Anonymous PL functions?
Date: 2006-06-27 11:15:10
Message-ID: 44A1133E.8040507@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I wonder if it would be possible/feasable to have anonymous PL functions
in PostgreSQL? I'm thinking of something along the lines of:

EXECUTE $
DECLARE
tableName text;
BEGIN;
FOR tableName
IN SELECT table_name
FROM information_schema.tables
WHERE table_name LIKE 'mm_%' LOOP
EXECUTE 'DROP TABLE ' || tableName;
END LOOP;
END;
$ () LANGUAGE 'plpgsql';

I don't really need this, but I think it'd be nice to be able to. This
way you could call procedural language code from the psql command line,
for example.

Regards,
--
Alban Hertroys
alban(at)magproductions(dot)nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede

// Integrate Your World //

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2006-06-27 11:31:09 Re: TSearch vs. Homebrew
Previous Message Hannes Dorbath 2006-06-27 10:28:04 TSearch vs. Homebrew