pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem using libpsql.a
2+ messages / 2 participants
[nested] [flat]

* Problem using libpsql.a
@ 1998-09-09 20:34 Chris Williams <chris_d_williams@itd.sterling.com>
  1998-09-09 21:13 ` RE: [INTERFACES] Problem using libpsql.a Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 1 reply; 2+ messages in thread

From: Chris Williams @ 1998-09-09 20:34 UTC (permalink / raw)
  To: pgsql-interfaces

I have an application that forks of a process and is updating a table in my postgres database.  When
I have the parent process query that table to see how much has completed I get weird results.
Sometimes it works, sometimes it core dumps, and sometimes I get back a NULL results structure.  But
if I type that same query into my psql window, I get back the correct results everytime.  Currently
I don't do any type of locking on any of the tables.  My question is should I be doing some locking
and why is the query using the psql command prompt working and my direct call in my C code isn't?
Thanks!!
---------
Chris Williams
Sterling Software
Rome, New York
Phone: (315) 336-0500
Email: chris_d_williams@sterling.com




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* RE: [INTERFACES] Problem using libpsql.a
  1998-09-09 20:34 Problem using libpsql.a Chris Williams <chris_d_williams@itd.sterling.com>
@ 1998-09-09 21:13 ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 0 replies; 2+ messages in thread

From: Craig Orsinger @ 1998-09-09 21:13 UTC (permalink / raw)
  To: Chris Williams <chris_d_williams@itd.sterling.com>; +Cc: pgsql-interfaces


On 09-Sep-98 Chris Williams wrote:
> I have an application that forks of a process and is updating a table in my
> postgres database.  When
> I have the parent process query that table to see how much has completed I
> get weird results.
> Sometimes it works, sometimes it core dumps, and sometimes I get back a NULL
> results structure.  But
> if I type that same query into my psql window, I get back the correct results
> everytime.  Currently
> I don't do any type of locking on any of the tables.  My question is should I
> be doing some locking
> and why is the query using the psql command prompt working and my direct call
> in my C code isn't?

        Looks to me like your parent process may be getting interrupted
by the SIGCHLD signal from the child process. Are you examining errno on
return from your query? Might want to do that and print out the value if
it's something other than '0'.


----------------------------------
Date: 09-Sep-98  Time: 14:09:38

Craig Orsinger                  (email: <orsingerc@epg.lewis.army.mil>)
Logicon RDA
Bldg. 8B28                      "Just another megalomaniac with ideas above his
6th & F Streets                 station. The Universe is full of them."
Ft. Lewis, WA   98433                   - The Doctor
----------------------------------



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1998-09-09 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-09-09 20:34 Problem using libpsql.a Chris Williams <chris_d_williams@itd.sterling.com>
1998-09-09 21:13 ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox