Functions with aggregations (i.e. group by) causes an abort

Поиск
Список
Период
Сортировка
От Michael J Davis
Тема Functions with aggregations (i.e. group by) causes an abort
Дата
Msg-id 93C04F1F5173D211A27900105AA8FCFC145419@lambic.prevuenet.com
обсуждение исходный текст
Ответы Re: [HACKERS] Functions with aggregations (i.e. group by) causes an abort  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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
itwhere
 
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ryan Bradetich
Дата:
Сообщение: Re: [HACKERS] create view as select distinct (fwd)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Functions with aggregations (i.e. group by) causes an abort