X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EC53132A0F4 for ; Tue, 19 Oct 2004 16:39:14 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37168-03 for ; Tue, 19 Oct 2004 15:39:13 +0000 (GMT) Received: from luadmn2.laurentian.ca (mail-backup.laurentian.ca [142.51.1.226]) by svr1.postgresql.org (Postfix) with ESMTP id AFD74329F46 for ; Tue, 19 Oct 2004 16:39:09 +0100 (BST) Received: from OUTMAIL-MTA by luadmn2.laurentian.ca with Novell_GroupWise; Tue, 19 Oct 2004 11:39:08 -0400 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Date: Tue, 19 Oct 2004 11:38:38 -0400 From: "Raymond Auge" To: , Subject: Re: SQL Functions Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/244 X-Sequence-Number: 15237 Hello Postgres User, I'd have to say that functions have the same "function" in SQL as they do i= n 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; "func= tions in SQL are atomic". As well, in you code you have sql_function(args); and that's it... clean and very fast. -------------------------------------------------------------- Raymond Aug=E9, B.COSC Sp=E9cialiste en m=E9diatisation de la formation/Multimedia specialist Universit=E9 Laurentienne / Laurentian University / =20 (705) 675-1151 x3934 >>> Postgres User 19/10/2004 11:12:47 am >= >> What are the advantages to SQL Functions? I'm looking to optimize=20 'default' PostgreSQL environments for clients. I'm writing an=20 application and looking to put functions to optimize just that table,=20 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