Hi
I use Postgresql 7.1.1 compiled on a P3 running slackware 7.1 with
glibc-2.2.1 make-3.79.1 and gxx-2.95.2 and others dev tools upgraded if
needed ask me for more.
I create this function:
DROP FUNCTION inserisci(int4,int4,char(1));
CREATE FUNCTION inserisci(int4,int4,char(1)) RETURNS int4 AS '
DECLARE
or ALIAS FOR $1;
gn ALIAS FOR $2;
gl ALIAS FOR $3;
temp int4;
riga fr_tab_conv1%ROWTYPE;
BEGIN
FOR riga IN SELECT * FROM fr_tab_conv1 WHERE ordre >= or AND gnum = gn AND
glettre = gl ORDER BY ordre DESC LOOP
temp := riga.ordre +1;
UPDATE fr_tab_conv1 SET ordre = temp WHERE gnum=gn AND glettre=gl AND
ordre=riga.ordre ;
END LOOP;
return 0;
END;
' language 'plpgsql';
for this table
fiscal=# \d fr_tab_conv1
Table "fr_tab_conv1"
Attribute | Type | Modifier
-----------+--------------+----------
gnum | integer | not null
glettre | character(1) | not null
ordre | integer | not null
txt | text |
Index: fr_tab_conv1_pkey
everything work fine if the query"FOR riga IN SELECT * FROM fr_tab_conv1
WHERE ordre >= or AND gnum = gn AND glettre = gl ORDER BY ordre DESC LOOP"
return something.... if not:
fiscal=# SELECT inserisci(2,1,'A');
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Server process (pid
1547) exited with status 11 at Tue May 29 23:02:33 2001
Terminating any active server processes...
Server processes were terminated at Tue May 29 23:02:33 2001
Reinitializing shared memory and semaphores
DEBUG: database system was interrupted at 2001-05-29 23:01:47
DEBUG: CheckPoint record at (0, 4144380)
DEBUG: Redo record at (0, 4144380); Undo record at (0, 0); Shutdown FALSE
DEBUG: NextTransactionId: 1554; NextOid: 36441
DEBUG: database system was not properly shut down; automatic recovery in
progress...
DEBUG: redo starts at (0, 4144444)
The Data Base System is starting up
Failed.
!# DEBUG: ReadRecord: record with zero len at (0, 4170876)
DEBUG: redo done at (0, 4170840)
DEBUG: database system is in production state
.......
Great program hopping I'm helping improving it.
bye
--
"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)