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?
In response to
pgsql-novice by date
|Next:||From: Balvie||Date: 2006-10-16 13:46:27|
|Subject: Re: UPDATE the field of a table with fields from another|
|Previous:||From: Yadnyesh Joshi||Date: 2006-10-16 12:16:06|
|Subject: Using host variables -- segmentation fault|