From: | "Adam Walczykiewicz" <archiver(at)db(dot)geocrawler(dot)com> |
---|---|
To: | pgsql-hackers(at)hub(dot)org |
Subject: | btree: failed to add item to |
Date: | 2000-01-06 14:40:07 |
Message-ID: | 200001061440.GAA30525@www.geocrawler.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
This message was sent from Geocrawler.com by "Adam Walczykiewicz" <adam(dot)walczykiewicz(at)multiuser(dot)com(dot)pl>
Be sure to reply to that address.
Hi!
I've tried to create function in plpgsql in
postgresql 6.5 (on Linux Suse 6.2).
: i file.pl
In response I got on the screen an error message :
"gReadData()-- backend closed the channel
unexpectadly..."
I was back in shell.
In /var/lib/pgsql/pgserver.log I saw :
FATAL1 : btree: failed to add item to the page
The next thing I did was to cut some last 3 lines
(those beginning with substr(...))
And I run again
: i file.pl
In response I got again on the screen an error
message :
"gReadData()-- backend closed the channel
unexpectadly..."
I was back in shell.
In /var/lib/pgsql/pgserver.log I saw :
FATAL1 : my bits moved right off to the end of
the world!
After all of it I cut some more lines (I thougt
that the function was
to long to write it down in pg_proc).
And execute once again:
: i file.pl
and it works.
Next I add some more lines and start again to
create this function and
it failed again with the same effects.
Why it hapenned?? What can I do to solve that
problem.
Thanks for any help!!!!
Regards
Adam Walczykiewicz
(adam(dot)walczykiewicz(at)multiuser(dot)com(dot)pl)
(file.pl)
drop function insklient(text);
create function insklient(text) returns text as '
declare
kl_wa klient.wa%TYPE;
kl_typk klient.typk%TYPE;
kl_czas_od_ob klient.czas_od_ob%TYPE;
kl_plec klient.plec%TYPE;
kl_nazwisko klient.nazwisko%TYPE;
kl_imie klient.imie%TYPE;
kl_imied klient.imied%TYPE;
kl_pesel klient.pesel%TYPE;
kl_nip klient.nip%TYPE;
kl_i_ojca klient.i_ojca%TYPE;
kl_nazwisko_r klient.nazwisko_r%TYPE;
kl_data_ur klient.data_ur%TYPE;
kl_tel_dom klient.tel_dom%TYPE;
kl_kod_p klient.kod_p%TYPE;
kl_miasto klient.miasto%TYPE;
kl_ulica klient.ulica%TYPE;
kl_kr_tel klient.kr_tel%TYPE;
kl_kr_kod_p klient.kr_kod_p%TYPE;
kl_kr_miasto klient.kr_miasto%TYPE;
kl_kr_ulica klient.kr_ulica%TYPE;
kl_tel_pr klient.tel_pr%TYPE;
kl_nzprac klient.nzprac%TYPE;
kl_zp_kod klient.zp_kod_p%TYPE;
kl_zp_miasto klient.zp_miasto%TYPE;
kl_zp_ulica klient.zp_ulica%TYPE;
kl_uwagi1 klient.uwagi1%TYPE;
kl_uwagi2 klient.uwagi2%TYPE;
str text;
kl_serial int4;
begin
--str := $1;
kl_wa := substr(str,1,textpos(str,'','')-
1);
str := substr(str,textpos(str,'','')+1);
kl_typk := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_czas_od_ob := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_plec := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_nazwisko := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_imie := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_imied := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_pesel := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_nip := substr(str,1,textpos(str,'','')-
1);
str := substr(str,textpos(str,'','')+1);
kl_i_ojca := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_nazwisko_r := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_data_ur := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_tel_dom := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_kod_p := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_miasto := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_ulica := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')+1);
kl_kr_tel := substr(str,1,textpos
(str,'','')-1);
str := substr(str,textpos(str,'','')-1);
str := substr(str,textpos(str,'','')-1);
kl_kr_miasto := substr(str,1,texpos
(str,'','')-1);
str := substr(str,textpos(str,'','')-1);
kl_kr_ulica := substr(str,1,textpos
(str,'','')-1);
kl_tel_pr := substr(str,1,textpos
(str,'','')-1);
return ''rrrr'';
end;
' language 'plpgsql';
After executing that file (so similar to file.1
but shorter) the function
was created without any errors. I did it again
and it works.
(file2.pl)
-- wywolanie select ia('W^45^34');
drop function insdokument(text);
CREATE FUNCTION insdokument(text) RETURNS int4
AS '
DECLARE
dok_wa dokument.wa%TYPE;
dok_nrk dokument.nrk%TYPE;
dok_rodzaj dokument.rodzaj%TYPE;
dok_seria dokument.seria%TYPE;
dok_numer dokument.numer%TYPE;
dok_uwagi1 dokument.uwagi1%TYPE;
dok_uwagi2 dokument.uwagi2%TYPE;
str text;
dok_serial int4;
begin
str := $1;
dok_wa := substr(str,1,textpos(str,''^'')-
1);
str := substr(str,textpos(str,''^'')+1);
dok_nrk := substr(str,1,textpos
(str,''^'')-1);
str := substr(str,textpos(str,''^'')+1);
dok_rodzaj := substr(str,1,textpos
(str,''^'')-1);
str := substr(str,textpos(str,''^'')+1);
dok_seria := substr(str,1,textpos
(str,''^'')-1);
str := substr(str,textpos(str,''^'')+1);
dok_numer := substr(str,1,textpos
(str,''^'')-1);
str := substr(str,textpos(str,''^'')+1);
dok_uwagi1 := substr(str,1,textpos
(str,''^'')-1);
str := substr(str,textpos(str,''^'')+1);
dok_uwagi2 := substr(str,1,textpos
(str,''^'')-1);
str := substr(str,textpos(str,''^'')+1);
insert into dokument
(wa,nrk,rodzaj,seria,numer,uwagi1,uwagi2) values
(dok_wa,dok_nrk,dok_rodzaj,dok_seria,dok_numer,dok
_uwagi1,dok_uwagi2);
select last_value into dok_serial from
dokument_nr_seq;
return dok_serial;
end;
' language 'plpgsql';
Geocrawler.com - The Knowledge Archive
From | Date | Subject | |
---|---|---|---|
Next Message | Rod Chamberlin | 2000-01-06 15:09:02 | Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL |
Previous Message | The Hermit Hacker | 2000-01-06 13:15:11 | Re: [HACKERS] UdmSearch: tables vs indices ... |