Aled,
> Is it possible to execute a plpgsql script directly, without creating a
> function?
No, it is not possible. You have to create a function.
We'd love to have dynamic execution of PL/pgSQL code, but nobody's written it.
--
-Josh Berkus
Aglio Database Solutions
San Francisco