RE: version 1 C-Language Functions

From: "Gowey, Geoffrey" <ggowey(at)rxhope(dot)com>
To: "'Francesco Casadei'" <f_casadei(at)libero(dot)it>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: RE: version 1 C-Language Functions
Date: 2001-08-26 20:40:57
Message-ID: E15F4B031E17D5118B18009027F67927DAC8@SERVER
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Those functions demonstrate copying text input. I am not. I'm trying to
use a parameter entered as part of a select statement that will generated.
I need PG_GETARG_CSTRING(x) for this task, not PG_GETARG_TEST. The way the
program will work is it will sandwitch together the select statement into a
single var (w/ the param in the middle) using strcat and then feed it to SPI
for execution. No example that I have run across illustrates how to convert
a param entered to be used w/ regular c functions (in this case strcat).

Geoff

-----Original Message-----
From: Francesco Casadei [mailto:f_casadei(at)libero(dot)it]
Sent: Sunday, August 26, 2001 11:41 AM
To: Gowey, Geoffrey
Cc: 'Tom Lane'; 'pgsql-general(at)postgresql(dot)org'
Subject: Re: [GENERAL] version 1 C-Language Functions

On Sat, Aug 25, 2001 at 08:04:37PM -0400, Gowey, Geoffrey wrote:
> What would the correct syntax be in order to do what I want to? I need to
> enter in a variable length email address as the parameter to my planned
> function. The param will then become part of a select statement to get
> records (which I currently plan to accomplish by using strcat to join the
> beginning of the select plus the param plus the closing '. Also where is
> some good documentation on V1 command usage and examples?
>
> Geoff
>
> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Sent: Saturday, August 25, 2001 7:29 PM
> To: Gowey, Geoffrey
> Cc: 'pgsql-general(at)postgresql(dot)org'
> Subject: Re: [GENERAL] version 1 C-Language Functions
>
>
> "Gowey, Geoffrey" <ggowey(at)rxhope(dot)com> writes:
> > Unfortunately, this function fails. What am i doing wrong?
>
> "text *" is not "char *". The equivalent V0 code would fail just the
> same way.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>
> end of the original message

Read the "Programmer's Guide", part II "Server Programming", section 13.4.3
"Version-1 Calling Conventions for C-Language Functions". Look at the
example
functions copytext and concat_text.

Francesco Casadei

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cody 2001-08-26 20:50:16 Re: SELECT FOR UPDATE
Previous Message Alex Knight 2001-08-26 20:26:44 RE: PL/java?