From: | Aristide Aragon <aristide(at)lionking(dot)org> |
---|---|
To: | Ian Lance Taylor <ian(at)airs(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Building SPI programs |
Date: | 2001-02-23 03:58:29 |
Message-ID: | 20010222215829.C23109@busa.lionking.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Feb 22, 2001 at 07:49:56PM -0800, Ian Lance Taylor wrote:
> Aristide Aragon <zuri(at)busa(dot)lionking(dot)org> writes:
>
> > I have to do some programming in C or C++ and PostgreSQL.
> SPI is only for stored procedures which are dynamically linked into
> the Postgres backend.
>
> Ordinary code doesn't do that. It uses some one of the other
> mechanisms.
>
> Ian
I don't understand.. So I shouldn't use SPI? If I should, how would I comple a program, if not, what can I use? Can you help me?
Thanks in advance
Aristide
> > /tmp/ccPIp24d.o(.text+0x7): undefined reference to `SPI_connect'
> > /tmp/ccPIp24d.o(.text+0x2b): undefined reference to `SPI_exec'
> > /tmp/ccPIp24d.o(.text+0x33): undefined reference to `SPI_finish'
>
> When your program is dynamically linked in, those functions will be
> satisfied by definitions in the Postgres backend.
>
> > So I supposed I needed to link against some library. With grep I searched /usr/local/pgsql/lib for SPI_, and I found no .a's matching.
> > I found that /usr/local/pgsql/lib/plpgsql.so and /usr/local/pgsql/lib/pltcl.so had "SPI_", however none worked.
>
> Those are examples of backend procedures which are dynamically linked
> in, in those cases to define a language.
>
> Ian
From | Date | Subject | |
---|---|---|---|
Next Message | Tod McQuillin | 2001-02-23 04:00:13 | Re: is this expected or am i on crack? |
Previous Message | Tom Lane | 2001-02-23 03:50:48 | Re: problem while compiling user c functions in 7.1beta4 |