Search Postgresql Archives

Re: Writing a user defined function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 18, 2008 at 12:07 PM, Suresh_ <suiyengar@xxxxxxxxx> wrote:
>
> Hello,
>  I am trying to code a simple udf in postgres. How do I write sql commands
> into pl/sql ? The foll. code doesnt work.
>
> CREATE OR REPLACE FUNCTION udf()
> RETURNS integer AS $$
> BEGIN
> for i in 1..2000 loop
>  for j in 1...10000 loop
>  end loop;
>  begin work;

Postgres doesn't let you do transactions inside a function.

Take out the BEGIN and COMMIT, and if you still get errors post the
function code and the error message that you get.

-Doug


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux