SPI_exec - Trying to access SPI_tuptable - error of 'dereferencing pointer to incomplete type'

From: Justin Clift <aa2(at)bigpond(dot)net(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: SPI_exec - Trying to access SPI_tuptable - error of 'dereferencing pointer to incomplete type'
Date: 2001-02-09 02:01:42
Message-ID: 3A834F86.AF452A37@bigpond.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I'm starting to program with the SPI interface with PG 7.0.3. I can get
everything to work up until I use SPI_exec (successfully) using a query
like 'SELECT foobar, baz1 from test1'.

The return code from SPI_exec indicates SPI_OK_SELECT and the variable
SPI_processed is 2 (meaning there are two 'results' available from the
select);

The trouble is that when I try and access the global variable
SPI_tuptable, I get the error 'dereferencing pointer to incomplete
type'.

The offending line in question in my source code is :

elog(NOTICE, "\nSPI_tuptable->alloced = %u\n\0", SPI_tuptable->alloced);

The feeling I get is something is incorrect in the header files I'm
using. So far I've been able to point to the installed include files
(/opt/postgresql/include) and have everything work. Now that I'm
getting errors I've decided to try pointing to the source code
(/install/postgresql-7.0.3/src/include and
/install/postgresql-7.0.3/src/backend) in the hope the include files are
more complete.

This is where I get the error "dereferencing pointer to incomplete type"
with the above line of code.

The exact command I'm using to compile is "gcc -fpic -shared
-I/install/postgresql-7.0.3/src/include/
-I/install/postgresql-7.0.3/src/backend
-L/install/postgresql-7.0.3/src/lib -o booking_sp_id.so booking_sp_id.c"

Can someone please give me some pointers as to what I'm doing wrong?

Regards and best wishes,

Justin Clift
Database Administrator

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-02-09 02:12:57 Re: Syslog and pg_options (for RPMs)
Previous Message Tom Lane 2001-02-09 00:10:50 Re: Plan for straightening out the include-file mess