Thread: #include "executor/spi.h" throwing errors

#include "executor/spi.h" throwing errors

From
"Harpreet Dhaliwal"
Date:
Hi,
I'm trying to use SPI for database connectivity at the server side.

My database is intialized at /usr/local/pgsql/hps

spi.h is at the follwoing location

/usr/include/pgsql/server/executor.

I have a C file that has the SPI code and is located at /usr/local/pgsql/hps
I thin file i do #include "executor/spi.h"

This throws hell lot of errors (hundreds of them), even if i don't have any SPI code in my C file as of now.

Can anyone please tell me whats going wrong and what header files should be kept where?

Thanks in advance,

~Harpreet

Re: #include "executor/spi.h" throwing errors

From
Martijn van Oosterhout
Date:
On Wed, Aug 30, 2006 at 02:16:36AM -0400, Harpreet Dhaliwal wrote:
> Hi,
> I'm trying to use SPI for database connectivity at the server side.

<snip>

> This throws hell lot of errors (hundreds of them), even if i don't have any
> SPI code in my C file as of now.
>
> Can anyone please tell me whats going wrong and what header files should be
> kept where?

Well, you're doing something wrong then:

$ cat a.c
#include <executor/spi.h>
$ gcc -I /usr/include/postgresql/server -c a.c
$

No errors or warnings. Please show the exact command you're using.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

Re: #include "executor/spi.h" throwing errors

From
"Harpreet Dhaliwal"
Date:
Now i did something like this

$ cat a.c
#include <executor/spi.h>
$ gcc -I /usr/include/pgsql/server -c a.c
$

still getting the same errors.

The only difference between your and my code being /usr/include/postgresql/server and /usr/include/pgsql/server



On 8/30/06, Martijn van Oosterhout <kleptog@svana.org> wrote:
On Wed, Aug 30, 2006 at 02:16:36AM -0400, Harpreet Dhaliwal wrote:
> Hi,
> I'm trying to use SPI for database connectivity at the server side.

<snip>

> This throws hell lot of errors (hundreds of them), even if i don't have any
> SPI code in my C file as of now.
>
> Can anyone please tell me whats going wrong and what header files should be
> kept where?

Well, you're doing something wrong then:

$ cat a.c
#include <executor/spi.h>
$ gcc -I /usr/include/postgresql/server -c a.c
$

No errors or warnings. Please show the exact command you're using.

Have a nice day,
--
Martijn van Oosterhout   < kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE9S/1IB7bNG8LQkwRAolRAJ9Kx0cFrzFiox0Bva5dD/nps+9EKQCdGsyn
+46ZT9EMGLoYC55WGuhaRvQ=
=eDn0
-----END PGP SIGNATURE-----



Re: #include "executor/spi.h" throwing errors

From
"Harpreet Dhaliwal"
Date:
Can you please email me your spi.h.
Need to see the path of other header files that spi.h includes and compare it with what i have.

~Harpreet

On 8/30/06, Harpreet Dhaliwal <harpreet.dhaliwal01@gmail.com> wrote:
Now i did something like this


$ cat a.c
#include <executor/spi.h>
$ gcc -I /usr/include/pgsql/server -c a.c
$

still getting the same errors.

The only difference between your and my code being /usr/include/postgresql/server and /usr/include/pgsql/server



On 8/30/06, Martijn van Oosterhout < kleptog@svana.org> wrote:
On Wed, Aug 30, 2006 at 02:16:36AM -0400, Harpreet Dhaliwal wrote:
> Hi,
> I'm trying to use SPI for database connectivity at the server side.

<snip>

> This throws hell lot of errors (hundreds of them), even if i don't have any
> SPI code in my C file as of now.
>
> Can anyone please tell me whats going wrong and what header files should be
> kept where?

Well, you're doing something wrong then:

$ cat a.c
#include <executor/spi.h>
$ gcc -I /usr/include/postgresql/server -c a.c
$

No errors or warnings. Please show the exact command you're using.

Have a nice day,
--
Martijn van Oosterhout   < kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE9S/1IB7bNG8LQkwRAolRAJ9Kx0cFrzFiox0Bva5dD/nps+9EKQCdGsyn
+46ZT9EMGLoYC55WGuhaRvQ=
=eDn0
-----END PGP SIGNATURE-----




Re: #include "executor/spi.h" throwing errors

From
Martijn van Oosterhout
Date:
On Wed, Aug 30, 2006 at 02:59:45AM -0400, Harpreet Dhaliwal wrote:
> Can you please email me your spi.h.
> Need to see the path of other header files that spi.h includes and compare
> it with what i have.

Perhaps you should post some of the actual errors you're getting?

http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/spi.h?rev=1.53;content-type=text%2Fplain

That's that standard 8.1 version.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

Re: #include "executor/spi.h" throwing errors

From
"Harpreet Dhaliwal"
Date:
Also,
Where should the directorires
executor, nodes, utils, access, catalog be?

Over here, its searching it in /usr/include
However, these files are located at /usr/include/pgsql/server/

When i copy these directories to /usr/include, it throws the error that I posted in the form
of a file a minute ago.
If i don't copy these files to /usr/include and let them be where they are i.e /usr/include/pgsql/server
then it says, file /executor/spi.h not found.

don't know what is this mess all about.

Thanks,

~Harpreet

On 8/30/06, Harpreet Dhaliwal <harpreet.dhaliwal01@gmail.com> wrote:
Hi,
Please find attached the error file.
Thanks
~Harpreet

On 8/30/06, Martijn van Oosterhout < kleptog@svana.org > wrote:
On Wed, Aug 30, 2006 at 02:59:45AM -0400, Harpreet Dhaliwal wrote:
> Can you please email me your spi.h.
> Need to see the path of other header files that spi.h includes and compare
> it with what i have.

Perhaps you should post some of the actual errors you're getting?

http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/spi.h?rev=1.53;content-type=text%2Fplain

That's that standard 8.1 version.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org >   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE9Tg+IB7bNG8LQkwRAkJZAJ41NKMEqk/UI/axBkRohYGXQzHrngCfYggr
sK5+2Z5Frf91Z9rFf6Gfm0U=
=Fyvk
-----END PGP SIGNATURE-----





Re: #include "executor/spi.h" throwing errors

From
"Harpreet Dhaliwal"
Date:
Also,

a.c is at
/usr/local/pgsql/hps

and sp.h is at

/usr/include/pgsql/server/executor

Does that make a difference?

Regards,
~harpreet

On 8/30/06, Harpreet Dhaliwal <harpreet.dhaliwal01@gmail.com> wrote:
Also,
Where should the directorires
executor, nodes, utils, access, catalog be?

Over here, its searching it in /usr/include
However, these files are located at /usr/include/pgsql/server/

When i copy these directories to /usr/include, it throws the error that I posted in the form
of a file a minute ago.
If i don't copy these files to /usr/include and let them be where they are i.e /usr/include/pgsql/server
then it says, file /executor/spi.h not found.

don't know what is this mess all about.

Thanks,

~Harpreet

On 8/30/06, Harpreet Dhaliwal < harpreet.dhaliwal01@gmail.com> wrote:
Hi,
Please find attached the error file.
Thanks
~Harpreet

On 8/30/06, Martijn van Oosterhout < kleptog@svana.org > wrote:
On Wed, Aug 30, 2006 at 02:59:45AM -0400, Harpreet Dhaliwal wrote:
> Can you please email me your spi.h.
> Need to see the path of other header files that spi.h includes and compare
> it with what i have.

Perhaps you should post some of the actual errors you're getting?

http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/spi.h?rev=1.53;content-type=text%2Fplain

That's that standard 8.1 version.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org >   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE9Tg+IB7bNG8LQkwRAkJZAJ41NKMEqk/UI/axBkRohYGXQzHrngCfYggr
sK5+2Z5Frf91Z9rFf6Gfm0U=
=Fyvk
-----END PGP SIGNATURE-----






Re: #include "executor/spi.h" throwing errors

From
"Harpreet Dhaliwal"
Date:
Also,
Can you please email me ur directory structure, as in, absolute path of a.c and absolute path of spi.h.

Thanks,
~Harpreet

On 8/30/06, Harpreet Dhaliwal <harpreet.dhaliwal01@gmail.com> wrote:
Also,

a.c is at
/usr/local/pgsql/hps

and sp.h is at

/usr/include/pgsql/server/executor

Does that make a difference?

Regards,
~harpreet


On 8/30/06, Harpreet Dhaliwal <harpreet.dhaliwal01@gmail.com> wrote:
Also,
Where should the directorires
executor, nodes, utils, access, catalog be?

Over here, its searching it in /usr/include
However, these files are located at /usr/include/pgsql/server/

When i copy these directories to /usr/include, it throws the error that I posted in the form
of a file a minute ago.
If i don't copy these files to /usr/include and let them be where they are i.e /usr/include/pgsql/server
then it says, file /executor/spi.h not found.

don't know what is this mess all about.

Thanks,

~Harpreet

On 8/30/06, Harpreet Dhaliwal < harpreet.dhaliwal01@gmail.com> wrote:
Hi,
Please find attached the error file.
Thanks
~Harpreet

On 8/30/06, Martijn van Oosterhout < kleptog@svana.org > wrote:
On Wed, Aug 30, 2006 at 02:59:45AM -0400, Harpreet Dhaliwal wrote:
> Can you please email me your spi.h.
> Need to see the path of other header files that spi.h includes and compare
> it with what i have.

Perhaps you should post some of the actual errors you're getting?

http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/spi.h?rev=1.53;content-type=text%2Fplain

That's that standard 8.1 version.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org >   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE9Tg+IB7bNG8LQkwRAkJZAJ41NKMEqk/UI/axBkRohYGXQzHrngCfYggr
sK5+2Z5Frf91Z9rFf6Gfm0U=
=Fyvk
-----END PGP SIGNATURE-----







Re: #include "executor/spi.h" throwing errors

From
Martijn van Oosterhout
Date:
On Wed, Aug 30, 2006 at 03:53:13AM -0400, Harpreet Dhaliwal wrote:
> Also,
> Can you please email me ur directory structure, as in, absolute path
> of a.cand absolute path of
> spi.h.

The absolute path of a.c is the irrelevent, it's in the current
directory. executor/spi.h is in /usr/include/postgresql/server.

BTW, in your sample output you have -l (lowercase L), why? If it were -I
(capital I) I could understand.

The directory structure is simply the normal one.

gcc -I `pg_config --includedir-server` a.c

will aso work.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

Re: #include "executor/spi.h" throwing errors

From
"Harpreet Dhaliwal"
Date:
Did not understand about capital L and small L.
What should i be using, capital or small.

I also tried
gcc -I `pg_config --includedir-server` a.c

and it still says executor/spi.h doesn't exist.


On 8/30/06, Martijn van Oosterhout <kleptog@svana.org> wrote:
On Wed, Aug 30, 2006 at 03:53:13AM -0400, Harpreet Dhaliwal wrote:
> Also,
> Can you please email me ur directory structure, as in, absolute path
> of a.cand absolute path of
> spi.h.

The absolute path of a.c is the irrelevent, it's in the current
directory. executor/spi.h is in /usr/include/postgresql/server.

BTW, in your sample output you have -l (lowercase L), why? If it were -I
(capital I) I could understand.

The directory structure is simply the normal one.

gcc -I `pg_config --includedir-server` a.c

will aso work.
--
Martijn van Oosterhout   <kleptog@svana.org >   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE9UXOIB7bNG8LQkwRAvCmAKCHbkjgjiQWKOGTRhpNAvPWNiDaCACgkJzJ
Zn1eVoDmB4AwDf0gzjlMENQ=
=31fE
-----END PGP SIGNATURE-----



Re: #include "executor/spi.h" throwing errors

From
Martijn van Oosterhout
Date:
On Wed, Aug 30, 2006 at 04:14:20AM -0400, Harpreet Dhaliwal wrote:
> Did not understand about capital L and small L.
> What should i be using, capital or small.

Please use a font that distinguishes between I and l. It's capital I
like in INDIGO. Not an L at all...

> I also tried
> gcc -I `pg_config --includedir-server` a.c
>
> and it still says executor/spi.h doesn't exist.

Then your setup is badly broken. "pg_config --includedir-server" should
point to the include directory of your postgres installation.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

Re: #include "executor/spi.h" throwing errors

From
"Harpreet Dhaliwal"
Date:
Problem was that i was using -L as in LEAMON, not I as in Indigo.
Its working now.
Martijn, thanks alot for your patience.
I realy don't know why was I doing -L, actually i was thinkin of linking something. HUH.
Had to include.

Thanks alot once again

~Harpreet

On 8/30/06, Martijn van Oosterhout <kleptog@svana.org > wrote:
On Wed, Aug 30, 2006 at 04:14:20AM -0400, Harpreet Dhaliwal wrote:
> Did not understand about capital L and small L.
> What should i be using, capital or small.

Please use a font that distinguishes between I and l. It's capital I
like in INDIGO. Not an L at all...

> I also tried
> gcc -I `pg_config --includedir-server` a.c
>
> and it still says executor/spi.h doesn't exist.

Then your setup is badly broken. "pg_config --includedir-server" should
point to the include directory of your postgres installation.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE9UrRIB7bNG8LQkwRAskiAKCB8L4FUs5JfmaNalY/g4FetZjzqQCfWCwg
50juNfNEXM/nkIqH0EbmgOo=
=wbAT
-----END PGP SIGNATURE-----