Re: [SQL] Dynamic PL/pgSQL

2005-06-19 Thread PFC
Within a PL/pgSQL function this would be easy, but I need to store the complete initialization script in a text file and execute it as a whole. In your scritp, put a CREATE FUNCTION and then call it and drop it ;) ---(end of broadcast)--

[SQL] Dynamic PL/pgSQL

2005-06-18 Thread Ruediger Herrmann
I plan to run an SQL script - using JDBC - to initialize a database. Right now I have the need to execute serveral statements only under certain conditions. for example: IF NOT EXISTS ( SELECT 1 FROM pg_catalog.pg_user WHERE ussername = 'Jon' ) THEN CREATE USER 'Jon'; END IF; With