Re: RE : How do I compile/test a PL/SQL in Postgresql - Mailing list pgsql-novice

From Christoph Della Valle
Subject Re: RE : How do I compile/test a PL/SQL in Postgresql
Date
Msg-id 44BB62C7.1090206@goetheanum.ch
Whole thread Raw
In response to RE : How do I compile/test a PL/SQL in Postgresql  ("Patrick Ng" <patrick.ng@zuji.com>)
List pgsql-novice
Hi

you can do it at the command line:
open a shell, change to your dbuser, then
psql mydb
or psql mydb -u USER -h HOST

Or install pgAdminIII, a common GUI for postgres (I prefer the commandline.)
If you use the commandline, make sure readline-support is installed.

If you run (on the shell) your "CREATE OR REPLACE FUNCTION"-Statement,
that's it. After this, you call your new function like this:

select myfunc(arg);

since functions are polymorphic, you have to use the appropriate amount
of arguments, otherwise you will get the message that this function does
not exist...

yours,
Christoph

Patrick Ng schrieb:
> Hi,
>
>
>
> I am a novice to PostgreSQL (although I know ORACLE's PL/SQL very well)
>
>
>
> I have written a Stored Function in PostgreSQL but cannot figure out how
> to compile it or run it in PostgreSQL. In ORACLE, one would have to
>
> do this at SQL*PLUS prompt : @<file-path\file_name to compile the stored
> function into ORACLE DB.
>
> In PostgreSQL, how do I do that?
>
>
>
> In ORACLE, one would have to write a PL/SQL to test the stored function
> (and use DBMS_OUTPUT.PUT_LINE) to get the stored function to write to
> stdout.
>
>
>
> In PostgreSQL, how do I test the stored function? I noticed none of the
> documentation or books seemed to mention this simple point.
>
>
>
> Best regards
>
>
>
>

pgsql-novice by date:

Previous
From: "Patrick Ng"
Date:
Subject: RE : How do I compile/test a PL/SQL in Postgresql
Next
From: Richard Broersma Jr
Date:
Subject: Re: RE : How do I compile/test a PL/SQL in Postgresql