Re: Running a PL/pgSQL function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christophe <xof(at)thebuild(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Running a PL/pgSQL function
Date: 2008-08-12 01:43:05
Message-ID: 24322.1218505385@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Christophe <xof(at)thebuild(dot)com> writes:
> I'm startled that I've never done this before, but... I have a PL/
> pgSQL function that takes no arguments, returns VOID, and has a bunch
> of side effects on the database. The correct way of invoking this
> function is:
> SELECT my_func();
> ... yes? Thanks; it seems to work fine, but using SELECT here is
> causing some part of my brain to scream "counter-intuitive."

Yeah, it is a little weird but it works fine. We treat VOID as a
more-or-less-real datatype that has only one value, an empty string...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-08-12 01:52:49 Re: Running a PL/pgSQL function
Previous Message Adrian Klaver 2008-08-12 00:03:55 Re: Running a PL/pgSQL function