Anonymous PL functions?

Поиск
Список
Период
Сортировка
Искать

Anonymous PL functions?

От:
Alban Hertroys <alban@magproductions.nl>
Дата:
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@magproductions.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 //
FAQ