Re: plpgsql merge func question

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: plpgsql merge func question
Date: 2013-12-20 12:42:33
Message-ID: 20131220124233.GA28530@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Matthias Leopold <matthias(at)aic(dot)at> wrote:

> hi,
>
> i tried to write a merge function in plpgsql, which is derived from the
> example in the docs (Example 38-2 in
> http://www.postgresql.org/docs/8.4/static/plpgsql-control-structures.html)
> Code is below. This works fine as long as entries in count_table have
> todays date in "datum". when i have older entries the function "locks
> up" (doesn't return, server has 100% cpu). i'm a plpgsql novice. can
> someone explain why this happens? related question: i didn't find a way

Can't reproduce, works for me.

> to log queries that happen inside functions. is this possible?
>
> postgres version is 8.4.17

You should update, i'm using 9.3, it's possible with
http://www.postgresql.org/docs/9.3/interactive/auto-explain.html and
set auto_explain.log_nested_statements = on;

I don't know if 8.3 contains auto-explain.

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Алексей Кузнецов 2013-12-20 12:58:36 Strange number of rows in plan cost
Previous Message Matthias Leopold 2013-12-20 12:23:05 plpgsql merge func question