Server crash when using dblink_build_sql_* after alter table

From: Robert Voinea <robert(dot)voinea(at)topex(dot)ro>
To: pgsql-admin(at)postgresql(dot)org
Subject: Server crash when using dblink_build_sql_* after alter table
Date: 2010-06-11 12:51:23
Message-ID: 201006111551.23382.robert.voinea@topex.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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 <robert (dot) voinea (at) topex (dot) ro>
Software Developer
Phone: +40 21 408 38 00 / ext. 343
Fax: +40 21 408 38 08
Local time: GMT+2
http://www.topex.ro

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2010-06-11 14:21:28 Re: Server crash when using dblink_build_sql_* after alter table
Previous Message Scott Marlowe 2010-06-11 04:27:03 Re: fsync tests