From: Georg H. <georg-h@silentrunner.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: short sql question
Date: Fri, 18 Jun 2021 13:31:19 +0200
Message-ID: <36242505-b312-d4ec-3331-fac467d1ddf4@silentrunner.de> (raw)
In-Reply-To: <wolfgang-1210618091529.A0132500@linux-tuxedo>
References: <wolfgang-1210618091529.A0132500@linux-tuxedo>
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 gotERROR: 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
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-general@postgresql.org
Cc: georg-h@silentrunner.de
Subject: Re: short sql question
In-Reply-To: <36242505-b312-d4ec-3331-fac467d1ddf4@silentrunner.de>
References: <wolfgang-1210618091529.A0132500@linux-tuxedo> <36242505-b312-d4ec-3331-fac467d1ddf4@silentrunner.de>
* 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