Re: [GENERAL] custom C function problem

2008-05-03 Thread Tom Lane
"Dan \"Heron\" Myers" <[EMAIL PROTECTED]> writes: > I'm wondering if maybe there is a dependency somewhere I'm missing. I > link with postgres.lib to create the dll; Oh, you're using Windows :-(. I make it my business to not know anything about that platform, but perhaps you could get a clue by

Re: [GENERAL] custom C function problem

2008-05-03 Thread Dan "Heron" Myers
Tom Lane wrote: Well, there's nothing wrong with that C code, so the problem is someplace else. Did you remember to declare the function STRICT? If not, and if there are any nulls in your test table, a crash would be expected; there's nothing in this function that's guarding against a null po

Re: [GENERAL] custom C function problem

2008-05-03 Thread Tom Lane
"Dan \"Heron\" Myers" <[EMAIL PROTECTED]> writes: > One case that fails is essentially copied from the V1 section in the > documentation: Well, there's nothing wrong with that C code, so the problem is someplace else. Did you remember to declare the function STRICT? If not, and if there are any

Re: [GENERAL] custom C function problem

2008-05-03 Thread Dan "Heron" Myers
Tom Lane wrote: What cases have you gotten to work correctly? My guess is that you're either messed up about V0 vs V1 calling convention (ie you forgot PG_FUNCTION_INFO_V1, or added it when you shouldn't have), or you've got some kind of problem with not detoasting toasted input values. There's

Re: [GENERAL] custom C function problem

2008-05-03 Thread Tom Lane
"Dan \"Heron\" Myers" <[EMAIL PROTECTED]> writes: > I'm creating some custom C functions to load dynamically from a dll > (this is Postgres 8.3.1 on Windows XP SP2). I have two that work fine, > but any time I try to write one that uses a text*, postgres crashes. What cases have you gotten to

[GENERAL] custom C function problem

2008-05-03 Thread Dan "Heron" Myers
I'm creating some custom C functions to load dynamically from a dll (this is Postgres 8.3.1 on Windows XP SP2). I have two that work fine, but any time I try to write one that uses a text*, postgres crashes. This is true even for the example functions like "copytext" given in the documentation