X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A8CDD9DD5EE for ; Sun, 11 Dec 2005 19:45:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59972-07 for ; Sun, 11 Dec 2005 19:45:45 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.skype.net (mail.skype.net [195.215.8.149]) by postgresql.org (Postfix) with ESMTP id 995EC9DD5ED for ; Sun, 11 Dec 2005 19:45:40 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.skype.net (Postfix) with ESMTP id 4B85E4DDB5; Mon, 12 Dec 2005 00:45:42 +0100 (CET) Received: from [10.10.10.4] (217-159-136-226-dsl.kt.estpak.ee [217.159.136.226]) by mail.skype.net (Postfix) with ESMTP id 999E64DD61; Mon, 12 Dec 2005 00:45:41 +0100 (CET) Subject: Adding funtions to postgresql (Not - )e: Please Help: PostgreSQL Query Optimizer From: Hannu Krosing To: Carlos Moreno Cc: pgsql-hackers@postgresql.org In-Reply-To: <439CAE4D.2030208@mochima.com> References: <200512111126.18566.josh@agliodbs.com> <439CAE4D.2030208@mochima.com> Content-Type: text/plain; charset=UTF-8 Date: Mon, 12 Dec 2005 01:45:26 +0200 Message-Id: <1134344727.3567.53.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/571 X-Sequence-Number: 77419 Ühel kenal päeval, P, 2005-12-11 kell 17:55, kirjutas Carlos Moreno: > Hi, > > I'm very new to this list -- I've been using and advocating PostgreSQL for > no less than 4 or 5 years now, and have participated in some of the other > mailing lists, but never on this one. > > My question is (short version): how would one go about adding a new > (built-in) function to PostgreSQL? Ask your question as a separate post, not as an answer t another thread :) > I'm interested in adding additional hash functions -- PG supports, as part > of the built-in SQL functions, MD5 hashing. So, for instance, I can simply > type, at a psql console, the following: > > select md5('abc'); > > My "feature request" (which again, I'd like to implement it myself) would > be the ability to do: > > select sha1('xyz'), sha256('etc'); > > (At least these two -- maybe for completeness it would be good to have > sha224, 384, and 512, but I guess SHA1 and SHA-256 would be a very good > and sound starting point) Take a look at the pgcrypto contrib module (in src/contrib/pgcrypto ) Not only does it show how to add functions, but it also provides many of the ones you need. ---------------- Hannu