Re: stack depth limit exceeded - patch possible?

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Alexander Wöhrer <woehrer(at)par(dot)univie(dot)ac(dot)at>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: stack depth limit exceeded - patch possible?
Date: 2008-04-12 19:16:14
Message-ID: 874pa6evep.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Alexander Wöhrer <woehrer(at)par(dot)univie(dot)ac(dot)at> writes:

> by Thomas Hallgren where he mentioned that PostGre only defines
> one stack and therefor pl/java has no way of telling PostGre
> about multiple thread stack pointers.
>
> As far as I understand the situation, the check_stack_depth()
> is used "just" to provide better stability/security?

That's only going to be the tip of the iceberg. None of the Postgres internal
functions are thread-safe, they don't lock any internal data structures except
those shared with other backends.

If you're going to use Postgres internal API functions then you only have any
hope of doing so from a single thread. And even then people have run into some
problems.

You might look into PL/J which IIUC runs the java stack in a second process
rather than in the server process. Or you could run PL/Java but have it
communicate with your application over a socket, you could send whole
serialized objects over.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-04-12 20:10:32 Re: Index AM change proposals, redux
Previous Message Alexander Wöhrer 2008-04-12 18:56:13 stack depth limit exceeded - patch possible?