pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Wei Weng <wweng@kencast.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: question on UPDATE TABLE
Date: Fri, 23 Aug 2002 12:51:40 -0700 (PDT)
Message-ID: <20020823124920.H23447-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <1030130205.29121.8.camel@Monet>

On 23 Aug 2002, Wei Weng wrote:

> I have this query
>
> UPDATE ONLY ContentSummaries
> SET AccessID = '685d96de-1d09-11b2-beec-0001031d54ce'
> FROM Categories AS cat, ContentTypes AS ct, ContentSummaries AS cs LEFT
> OUTER JOIN Publishers AS pb ON (pb.PublisherID = cs.PublisherID)
> WHERE cs.CreationDate IS NOT NULL AND cat.CategoryID = cs.CategoryID AND
> ct.ContentTypeID = cs.ContentTypeID AND cat.CategoryID =
> '391b11d0-1d09-11b2-a312-0001031d54ce'

You do realize you're getting two copies of ContentSummaries in this
update and only one is actually being constrained afaics (and it's not the
one being updated).  Perhaps something like
cs.ContentTypeID=ContentSummaries.ContentTypeID or something like that
in the where clause?





view thread (3+ messages)  latest in thread

Message-ID: <20020823124920.H23447-100000@megazone23.bigpanda.com>
Permalink:  ../20020823124920.H23447-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020823124920.H23447-100000@megazone23.bigpanda.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, wweng@kencast.com
  Subject: Re: question on UPDATE TABLE
  In-Reply-To: <20020823124920.H23447-100000@megazone23.bigpanda.com>

* 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