Re: plpgsql merge func question - Mailing list pgsql-novice

From Andreas Kretschmer
Subject Re: plpgsql merge func question
Date
Msg-id 20131220124233.GA28530@tux
Whole thread Raw
In response to plpgsql merge func question  (Matthias Leopold <matthias@aic.at>)
Responses Re: plpgsql merge func question  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-novice
Matthias Leopold <matthias@aic.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°


pgsql-novice by date:

Previous
From: Matthias Leopold
Date:
Subject: plpgsql merge func question
Next
From: Алексей Кузнецов
Date:
Subject: Strange number of rows in plan cost