pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to make update statement to work
2+ messages / 2 participants
[nested] [flat]
* How to make update statement to work
@ 2005-03-26 15:13 Andrus Moor <nospameetasoftnospam@online.ee>
0 siblings, 1 reply; 2+ messages in thread
From: Andrus Moor @ 2005-03-26 15:13 UTC (permalink / raw)
To: pgsql-sql
I want to nullify fields which does not exist in reference table.
I tried
UPDATE demo.toode
SET "liik"=NULL, "grupp"=NULL
WHERE ("grupp", "liik") NOT IN
(SELECT ("grupp", "liik") FROM "artliik")
but this causes error:
ERROR: operator does not exist: character = record
HINT: No operator matches the given name and argument type(s). You may need
to add explicit type casts.
How to write this UPDATE statement properly ?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: How to make update statement to work
@ 2005-03-27 07:57 Tom Lane <tgl@sss.pgh.pa.us>
parent: Andrus Moor <nospameetasoftnospam@online.ee>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2005-03-27 07:57 UTC (permalink / raw)
To: Andrus Moor <nospameetasoftnospam@online.ee>; +Cc: pgsql-sql
"Andrus Moor" <nospameetasoftnospam@online.ee> writes:
> UPDATE demo.toode
> SET "liik"=NULL, "grupp"=NULL
> WHERE ("grupp", "liik") NOT IN
> (SELECT ("grupp", "liik") FROM "artliik")
> ERROR: operator does not exist: character = record
> How to write this UPDATE statement properly ?
Hmm ... Postgres wants it without the innermost parentheses:
(SELECT "grupp", "liik" FROM "artliik")
Offhand though I am not certain whether the way you wrote it is supposed
to be allowed according to the SQL spec. Does anyone think this should
have worked, and if so what's the chapter and verse that says so?
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-03-27 07:57 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-26 15:13 How to make update statement to work Andrus Moor <nospameetasoftnospam@online.ee>
2005-03-27 07:57 ` Tom Lane <tgl@sss.pgh.pa.us>
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