From: | Michael J Davis <michael(dot)j(dot)davis(at)tvguide(dot)com> |
---|---|
To: | hackers(at)postgreSQL(dot)org |
Subject: | Functions with aggregations (i.e. group by) causes an abort |
Date: | 1999-04-25 21:08:54 |
Message-ID: | 93C04F1F5173D211A27900105AA8FCFC145419@lambic.prevuenet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
The following works in psql:
SELECT MemberID, InvoiceID, sum(quantity * unitprice) as InvAmount,
si_InventoryCategory(InventoryID) as CategoriesID
FROM InvoiceLines
WHERE memberid = 685
GROUP BY MemberID, InvoiceID, InventoryID;
The following causes psql to abort:
SELECT MemberID, InvoiceID, sum(quantity * unitprice) as InvAmount,
si_InventoryCategory(InventoryID) as CategoriesID
FROM InvoiceLines
WHERE memberid = 685
GROUP BY MemberID, InvoiceID, CategoriesID;
Here is the abort message:
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.
There is nothing in the postgreSQL log files.
InvoiceLines is a table. Here is si_InventoryCategory():
CREATE FUNCTION si_InventoryCategory(int4) RETURNS int4 AS '
'select it.CategoriesID from Inventory i, InventoryType it where
i.InventoryID = $1 and i.InventoryTypeID = it.InventoryTypeID' LANGUAGE
'sql';
I am using Red Hat 5.1, PostgreSQL version 6.5 as of this morning. Any
suggestions on what I can do to work around this?
Thanks, Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 1999-04-26 00:46:56 | Re: [HACKERS] Functions with aggregations (i.e. group by) causes an abort |
Previous Message | Bruce Momjian | 1999-04-25 19:41:29 | Re: [HACKERS] Efficiency of LIMIT ? |