Could anyone please give me an example on how I can define a function using
libpq if that is at all possible? 

Thanks.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

Mon, 14 Feb 2000 10:54:16 +0100
Michael Meskes <meskes@postgresql.org>
function defined in libpq?
Peter Eisentraut wrote:

> On Mon, 14 Feb 2000, Michael Meskes wrote:
>
> > Could anyone please give me an example on how I can define a function using
> > libpq if that is at all possible?
>
> Huh? I'm sure you don't mean adding a declaration to a header file and
> putting the definition in a .c file of your choice, as well as ensuring
> that it compiles?
>
> --
> Peter Eisentraut                  Sernanders vaeg 10:115
> peter_e@gmx.net                   75262 Uppsala
> http://yi.org/peter-e/            Sweden
>

I think what he wants to do is dynamically create a function from the client
side by issuing a CREATE FUNCTION statement (presumably one of the built-ins?
SQL, pl/pgSQL, pl/pgTcl.) For what its worth,  I've issued a host of unlreated
DDL statements through PQexec and all of them have worked as expected, although
CREATE FUNCTION was never one of them...

Mike Mascari




Tue, 15 Feb 2000 03:36:41 -0500
Mike Mascari <mascarm@mascari.com>
Re: [HACKERS] function defined in libpq?
Peter Eisentraut wrote:

> On Tue, 15 Feb 2000, Mike Mascari wrote:
>
> > > On Mon, 14 Feb 2000, Michael Meskes wrote:
> > >
> > > > Could anyone please give me an example on how I can define a function using
> > > > libpq if that is at all possible?
>
> > I think what he wants to do is dynamically create a function from the client
> > side by issuing a CREATE FUNCTION statement (presumably one of the built-ins?
> > SQL, pl/pgSQL, pl/pgTcl.) For what its worth,  I've issued a host of unlreated
> > DDL statements through PQexec and all of them have worked as expected, although
> > CREATE FUNCTION was never one of them...
>
> Why wouldn't it work? Or, much more interesting, how else would you do it?
>
>

Yes. Sorry. Stupid answer on my part. psql is so nice, particularly the new one :-),
that I keep forgetting it is dependent entirely upon libpq....

Mike Mascari

>
> Peter Eisentraut                  Sernanders vaeg 10:115
> peter_e@gmx.net                   75262 Uppsala
> http://yi.org/peter-e/            Sweden


Tue, 15 Feb 2000 03:45:44 -0500
Mike Mascari <mascarm@mascari.com>
Re: [HACKERS] function defined in libpq?
On Mon, 14 Feb 2000, Michael Meskes wrote:

> Could anyone please give me an example on how I can define a function using
> libpq if that is at all possible? 

Huh? I'm sure you don't mean adding a declaration to a header file and
putting the definition in a .c file of your choice, as well as ensuring
that it compiles?


-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Tue, 15 Feb 2000 13:13:15 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: [HACKERS] function defined in libpq?
On Tue, Feb 15, 2000 at 01:13:15PM +0100, Peter Eisentraut wrote:
> Huh? I'm sure you don't mean adding a declaration to a header file and
> putting the definition in a .c file of your choice, as well as ensuring
> that it compiles?

Oops. No, of course not. I meant writing a C function using libpq, making it
a shared library and then adding it to the backend via CREATE FUNCTION.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

Tue, 15 Feb 2000 13:24:06 +0100
Michael Meskes <meskes@postgreSQL.org>
Re: [HACKERS] function defined in libpq?
On Tue, 15 Feb 2000, Mike Mascari wrote:

> > On Mon, 14 Feb 2000, Michael Meskes wrote:
> >
> > > Could anyone please give me an example on how I can define a function using
> > > libpq if that is at all possible?

> I think what he wants to do is dynamically create a function from the client
> side by issuing a CREATE FUNCTION statement (presumably one of the built-ins?
> SQL, pl/pgSQL, pl/pgTcl.) For what its worth,  I've issued a host of unlreated
> DDL statements through PQexec and all of them have worked as expected, although
> CREATE FUNCTION was never one of them...

Why wouldn't it work? Or, much more interesting, how else would you do it?

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Tue, 15 Feb 2000 14:43:56 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: [HACKERS] function defined in libpq?
On Tue, Feb 15, 2000 at 03:36:41AM -0500, Mike Mascari wrote:
> I think what he wants to do is dynamically create a function from the client
> side by issuing a CREATE FUNCTION statement (presumably one of the built-ins?
> SQL, pl/pgSQL, pl/pgTcl.) For what its worth,  I've issued a host of unlreated

The function itself is defined using libpq.

> CREATE FUNCTION was never one of them...

Creating the function through libpq works fine.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

Tue, 15 Feb 2000 15:13:26 +0100
Michael Meskes <meskes@postgreSQL.org>
Re: [HACKERS] function defined in libpq?