Silly Newbie question

Поиск
Список
Период
Сортировка
Искать

Silly Newbie question

От:
Aaron Spiteri <azzmosphere@hotmail.com>
Дата:
 To all,

I am brand new to writing functions for PostgreSQL and understand that this question has been asked one hundred and one times.  Please be patient with me, I do learn quickly.

My question is:

I wish to create a an aggregate function and have read and re-read the 34.10 section of the 8.3 documentation as well as scanned through the fmgr header file.  My problem is that I know certain structures are created with the idea of retaining information for use in the state function but I don't really understand which structures I should be looking at and how to initilize them (if needed) in the sfunc.  Any pushes in the right direction would be very appreciated,  I am using the Version 1 calling convention.

Thanks in advance.

Aaron 


Sell your car for just $30 at CarPoint.com.au. It's simple!

Re: Silly Newbie question

От:
Andrew Dunstan <andrew@dunslane.net>
Дата:


Aaron Spiteri wrote:
> To all,
>
> I am brand new to writing functions for PostgreSQL and understand that 
> this question has been asked one hundred and one times.  Please be 
> patient with me, I do learn quickly.
>
> My question is:
>
> I wish to create a an aggregate function and have read and re-read the 
> 34.10 section of the 8.3 documentation as well as scanned through the 
> fmgr header file.  My problem is that I know certain structures are 
> created with the idea of retaining information for use in the state 
> function but I don't really understand which structures I should be 
> looking at and how to initilize them (if needed) in the sfunc.  Any 
> pushes in the right direction would be very appreciated,  I am using 
> the Version 1 calling convention.
>
>
> 

This is not the correct forum for such questions. Please ask again on 
pgsql-general. pgsql-hackers is about development of postgresql itself.

cheers

andrew

Re: Silly Newbie question

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Aaron Spiteri  writes:
> I wish to create a an aggregate function and have read and re-read the
> 34.10 section of the 8.3 documentation as well as scanned through the
> fmgr header file.  My problem is that I know certain structures are
> created with the idea of retaining information for use in the state
> function but I don't really understand which structures I should be
> looking at and how to initilize them (if needed) in the sfunc.  Any
> pushes in the right direction would be very appreciated, I am using
> the Version 1 calling convention.

Are there any existing aggregates that do something similar to what you
need?  If so, try taking a look at their source code.  The general rule
in writing C code for Postgres is that it's an open-book test ;-) ---
you are expected to look at the code, not only the documentation.
		regards, tom lane

Re: Silly Newbie question

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Andrew Dunstan  writes:
> Aaron Spiteri wrote:
>> I wish to create a an aggregate function and have read and re-read the 
>> 34.10 section of the 8.3 documentation as well as scanned through the 
>> fmgr header file.

> This is not the correct forum for such questions. Please ask again on 
> pgsql-general. pgsql-hackers is about development of postgresql itself.

In the past we've encouraged people who are writing C-code additions
to discuss on -hackers.  I'm not sure that -general is a better place
for that; what fraction of -general readers do you think are interested
or qualified to help?

I recall seeing similar questions lately on -novice, where they
*surely* seem out of place.  If we've scared people away from -hackers
to the extent that they post C-code-hacking questions on -novice,
I think there's something wrong...
		regards, tom lane

Re: Silly Newbie question

От:
Andrew Dunstan <andrew@dunslane.net>
Дата:


Tom Lane wrote:
> Andrew Dunstan  writes:
>   
>> Aaron Spiteri wrote:
>>     
>>> I wish to create a an aggregate function and have read and re-read the 
>>> 34.10 section of the 8.3 documentation as well as scanned through the 
>>> fmgr header file.
>>>       
>
>   
>> This is not the correct forum for such questions. Please ask again on 
>> pgsql-general. pgsql-hackers is about development of postgresql itself.
>>     
>
> In the past we've encouraged people who are writing C-code additions
> to discuss on -hackers.  I'm not sure that -general is a better place
> for that; what fraction of -general readers do you think are interested
> or qualified to help?
>
> I recall seeing similar questions lately on -novice, where they
> *surely* seem out of place.  If we've scared people away from -hackers
> to the extent that they post C-code-hacking questions on -novice,
> I think there's something wrong...
>
> 	
>   

OK, fair enough.

cheers

andrew

FAQ