Hi everybody!

I built a quite complex query that crashed the backend with the message
as stated at the bottom (backend terminated abnormally).

What did I do?

I created a view call it "birthdays" calculating the days that are due
until your next birthday:
Create view birthdays as
SELECT timespan_trunc('years', datetime_age(u.birthday,
'today'::abstime)) - ) + '@ 1 year'::timespan AS his_newage,
timespan_trunc('days',u.birthday + timespan_trunc('years',
datetime_age(u.birthday, 'today'::abstime)) - ) + '@ 1 year'::timespan -
'today'::abstime)) AS daycount_until_birthday FROM users u;

That's works fine... then, I want to select those out of the birthdays
table who will have their birthday in exactly 2 days:

select * from birthdays where daycount_until_birthday='2
days'::timespan;

That still works fine... but:
if I change the query and introduce a new table which let's others
specifically change the number of days they want to be informed before
someone's birthday, the backend crashes:

select b.* from birthdays b, users u where
daycount_until_birthday=u.birthdayreminder;

Have I done anything wrong or is it a BUG in Postgres (Version 6.4)? Is
there any limitation to how much tables may be included in a query?

Thanks a lot,
Michael

Attached, the error message:
"DBD::Pg::st execute failed: pqReadData() -- backend closed the channel
unexpecte
dly.
        This probably means the backend terminated abnormally before or
while pr
ocessing the request.
Could not execute: pqReadData() -- backend closed the channel
unexpectedly.
        This probably means the backend terminated abnormally before or
while pr
ocessing the request.

Reply via email to