Re: Issue on calling PQconnectdbParams from C

Lists: pgsql-interfaces
From: Andrei Petru Mura <mapandrei(at)gmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Issue on calling PQconnectdbParams from C
Date: 2013-02-23 09:42:36
Message-ID: CAK18DJV7J3EbiN8in7kPF1fWNJgNpFv4TjO0SALAc+PYdEC9=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-interfaces

I'm trying to create a database connection with libpq from C. If I create
the same connection with PQconnectdb, everything works fine, but if I
create it with PQconnectdbParams function, I get a segmentation fault
message, without any other message. Can anybody help me in that issue?

Note: I'm not sure if I posted in the right mailing list, so please guide
me if it is the case. Thanks for patience.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrei Petru Mura <mapandrei(at)gmail(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Issue on calling PQconnectdbParams from C
Date: 2013-02-23 11:12:33
Message-ID: 25584.1361617953@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-interfaces

Andrei Petru Mura <mapandrei(at)gmail(dot)com> writes:
> I'm trying to create a database connection with libpq from C. If I create
> the same connection with PQconnectdb, everything works fine, but if I
> create it with PQconnectdbParams function, I get a segmentation fault
> message, without any other message. Can anybody help me in that issue?

Presumably you constructed the arguments for PQconnectdbParams
incorrectly (ie, with a incorrect pointer somewhere) ... but without
seeing your code it's hard to be any more specific than that.

regards, tom lane