From: | Jeff Janes <jeff(dot)janes(at)gmail(dot)com> |
---|---|
To: | Christian Schröder <cs(at)deriva(dot)de> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Perl function leading to out of memory error |
Date: | 2013-02-21 00:02:58 |
Message-ID: | CAMkU=1w1hHLOLHkNcDUN12QU3nUY9tQ6x6=LTAZfA-8623RzUw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Feb 20, 2013 at 9:31 AM, Christian Schröder <cs(at)deriva(dot)de> 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
From | Date | Subject | |
---|---|---|---|
Next Message | Kirk Wythers | 2013-02-21 00:19:34 | Re: PostgreSQL took over my login |
Previous Message | Sergey Konoplev | 2013-02-21 00:02:04 | Re: PgBouncer with many databases |