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

Re: LIBPQ: program crashed during executing query

From: "Alex Glikson" <agliks(at)technion(dot)ac(dot)il>
To: pgsql-bugs(at)postgresql(dot)org(dot)pgsql-general(at)postgresql(dot)org
Subject: Re: LIBPQ: program crashed during executing query
Date: 2002-01-10 11:39:22
Message-ID: a1juik$4ja$1@news.huji.ac.il (view raw or flat)
Thread:
Lists: pgsql-bugs
Please, ignore my question. The problem was that I did PQclear(res) before
calling to PQgetvalue(res,...)
Anyway, it should not crush (IMHO).

Alex

"Alex Glikson" <agliks(at)technion(dot)ac(dot)il> wrote in message
news:a1jjj5$tas$1(at)news(dot)huji(dot)ac(dot)il(dot)(dot)(dot)
> Hi!
>
> My C program executes a pretty complex query (of length about 600 chars,
> with subqueries, etc.).
> When I run it (on Linux), it crashes with "Segmentation fault (core
> dumped)".
> I'm sure that the program crashes on this specific PQexec command.
>
> Is there a length limit for queries in PQexec, or is there any other
reason
> for it?
> The query is attached.
>
> Thanks in advance,
>
>     Alex
>
>  P.S. The query is:
> SELECT s1.GivingCode FROM Scored s1, Scored s2
>   WHERE s1.Score >= 8 AND s2.Score >= 8 AND s1.Year = s2.Year AND
>    s1.GivingCode = s2.ReceivingCode AND s1.ReceivingCode = s2.GivingCode
AND
>    s1.GivingCode NOT IN (SELECT Code FROM Friends) AND
>    s1.ReceivingCode IN (SELECT Code FROM Friends) AND
>    NOT EXISTS (SELECT * FROM Represented re1, Represented re2, Scored sc
> WHERE
>     re1.Year = re2.Year AND re1.Year = sc.Year AND re1.Code =
s1.GivingCode
> AND
>     re2.Code = s1.ReceivingCode AND
>     ((sc.GivingCode = s1.ReceivingCode AND sc.ReceivingCode =
s1.GivingCode
> AND sc.Score < 8) OR
>      (sc.GivingCode = s1.GivingCode AND sc.ReceivingCode =
s1.ReceivingCode
> AND sc.Score < 8)))
>
>
>



In response to

pgsql-bugs by date

Next:From: Achilleus MantziosDate: 2002-01-10 16:27:24
Subject: ResultSet.getFetchSize()
Previous:From: Alex GliksonDate: 2002-01-10 08:31:43
Subject: LIBPQ: program crashed during executing query

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