v6.4.2 backend crashing on certain sql stmts
v6.4.2 backend crashing on certain sql stmts
От:
gjerde@icebox.org
Дата:
Hi,
I've been running v6.4.2 for a while, and it's been running great.
Recently I destroyed my database and recreated them(i wanted to change
some fields).
This is on Linux 2.0.35 i386.
Now I get this error, but only on certain statements:
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally before or
while processing the request.
We have lost the connection to the backend, so further processing is
impossible. Terminating.
My tables:
Database = customers
+------------------+----------------------------------+----------+
| Owner | Relation | Type |
+------------------+----------------------------------+----------+
| postgres | currentuser | table |
| postgres | currentuser_id_seq | sequence |
| postgres | currentuser_pkey | index |
| postgres | memberaccess | table |
| postgres | memberaccess_id_seq | sequence |
| postgres | memberaccess_pkey | index |
| postgres | members | table |
| postgres | members_pkey | index |
+------------------+----------------------------------+----------+
This is a normal query:
customers=> select * from memberaccess;
id|memberid|access
--+--------+-----------
1| 1|parts
2| 1|mcrd
[snip - normal info]
Another normal query:
customers=> select * from members;
[snip - normal info]
This is the query that breaks:
SELECT memberaccess.access
FROM memberaccess
WHERE memberaccess.MemberID = members.ID
AND members.username LIKE 'gjerde';
This last query will give the error message on top.
The sql statements to create my tables are below.
Thanks,
Ole Gjerde
System Administrator
Avsupport Inc.
CREATE TABLE members (
ID int4 PRIMARY KEY,
username varchar(64) NOT NULL,
password varchar(64) NOT NULL,
companyname varchar(128),
contact varchar(64),
phone varchar(32),
fax varchar(32),
email varchar(64),
contactby varchar(16),
datecreated int8 NOT NULL,
status varchar(32),
demodaysleft int4,
lastlogintime int8,
concurrentusers int4,
searchnum int8,
rfqnum int8,
loginnum int8
);
CREATE TABLE memberaccess (
ID serial PRIMARY KEY,
memberid int8 NOT NULL,
access varchar(32) NOT NULL
);
Re: [ADMIN] v6.4.2 backend crashing on certain sql stmts
От:
Herouth Maoz <herouth@oumail.openu.ac.il>
Дата:
At 11:39 +0200 on 20/1/99, gjerde@icebox.org wrote: > > This is the query that breaks: > SELECT memberaccess.access > FROM memberaccess > WHERE memberaccess.MemberID = members.ID > AND members.username LIKE 'gjerde'; > > This last query will give the error message on top. > The sql statements to create my tables are below. You are comparing a value of type INT8 with one of type INT4 . I suppose this *should* work OK, with one type being converted to the other, but as I have seen so many messages to the mailing lists about broken INT8 support, I think you better avoid it. Think: if you are restricting by MemberID = ID, it makes sense that the two fields should have the same domain. That is, since members.ID, a primary key, will never have the big values associated with an INT8, it makes no sense to define MemberID as INT8. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma