Re: Using host variables -- segmentation fault - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: Using host variables -- segmentation fault
Date
Msg-id 20061016134124.GA59444@winnie.fuhr.org
Whole thread Raw
In response to Using host variables -- segmentation fault  (Yadnyesh Joshi <yadnyesh_joshi@yahoo.com>)
List pgsql-novice
On Mon, Oct 16, 2006 at 05:16:06AM -0700, Yadnyesh Joshi wrote:
> The first EXEC SQL INSERT INTO simple values (6); executes fine. The
> value is added in the database as I am doing a COMMIT.
>
> However, segmentation fault occurs at EXEC SQL INSERT INTO simple values (:i);
> What can be the problem?

The program you posted doesn't initialize i but I'd expect that to
result in a garbage value being inserted instead of a segmentation
fault.  Do you still get a segmentation fault if you initialize i?
What about if you comment out the line that inserts i?

Your program doesn't return a value from main().  I haven't worked
on any platforms where that would cause a segmentation fault but it
should be fixed in any case.

What platform are you on?  What version of PostgreSQL?  Did you get
a core dump?  If so, what does a stack trace show?  What do you see
if you add "ECPGdebug(1, stderr);" at the beginning of the program?

--
Michael Fuhr

pgsql-novice by date:

Previous
From: Yadnyesh Joshi
Date:
Subject: Using host variables -- segmentation fault
Next
From: Balvie
Date:
Subject: Re: UPDATE the field of a table with fields from another