Thread: Postgres crash during Stored procedure execution

Postgres crash during Stored procedure execution

From
Jayashankar K B
Date:

Hi,

 

We are facing one database crash issue because of stored procedures.

 

When the stored procedure with a set of values is executed the first time, it works fine.

If the same stored procedure is executed with same set of values once more, the database crashes with the error

 

WARNING:  terminating connection because of crash of another server process

DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.

HINT:  In a moment you should be able to reconnect to the database and repeat your command.

 

This is what we have in the stored procedure:

SELECT * FROM TEST(1, 1)

Two values are being passed to the stored procedure.

First one is just a number and second value is an ID which has foreign key constraint.

 

Because of the foreign key constraint, the foreign key violation error is expected. But why should the server crash because of this violation? 

 

Please let me know what we are missing.

 

Thanks and Regards

Jayashankar

Larsen & Toubro Limited

www.larsentoubro.com

This Email may contain confidential or privileged information for the intended recipient (s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.

 

Re: Postgres crash during Stored procedure execution

From
Pavel Stehule
Date:
Hello

probably you don't use memory well.

Can you show source code? Do you use PostgreSQL with asserts?

Regards

Pavel

2012/6/5 Jayashankar K B <Jayashankar.KB@lnties.com>:
> Hi,
>
>
>
> We are facing one database crash issue because of stored procedures.
>
>
>
> When the stored procedure with a set of values is executed the first time,
> it works fine.
>
> If the same stored procedure is executed with same set of values once more,
> the database crashes with the error
>
>
>
> WARNING:  terminating connection because of crash of another server process
>
> DETAIL:  The postmaster has commanded this server process to roll back the
> current transaction and exit, because another server process exited
> abnormally and possibly corrupted shared memory.
>
> HINT:  In a moment you should be able to reconnect to the database and
> repeat your command.
>
>
>
> This is what we have in the stored procedure:
>
> SELECT * FROM TEST(1, 1)
>
> Two values are being passed to the stored procedure.
>
> First one is just a number and second value is an ID which has foreign key
> constraint.
>
>
>
> Because of the foreign key constraint, the foreign key violation error is
> expected. But why should the server crash because of this violation?
>
>
>
> Please let me know what we are missing.
>
>
>
> Thanks and Regards
>
> Jayashankar
>
> Larsen & Toubro Limited
>
> www.larsentoubro.com
>
> This Email may contain confidential or privileged information for the
> intended recipient (s). If you are not the intended recipient, please do not
> use or disseminate the information, notify the sender and delete it from
> your system.
>
>