Re: C Programming with postgres.h - my function crashes

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Alex Page <alex(dot)page(at)cancer(dot)org(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: C Programming with postgres.h - my function crashes
Date: 2003-12-02 18:29:33
Message-ID: 3FCCDA0D.2060409@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> Datum enum_gender_in(PG_FUNCTION_ARGS) {
> text *invalue = PG_GETARG_TEXT_P(0);

>
> PG_FUNCTION_INFO_V1(enum_gender_out);
>
> Datum enum_gender_out(PG_FUNCTION_ARGS) {
> PG_RETURN_TEXT_P (outvalue);
> }

IN function takes a C-string, not a text and
OUT functions should return C-string, not a text.

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2003-12-02 18:43:06 Re: language war
Previous Message Marc A. Leith 2003-12-02 18:19:37 Re: language war