Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA04520; Thu, 12 Aug 93 20:57:51 -0700
Message-Id: <9308130357.AA04520@postgres.Berkeley.EDU>
From: Kent Archie <kca@iwtqg.Berkeley.EDU>
Subject: More error message problems, I think
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
To: postgres@postgres.berkeley.edu (Postgres Mailing List)
Date: Thu, 12 Aug 93 22:59:48 CDT
From: Kent Archie <kca@iwtqg.Berkeley.EDU>
X-Mailer: ELM [version 2.3 PL11]

Carol Paxson explained what the various messages from PQexec()meant and that
helps.
However, it didn't explain the problem I am seeing.
Examples will follow, but it is as if there is a queue of
messages.
I do a number of appends in a loop and it is as if some of the
calls to PQexec() are returning messages from other or previous PQexec()
calls.

For example:
After the first append which looks like
put_struct: Buf = :append amt_struct_tree (file_id="add2^junk/add2^add2.ada",num
ber= 1,ntype=351,value="EMPTY",parent=0,children="{2,3,4,5,9,10,21}", lineno=3,c
olumn=1,label="NOLABEL",name="test"): length = 177

The value from PQexec() is:
put_struct: res = :CAPPEND 24160:

But the next append is:
put_struct: Buf = :append amt_struct_tree (file_id="add2^junk/add2^add2.ada",num
ber= 2,ntype=358,value="low, mid, high, value:INTEGER",parent=1,children="{}", l
ineno=4,column=30,label="NOLABEL",name="NONAME"): length = 189

And the return message is:
put_struct: res = :CAPPEND 0:

whereas the third appends message is :
put_struct: res = :CAPPEND 24161:

This kind of alternation continues throughout the loop
that creates the appends.
After all this, the table only has the first 14 of the 
21 records that are supposed to be there.

Then I do a retrieve on a different table and get the following results:
get_version: the query is :retrieve portal getver (amt_version.ver_num)
  where amt_version.file_id = "add2^junk/add2^add2.ada" and amt_version.amt_tabl
  e = "struct_tree":

>From the begin command I get:
  get_version: BEGIN res= :CAPPEND 0:
>From the retrieve I get:
  get_version: res= :CAPPEND 24172:
>From the fetch I get:
  get_version: FETCH res= :CAPPEND 0:
And from the end command I get:
  get_version: END res= :CAPPEND 24173:

At this point my code dumps core in PQntuples();

This looks like there is a queue of return messages so the PQexec() calls
that come after the appending get the last few messages from that.

Any suggestions? Other information needed to explain this?
This is version 4.1, using the pre-built Sun binaries.  My OS is SunOS 4.1.3.
**kent
Kent Archie
kca@iwtqg.att.com
