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

Re: Oracle PL/SQL Anonymous block equivalent in postgres

From: Ashok Agrawal <Ashok(dot)Agrawal(at)Sun(dot)COM>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Hannu Krosing <hannu(at)skype(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Oracle PL/SQL Anonymous block equivalent in postgres
Date: 2005-12-23 00:25:53
Message-ID: 43AB4411.1050404@Sun.COM (view raw or flat)
Thread:
Lists: pgsql-hackers
I don't need ability to sit at a prompt and type stuff.

To be more clear, I am attaching one sample code. I would like to
migrate this code using postgres without converting into procedure
or function.

Thanks
Ashok

Bruce Momjian wrote On 12/22/05 15:35,:
> Hannu Krosing wrote:
> 
>>?hel kenal p?eval, N, 2005-12-22 kell 18:19, kirjutas Bruce Momjian:
>>
>>>Ashok Agrawal wrote:
>>>
>>>>Hi ,
>>>>
>>>>Here is the requirements :
>>>>
>>>>1. Development & Support team can ONLY have READ Only ACCESS
>>>>   to PRODUCTION Database. They will NOT have access to create
>>>>   stored procedure & functions in the PRODUCTION on the fly.
>>>>
>>>>2. During application support, need to write script which
>>>>   uses procedural language (IF ELSE, AND , OR,  Cursor, Loop etc)
>>>>   to produce results or identify/fix issues. Number of this kind of
>>>>   Requests goes in hundreds during Quarter end.
>>>>
>>>>Currently on Oracle as long as you have sqlplus read only access,
>>>>you can write PL/SQL block and get the work done.
>>>>
>>>>Since postgres doesn't support procedural language except in
>>>>stored objects like procedure/functions, how do I achieve in
>>>>postgres without using stored objects. If this is not possible,
>>>>then does it make sense to add this requirement into TO-DO list.
>>>
>>>So you want to write procedural code on the client.  
>>
>>I guess he rather wants to have dont-save-but-execute-immediately
>>pl/pgsql code.
>>
>>could this perhaps be solved by having temporary functions, similar to
>>postgresql's temporary tables ?
> 
> 
> I am thinking they want the ability to sit at a prompt and type stuff.
> 
~

Attachment: sample.sql
Description: application/x-soffice (12.9 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-12-23 00:26:36
Subject: Re: Disparity in search_path SHOW and SET
Previous:From: Bruce MomjianDate: 2005-12-23 00:14:49
Subject: Re: Trouble building 8.1.1 on Tru64 UNIX 5.1

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