Search Postgresql Archives

Re: Perl function leading to out of memory error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 20, 2013 at 9:31 AM, Christian Schröder <cs@xxxxxxxxx> wrote:

> after some investigation it seems that the error has to do with a domain
> type that we have defined in our database. We have defined the following
> helper functions:
>
...
>
> CREATE DOMAIN isin AS char(12) CHECK (isin_ok(value));

Could you give some example values that meet this criteria?  Trying to
reverse engineer your helper functions is no fun.

>
> Now we can create our test case. Create the following table:
>
> CREATE TABLE foo (isin char(12) NOT NULL);
>
> And this function:
>
> CREATE OR REPLACE FUNCTION foo(isin char(12)) RETURNS void AS $$
> my ($isin) = @_;
>
> my $stmt = spi_prepare('
>     INSERT INTO foo (isin)
>     VALUES ($1)', 'isin');
> spi_exec_prepared($stmt, $isin);
> spi_freeplan($stmt);
> $$ LANGUAGE plperl VOLATILE STRICT;

That should be easy enough to re-write as plpgsql.  If you do, does it
still leak?

Cheers,

Jeff


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux