Re: Multi calendar system for pgsql - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Multi calendar system for pgsql
Date
Msg-id 87skm6v9eh.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Multi calendar system for pgsql  (Mohsen Alimomeni <m.alimomeni@gmail.com>)
List pgsql-hackers
Mohsen Alimomeni <m.alimomeni@gmail.com> writes:

> Hi,
> To implement my local calendar, I tried adding a new type (pdate) to pgsql
> as an extension. At first I used a struct of size 6, and I returned a
> pointer to it in pdate_in with no problem. Now I changed the type to int32,
> returning PG_RETURN_INT32. I removed all palloc calls. but the server
> crashes with segmentation fault before returning in pdate_in.

You want to set PASSEDBYVALUE

(And you probably want to adjust alignment though I don't think it's causing
any problem aside from wasted space)

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Get trained by Bruce Momjian - ask me about
EnterpriseDB'sPostgreSQL training!
 


pgsql-hackers by date:

Previous
From: Mohsen Alimomeni
Date:
Subject: Re: Multi calendar system for pgsql
Next
From: Pavel Stehule
Date:
Subject: some broken on pg_stat_user_functions