dbTalk Databases Forums  

Writing plpgsql not in a function (directly from plsql)?

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Writing plpgsql not in a function (directly from plsql)? in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Vitaly Belman
 
Posts: n/a

Default Writing plpgsql not in a function (directly from plsql)? - 10-02-2004 , 04:59 PM






Is it possible to write plpgsq from psql? I don't want to write a
function just to write a little script, for example, I'd like to write
something like:

begin;
if 1 > 3 then
raise notice 'Hi';
end if;
commit;

--
ICQ: 1912453
AIM: VitalyB1984
MSN: tmdagent (AT) hotmail (DOT) com
Yahoo!: VitalyBe

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
  #2  
Old   
Vitaly Belman
 
Posts: n/a

Default Re: Writing plpgsql not in a function (directly from plsql)? - 10-03-2004 , 01:05 PM






The idea is to write it without creating a function... Just as a quick script.

Not possible?


On Sun, 3 Oct 2004 11:21:50 -0400, John DeSoi <jd (AT) icx (DOT) net> wrote:
Quote:
On Oct 2, 2004, at 5:59 PM, Vitaly Belman wrote:

Is it possible to write plpgsq from psql? I don't want to write a
function just to write a little script, for example, I'd like to write
something like:

You can do this from psql, but you need to use the CREATE FUNCTION
command and enclose your procedure body in quotes.

See
http://www.postgresql.org/docs/current/interactive/sql-
createfunction.html


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL




--
ICQ: 1912453
AIM: VitalyB1984
MSN: tmdagent (AT) hotmail (DOT) com
Yahoo!: VitalyBe

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
  #3  
Old   
John DeSoi
 
Posts: n/a

Default Re: Writing plpgsql not in a function (directly from plsql)? - 10-03-2004 , 08:41 PM




On Oct 3, 2004, at 2:05 PM, Vitaly Belman wrote:

Quote:
The idea is to write it without creating a function... Just as a quick
script.

Not possible?
No, I don't think so. psql accepts \ commands and valid SQL commands.
Nothing else.

Best,

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.