Skip site navigation (1) Skip section navigation (2)

Re: SQL Functions

From: "Raymond Auge" <RX_Auge(at)nickel(dot)laurentian(dot)ca>
To: <pgsql-admin(at)postgresql(dot)org>, <postgres(at)productivitymedia(dot)com>
Subject: Re: SQL Functions
Date: 2004-10-19 15:38:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Hello Postgres User,

I'd have to say that functions have the same "function" in SQL as they do in any language; a logical grouping of often repeated opperations.

So, if you have a repeated sequence like

if(result of query1 does this){

then consider that you have 3 transactions with the database.

But, if all that was put into a SQL function, you have 1 transaction; "functions in SQL are atomic".

As well, in you code you have


and that's it...

clean and very fast.

Raymond Augé, B.COSC
Spécialiste en médiatisation de la formation/Multimedia specialist
Université Laurentienne / Laurentian University
<rx_auge(at)laurentienne(dot)ca> / <rx_auge(at)laurentian(dot)ca> 
(705) 675-1151 x3934

>>> Postgres User <postgres(at)productivitymedia(dot)com> 19/10/2004 11:12:47 am >>>
What are the advantages to SQL Functions?  I'm looking to optimize 
'default' PostgreSQL environments for clients. I'm writing an 
application and looking to put functions to optimize just that table, 
etc. They don't want to have a full-time database admin (surprise!).


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

pgsql-admin by date

Next:From: Tom LaneDate: 2004-10-19 15:51:21
Subject: Re: postmaster stopps
Previous:From: Andrew SullivanDate: 2004-10-19 15:28:46
Subject: Re: postmaster stopps

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group