C program Killed - Mailing list pgsql-general

From Patrick L. Nolan
Subject C program Killed
Date
Msg-id agi7rr$180u$1@news.hub.org
Whole thread Raw
Responses Re: C program Killed
List pgsql-general
I'm writing a C program to read from a database table
on Red Hat Linux 7.1, Postgresql version 7.1.
I practiced running it on a small table and everything
was OK.  When I switched to a large table, with 100
times as many rows, the program ran for a while and
then said
Killed

To try to get to the root of the problem, I ran it under
gdb.  It says,
(gdb) run
Starting program: /home/pln/pg/find_pg
Program terminated with signal SIGKILL, Killed.
The program no longer exists.

I'm puzzled.  Here are some possibly relevant bits of
information:

Both of the tables look like this:
  Column   |       Type       | Modifiers
-----------+------------------+-----------
 event_num | integer          | not null
 ph_time   | double precision |
 ph_l      | real             |
 ph_b      | real             |
 ph_incl   | real             |
 ph_energy | real             |
 sp_index7 | integer          |

The small table has 142427 rows.
The large one has 14958509 rows.

Here's a fragment of the program:
res = PQexec(conn,
    "SELECT event_num,ph_time,ph_l,ph_b,ph_incl,ph_energy FROM hundred_days");
nrows = PQntuples(res);
printf ("Fetching %d rows from the database.\n", nrows);
for (i = 0; i<nrows; i++) {

When it dies, it does so before getting to the printf.

--
*   Patrick L. Nolan                                          *
*   W. W. Hansen Experimental Physics Laboratory (HEPL)       *
*   Stanford University                                       *

pgsql-general by date:

Previous
From: Doug Silver
Date:
Subject: Re: was there a change in FreeBSD SHM implementation from 4.4 to
Next
From: "Henrik Steffen"
Date:
Subject: Re: Serious Crash last Friday