Re: Please Help: PostgreSQL Query Optimizer

From: Carlos Moreno <moreno(at)mochima(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Please Help: PostgreSQL Query Optimizer
Date: 2005-12-11 22:55:09
Message-ID: 439CAE4D.2030208@mochima.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-benchmarks pgsql-chat pgsql-docs pgsql-hackers


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?

Long-ish version:

I know the answer "in theory" -- one goes through the source code, find
out how it all works, and modify/add the code to add or fix whatever
feature we want.

I guess my point in here would be rather a "feature request" -- except
that I'd find it pretty exciting to implement it myself, and then propose
the new feature by volunteering the implementation that I already wrote
(seems like the spirit of open-source communities, right?) -- then of
course, it would be subject to consensus, whether or not the feature
makes sense and the implementation is good enough.

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)

So, can you offer some advice or pointers on how to go about that?

I started by doing a search for the string md5 through all the source
code -- the problem is, md5 shows up in many many many places (it is
part of the authentication protocol, among other things), so I got a
little bit lost searching through it all.

I wonder if you have some documents specifically aimed at providing
advice and documentation for prospective developers (or for people
that want to "tweak" the source code to fix/tuneup or add functionality),
I guess that would be great for me in this case.

Thanks!

Carlos
--

In response to

Responses

Browse pgsql-benchmarks by date

  From Date Subject
Next Message Hannu Krosing 2005-12-11 23:45:26 Adding funtions to postgresql (Not - )e: Please Help: PostgreSQL Query Optimizer
Previous Message Anjan Kumar. A. 2005-12-11 22:06:01 Re: [HACKERS] Please Help: PostgreSQL Query Optimizer

Browse pgsql-chat by date

  From Date Subject
Next Message Hannu Krosing 2005-12-11 23:45:26 Adding funtions to postgresql (Not - )e: Please Help: PostgreSQL Query Optimizer
Previous Message Anjan Kumar. A. 2005-12-11 22:06:01 Re: [HACKERS] Please Help: PostgreSQL Query Optimizer

Browse pgsql-docs by date

  From Date Subject
Next Message Hannu Krosing 2005-12-11 23:45:26 Adding funtions to postgresql (Not - )e: Please Help: PostgreSQL Query Optimizer
Previous Message Anjan Kumar. A. 2005-12-11 22:06:01 Re: [HACKERS] Please Help: PostgreSQL Query Optimizer

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2005-12-11 23:45:26 Adding funtions to postgresql (Not - )e: Please Help: PostgreSQL Query Optimizer
Previous Message Anjan Kumar. A. 2005-12-11 22:06:01 Re: [HACKERS] Please Help: PostgreSQL Query Optimizer