Re: BUG #12950: Update problem

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "robert(dot)uradin(at)gmail(dot)com" <robert(dot)uradin(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #12950: Update problem
Date: 2015-04-03 20:35:39
Message-ID: CAKFQuwZUrCxZDR9xT7Nnicz+hRVQzsiPf+KKJzBOts3UEQ2ARg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thursday, April 2, 2015, <robert(dot)uradin(at)gmail(dot)com> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 12950
> Logged by: Robert
> Email address: robert(dot)uradin(at)gmail(dot)com <javascript:;>
> PostgreSQL version: 9.3.6
> Operating system: Win 7
> Description:
>
> not executing like none UPDATE command, colleagues with the same username
> and password entered and executed from another computer without any
> problem,
> can you help me what is the problem, thanks!
>
>
> error:
>
> ERROR: syntax error at or near "set"
> LINE 1: SELECT COUNT(*) AS total FROM (UPDATE belot_user set permane...
> ^
> In statement:
> SELECT COUNT(*) AS total FROM (UPDATE belot_user set permanent_ban=1 where
> fb_last_used_name='Robert Uradin') AS sub
>
>
If you put the UPDATE in a WITH (cte) and add a RETURNING you can make this
work. If your colleague got this to work as written, on PostgreSQL, you
shoud probably ask them what you are doing wrong/different. The update,
especially without returning, is not a valid relation so cannot be placed
in the FROM clause. I'm somewhat surprised the parser made it to the word
set before choking as I would have thought the update would be
rejected...but unlike the sql standard Postgresql has managed to leave
update unreserved.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2015-04-03 21:41:59 Re: src/port/getopt_long.c lossy with arguments having no option characters
Previous Message Peter Eisentraut 2015-04-03 19:47:38 Re: src/port/getopt_long.c lossy with arguments having no option characters