Re: Difference between function and procedure?

From: "Paul S" <plabrh1(at)gmail(dot)com>
To:
Cc: "PostgreSQL general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Difference between function and procedure?
Date: 2006-07-20 00:22:38
Message-ID: 866624ef0607191722s7ed9d1e9r1b5c84a65d0d066f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I saw the same behavior with Functions and Procedures. At first, I could
not tell what made one go into the Function folder and one go into the
Procedure one. The one thing that clearly distinguishes a Procedure (to be
placed into the Procedures folder in PgAdminIII) is if you include an OUT
parameter. The first time I wrote a Function with an OUT parameter, I could
not find it in the functions folder. I thought at first that it didn't
compile. Then I noticed it in the Procedures folder. Probably a lot of
other characteristics that make it different, but that is at least one. :)

-Paul

On 7/19/06, Anastasios Hatzis <ahatzis(at)gmx(dot)net> wrote:
>
> Merlin Moncure wrote:
> > there are differences. PostgreSQL only really supports functions and
> > on the lists they are used interchangably. on the -hacker list about
> > a year back there was a good discussion about implementing true SP and
> > why they would be needed.
> >
> > mainly, SP are not externally transactional, making them useful for
> > maintenance type work, such as vacuum (cant be run from inside a
> > transaction) or multiple statement data load via 'copy' commands.
> >
> > i thnk (not sure) that SP can not be inlined into queries like
> > functions. this would be an important distinction.
> >
> Merlin,
>
> thank you for clarifying this. So, given your hint, I didn't miss SP
> until now, but this will probably change in future. ;-)
>
> Anastasios
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-07-20 00:49:19 Re: apparent wraparound
Previous Message MargaretGillon 2006-07-19 23:26:42 Re: Constraint for two fields unique any order