X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id EC542D1B4E1 for ; Mon, 20 Oct 2003 04:13:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 30276-08 for ; Mon, 20 Oct 2003 01:13:27 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 5BA06D1B4F2 for ; Mon, 20 Oct 2003 01:13:27 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id h9K4DRNu084054 for ; Mon, 20 Oct 2003 04:13:27 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h9K3qPR1080853 for pgsql-sql@postgresql.org; Mon, 20 Oct 2003 03:52:25 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Which is faster SQL or PL/PGSQL Date: Sun, 19 Oct 2003 23:48:38 -0400 Organization: cbbrowne Computing Inc Lines: 30 Message-ID: References: <20031020025741.43074.qmail@web14916.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, linux) Cancel-Lock: sha1:lzM4DB7OfQ27HcmDpzsRPF0uv+M= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/222 X-Sequence-Number: 15622 The world rejoiced as jinujosein@yahoo.com ("George A.J") wrote: > i am converting an MSSQL database to Postgres. there is a lot of procedures to convert. > > which language is best for functions, SQL or plpgsql. > > which is faster . i am using postgres 7.3.2 Hmm? This doesn't seem to make much more sense than the question of what colour a database should be ("Mauve has more RAM..."). SQL and pl/pgsql are quite distinct. If you have procedures that require programmed logic, with things like variables and loops, SQL generally cannot do that, and you will HAVE to use one of the embedded languages. If raw speed is at issue, it is quite likely that rewriting the procedures in C would lead to code that is faster still. But the real question is of what language you *need* to implement in. For certain sorts of simple procedures, SQL may suffice; as complexity grows, you will need to use one of the other languages, whether plpgsql, plperl, plpython, C, C++, and such, and the question won't be of speed; it will be of necessity. -- output = ("cbbrowne" "@" "cbbrowne.com") http://www.ntlug.org/~cbbrowne/linuxdistributions.html Never hit someone head on, always sideswipe. Never say, "Foo's last patch was brain-damaged", but rather, "While fixing the miscellaneous bugs in 243.xyz [foo's patch], I found...." -- from the Symbolics Guidelines for Sending Mail