pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Petr Chmelar <chmelarp@fit.vutbr.cz>
To: bricklen <bricklen@gmail.com>
To: pavel.stehule@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8329: UPDATE x SET x.y = x.y + z does not work in PL/pgSQL
Date: Thu, 25 Jul 2013 20:49:59 +0200
Message-ID: <51F17357.2030103@fit.vutbr.cz> (raw)
In-Reply-To: <cy1oxh.mqghb4.2x6c5e-qmf@kazi.fit.vutbr.cz>
References: <E1V20Jm-0002iy-BQ@wrigleys.postgresql.org>
	<CAGrpgQ9HGz=4+17-yt3uRaWHJmBXOHXX9MyfkZcTETgpCahf0g@mail.gmail.com>
	<cy1oxh.mqghb4.2x6c5e-qmf@kazi.fit.vutbr.cz>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Dear Briklen and Pavel,

herewith I attached the weird function and tables dumped, I tried to 
simplify it. See the
XXX THIS IS IT, does not work even when ... + 1000000 XXX
comment in the function, please.

I hope you can reproduce the bug. I also reinstalled the database and 
made some other things, but the function seems not working. I still hope 
this is my mistake but it works for me in the console... :(

Cheers,
Petr

On 24.7.2013 21:40, Petr Chmelar wrote:
>
> Dear Briklen and Pavel,
>
> Yes, the z. is a typo, it should be z.z ... I can send the complete 
> query and tables tomorrow, also I'll try to make it simpler (the 
> function is about 300 lines).
>
> Thanks for the early answers,
>
> Petr
>
>
> Dne 24.07.2013 17:14 napsal uživatel bricklen:
>
> On Wed, Jul 24, 2013 at 7:45 AM, <chmelarp@fit.vutbr.cz 
> <mailto:chmelarp@fit.vutbr.cz>> wrote:
>
>     The following bug has been logged on the website:
>
>     Bug reference:      8329
>     Logged by:          Petr
>     Email address: chmelarp@fit.vutbr.cz <mailto:chmelarp@fit.vutbr.cz>
>     PostgreSQL version: 9.2.4
>     Operating system:   Fedora x64
>     Description:
>
>     Hi there,
>     we have an issue - if I run a query from a console, it runs OK.
>     When it is
>     run using EXECUTE in an PL/pgSQL function, it sets NULL. The simplest
>     version of the query is like this:
>     UPDATE x
>     SET x.y = x.y + z.
>     FROM (SELECT z) as Z
>     WHERE ... ;
>
>
>     If I don't use the "+" in the SET command, it works OK. The whle
>     query is
>     quite complex, but OK in a console. If you need the query an
>     tables..., mail
>     me, please. I can't make it public.
>
>
> Can you reduce it to a simpler test case without the details you are 
> not able to show?  Statistically it is more likely there is an error 
> in your plpgsql function than in postgres itself.
> Also, is the "z." a typo, or is there really a dot after the "z"?
>

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

Attachments:

  statistics.2send.sql.tar.bz2 (application/x-bzip, 75.6K) download

view thread (10+ messages)  latest in thread

Message-ID: <51F17357.2030103@fit.vutbr.cz>
Permalink:  ../51F17357.2030103@fit.vutbr.cz/
Also on:    postgresql.org/message-id/51F17357.2030103@fit.vutbr.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: chmelarp@fit.vutbr.cz, bricklen@gmail.com, pavel.stehule@gmail.com
  Subject: Re: BUG #8329: UPDATE x SET x.y = x.y + z does not work in PL/pgSQL
  In-Reply-To: <51F17357.2030103@fit.vutbr.cz>
  References: <E1V20Jm-0002iy-BQ@wrigleys.postgresql.org> <CAGrpgQ9HGz=4+17-yt3uRaWHJmBXOHXX9MyfkZcTETgpCahf0g@mail.gmail.com> <cy1oxh.mqghb4.2x6c5e-qmf@kazi.fit.vutbr.cz> <51F17357.2030103@fit.vutbr.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox