Re: adding operators

Поиск
Список
Период
Сортировка
От Islam Hegazy
Тема Re: adding operators
Дата
Msg-id 010301c80450$cdbe6180$0d0e9f88@pc.cpsc.ucalgary.ca
обсуждение исходный текст
Ответ на adding operators  ("Islam Hegazy" <islheg@gmail.com>)
Ответы Re: adding operators  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Thanks for this information. It was really helpful.

Another problem that is facing me is altering existing functions. For 
example, what if I want to change the execution of the SUM function to work 
as follows:

select sum(a)
from mytable w(5);

which means to sum only 5 records or records that arrived in the last 5 
minutes. Do I need to change the core code of PostgreSQL to implement such 
thing?

Regards
Islam Hegazy



----- Original Message ----- 
From: "Brendan Jurd" <direvus@gmail.com>
To: "Islam Hegazy" <islheg@gmail.com>
Cc: <pgsql-hackers@postgresql.org>
Sent: Sunday, September 30, 2007 8:38 PM
Subject: Re: [HACKERS] adding operators


> On 10/1/07, Islam Hegazy <islheg@gmail.com> wrote:
>> I am a graduate student in the University of Calgary. I want to add some 
>> new
>> operators to PostgreSQL to perform some specific tasks in a project I am
>> working in. My problem is that I cannot find my way into the code, where
>> should I start and where to find the documentation for the code.
>
> There's no need to hack Postgres to add operators.  You can do so by
> defining functions using CREATE FUNCTION, and then hooking operators
> up to them using CREATE OPERATOR.
>
> http://www.postgresql.org/docs/8.2/static/xoper.html
> http://www.postgresql.org/docs/8.2/static/sql-createoperator.html
>
> Regards,
> BJ 



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PG on NFS may be just a bad idea
Следующее
От: Tom Lane
Дата:
Сообщение: Re: First steps with 8.3 and autovacuum launcher