Skip site navigation (1) Skip section navigation (2)

execute plpgsl like "normal" sql

From: "Christian Kindler" <christian(dot)kindler(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: execute plpgsl like "normal" sql
Date: 2008-05-09 10:00:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql

Is there a possibility to execute pl/pgsql syntax like normal sql simmilar to sql+ from oracle?

The question is: if I want to execute soemthing like this:
--File foo.sql:
 for id in select id from mytable loop
   update myothertable set payed = true where fk_id = id;
 end loop;

Do I have to create a procedure or can I simply run the above statement via 
psql -D foo < foo.sql

Reason is, that I create pq/psql procedures (more complex than this example) at runtime in my client app and do not want to store the procedures permanent in my database schema. I would like to avoid create function / drop function statements.

GMX startet Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein:


pgsql-sql by date

Next:From: Christian KindlerDate: 2008-05-09 15:00:34
Subject: Re: execute plpgsl like "normal" sql
Previous:From: Tom LaneDate: 2008-05-08 14:54:21
Subject: Re: Index to enforce non-overlapping ranges?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group