pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Voinea <robert.voinea@topex.ro>
To: pgsql-admin@postgresql.org
Subject: Server crash when using dblink_build_sql_* after alter table
Date: Fri, 11 Jun 2010 15:51:23 +0300
Message-ID: <201006111551.23382.robert.voinea@topex.ro> (raw)

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




view thread (6+ messages)  latest in thread

Message-ID: <201006111551.23382.robert.voinea@topex.ro>
Permalink:  ../201006111551.23382.robert.voinea@topex.ro/
Also on:    postgresql.org/message-id/201006111551.23382.robert.voinea@topex.ro

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: robert.voinea@topex.ro
  Subject: Re: Server crash when using dblink_build_sql_* after alter table
  In-Reply-To: <201006111551.23382.robert.voinea@topex.ro>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox