Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 54412634507 for ; Fri, 11 Jun 2010 09:51:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 35122-01 for ; Fri, 11 Jun 2010 12:51:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail2.topex.ro (mail2.topex.ro [82.137.49.134]) by mail.postgresql.org (Postfix) with ESMTP id 7EEEF6338CF for ; Fri, 11 Jun 2010 09:51:28 -0300 (ADT) Received: from mail2.topex.ro ([172.27.168.99]) by topex.ro with MailEnable ESMTP; Fri, 11 Jun 2010 15:51:31 +0300 X-ASG-Debug-ID: 1276260683-039a25260001-ysJW5H Received: from vr.localnet (89-38-174-194.volio.ro [89.38.174.194]) by mail2.topex.ro with ESMTP id ycg2lm9teC1q5o24 for ; Fri, 11 Jun 2010 15:51:24 +0300 (EEST) X-Barracuda-Envelope-From: robert.voinea@topex.ro X-Barracuda-AUTH-User: robert.voinea X-ASG-Whitelist: Client From: Robert Voinea Organization: Topex To: pgsql-admin@postgresql.org X-ASG-Orig-Subj: Server crash when using dblink_build_sql_* after alter table Subject: Server crash when using dblink_build_sql_* after alter table Date: Fri, 11 Jun 2010 15:51:23 +0300 User-Agent: KMail/1.13.2 (Linux/2.6.32-22-generic; KDE/4.4.2; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201006111551.23382.robert.voinea@topex.ro> X-Barracuda-Connect: 89-38-174-194.volio.ro[89.38.174.194] X-Barracuda-Start-Time: 1276260683 X-Barracuda-URL: http://172.27.168.99:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at topex.ro X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.56 tagged_above=-10 required=5 tests=BAYES_50=0.8, RCVD_IN_SORBS_WEB=0.77, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: * X-Archive-Number: 201006/96 X-Sequence-Number: 34874 Hi I have the following issue: I have a development database that is altered a lot and a set of functions that make use of dblink_build_sql_*. The problem is that after I update a table whenever I use a function that makes use of dblink_build_sql the server crashes. The ALTER TABLE sequences usually add columns and do not drop any. This does not happen on every table, just now and then. This is what I get when running dblink_build_sql_update on a table (channelstable). I must mention that all id's exist in the table... except for id=2 that does not exist and dblink reports it as inexistent. I must say that this happens on more than one table. All tables have a single field primary key. The alter table sequence does not affect the primary key. Any ideas?... Thanks in advance. Command log follows: radu database # cat softswitch_interface.sql | grep dblink_build_sql_update | grep 'ChannelsTable'; q := q || dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[i.pkey::TEXT], ARRAY[i.pkey::TEXT]); q := q || dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[i.pkey::TEXT], ARRAY[i.pkey::TEXT]); radu database # psql -U softswitch psql (8.4.2) Type "help" for help. softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[1::TEXT], ARRAY[1::TEXT]); ERROR: could not open relation with OID 0 softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[2::TEXT], ARRAY[2::TEXT]); ERROR: source row not found softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[4::TEXT], ARRAY[4::TEXT]); softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. radu database # psql -U softswitch psql (8.4.2) Type "help" for help. softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); ERROR: invalid memory alloc request size 4294967293 softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); ERROR: invalid memory alloc request size 4294967293 softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); ERROR: invalid memory alloc request size 4294967293 softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); ERROR: invalid memory alloc request size 4294967293 softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); ERROR: invalid memory alloc request size 4294967293 softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); ERROR: invalid memory alloc request size 4294967293 softswitch=> SELECT * FROM dblink_build_sql_update('ChannelsTable', '1', 1, ARRAY[5::TEXT], ARRAY[5::TEXT]); ERROR: invalid memory alloc request size 4294967293 -- Robert Voinea Software Developer Phone: +40 21 408 38 00 / ext. 343 Fax: +40 21 408 38 08 Local time: GMT+2 http://www.topex.ro