pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #12950: Update problem
2+ messages / 2 participants
[nested] [flat]

* BUG #12950: Update problem
@ 2015-04-02 20:36  robert.uradin@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: robert.uradin@gmail.com @ 2015-04-02 20:36 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      12950
Logged by:          Robert
Email address:      robert.uradin@gmail.com
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


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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #12950: Update problem
@ 2015-04-03 20:35  David G. Johnston <david.g.johnston@gmail.com>
  parent: robert.uradin@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2015-04-03 20:35 UTC (permalink / raw)
  To: robert.uradin@gmail.com <robert.uradin@gmail.com>; +Cc: pgsql-bugs

On Thursday, April 2, 2015, <robert.uradin@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      12950
> Logged by:          Robert
> Email address:      robert.uradin@gmail.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.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-04-03 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 20:36 BUG #12950: Update problem robert.uradin@gmail.com
2015-04-03 20:35 ` David G. Johnston <david.g.johnston@gmail.com>

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