Re: short sql question - Mailing list pgsql-general

From Georg H.
Subject Re: short sql question
Date
Msg-id 36242505-b312-d4ec-3331-fac467d1ddf4@silentrunner.de
Whole thread Raw
In response to short sql question  (goldgraeber-werbetechnik@t-online.de)
List pgsql-general

Hi,

Am 18.06.2021 um 09:15 schrieb goldgraeber-werbetechnik@t-online.de:
Hi,

I just cannot see what is wrong with my query:

create table files (id int, name text, prev_name text, ....);
create table fnchanged (id int, name text);

update files f set prev_name = f.name, name = c.name from fnchanges c where f.id = c.id and c.name != f.name

your update statement works for me after changing

from fnchanges

  to

from fnchanged 
(as written in your create statement) but I've got ERROR:  relation "fnchanges" does not exist 
instead of a syntax error

--- gets syntax error at "from"

(Using PostgreSQL 10.4 on a NAS box)

Best regards
Wolfgang

kind regards
Georg

pgsql-general by date:

Previous
From: goldgraeber-werbetechnik@t-online.de
Date:
Subject: short sql question
Next
From: Paul Jungwirth
Date:
Subject: Re: Temporal tables as part of main release