Skip site navigation (1) Skip section navigation (2)

Re: Using host variables -- segmentation fault

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Yadnyesh Joshi <yadnyesh_joshi(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Using host variables -- segmentation fault
Date: 2006-10-16 13:41:24
Message-ID: 20061016134124.GA59444@winnie.fuhr.org (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-novice by date

Next:From: BalvieDate: 2006-10-16 13:46:27
Subject: Re: UPDATE the field of a table with fields from another
Previous:From: Yadnyesh JoshiDate: 2006-10-16 12:16:06
Subject: Using host variables -- segmentation fault

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group