pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SQL Functions
2+ messages / 2 participants
[nested] [flat]

* SQL Functions
@ 2004-10-19 15:12  Postgres User <postgres@productivitymedia.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Postgres User @ 2004-10-19 15:12 UTC (permalink / raw)
  To: pgsql-admin

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!).

Thanks,
J



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: SQL Functions
@ 2004-10-19 15:38  Raymond Auge <RX_Auge@nickel.laurentian.ca>
  0 siblings, 0 replies; 2+ messages in thread

From: Raymond Auge @ 2004-10-19 15:38 UTC (permalink / raw)
  To: pgsql-admin; postgres@productivitymedia.com

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

query1(args);
if(result of query1 does this){
 query2(args);
}
else{
 query3(args);
}

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

sql_function(args);

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@laurentienne.ca> / <rx_auge@laurentian.ca> 
(705) 675-1151 x3934


>>> Postgres User <postgres@productivitymedia.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!).

Thanks,
J

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-10-19 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 15:12 SQL Functions Postgres User <postgres@productivitymedia.com>
2004-10-19 15:38 Re: SQL Functions Raymond Auge <RX_Auge@nickel.laurentian.ca>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox