Re Problem with new function

From: Grzegorz Przeździecki <grzegorz_przezdziecki(at)lupus(dot)waw(dot)pl>
To: hackers(at)postgreSQL(dot)org
Subject: Re Problem with new function
Date: 1999-09-23 08:54:58
Message-ID: 37E9EAE2.A9DC3B9F@lupus.waw.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I write to you few minuts ego.

I show you two files

-----------------------------------1---------------------------------
--/***************************************************************************/

--! 23.09.1999 Warszawa
--% Grzegorz Przezdziecki
--@ grzegorz_przezdziecki(at)crn(dot)pl;gprzezdz(at)elektron(dot)elka(dot)pw(dot)edu(dot)pl
--# CREATE FUNCTION fu_idklienci() RETURNS OPAQUE AS'
--$ funkcja bedzie wywololywana przez triger w momencie dodania nowego
telefonu
--$ do tablei telefonow klienta
--/***************************************************************************/

--/***************************************************************************/

-- FUNKCJA PRZED INSERTEM DO TABELI telefon klienta
--/***************************************************************************/

CREATE FUNCTION fu_idklienci() RETURNS OPAQUE AS'
DECLARE
id int4;
BEGIN

--SPRAWDZAMY FIRME

IF NEW.firma ISNULL THEN
RAISE EXCEPTION ''Pole firma musi
posiadac wartosc'';
END IF;
SELECT id_firmy INTO id FROM tb_firmy WHERE
id_firmy = NEW.id_firma;
IF NOT FOUND THEN
RAISE EXCEPTION ''Brak firmy numer
%'',NEW.id_firma;
END If;

NEW.ID_klienci:=nextval(''se_idklienci'');
RETURN NEW;
END;'
LANGUAGE 'plpgsql';
--/***************************************************************************/

--/***************************************************************************/

this file makes errors
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.
and in log file :
Sep 23 11:00:14 Databases logger: FATAL 1: btree: cannot split if start
(2) >=
maxoff (2)

second file is OK
------------------------------------------2------------------------------------------

--/***************************************************************************/

--! 23.09.1999 Warszawa
--% Grzegorz Przezdziecki
--@ grzegorz_przezdziecki(at)crn(dot)pl;gprzezdz(at)elektron(dot)elka(dot)pw(dot)edu(dot)pl
--# CREATE FUNCTION fu_idklienci() RETURNS OPAQUE AS'
--$ funkcja bedzie wywololywana przez triger w momencie dodania nowego
telefonu
--$ do tablei telefonow klienta
--/***************************************************************************/

--/***************************************************************************/

-- FUNKCJA PRZED INSERTEM DO TABELI telefon klienta
--/***************************************************************************/

CREATE FUNCTION fu_idklienci() RETURNS OPAQUE AS'
DECLARE
id int4;
BEGIN

IF NEW.firma ISNULL THEN
RAISE EXCEPTION ''Pole firma musi
posiadac wartosc'';
END IF;
SELECT id_firmy INTO id FROM tb_firmy WHERE
id_firmy = NEW.id_firma;
IF NOT FOUND THEN
RAISE EXCEPTION ''Brak firmy numer
%'',NEW.id_firma;
END If;

NEW.ID_klienci:=nextval(''se_idklienci'');
RETURN NEW;
END;'
LANGUAGE 'plpgsql';
--/***************************************************************************/

--/***************************************************************************/

Diference is in line

--SPRAWDZAMY FIRME

I use
Zed editor
[PostgreSQL 6.5.1 on i686-pc-linux-gnu, compiled by gcc 2.7.2.3]
on Debian
kernel 2.0.36

What is means this error
Sep 23 11:00:14 Databases logger: FATAL 1: btree: cannot split if start
(2) >=
maxoff (2)

Best regards

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jose Antonio Cotelo lema 1999-09-23 09:13:02 Problems when opening large objects in the server side.
Previous Message Leon 1999-09-23 08:42:32 Re: