Adding missing FROM-clause entry in subquery

From: <btober(at)seaworthysys(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Adding missing FROM-clause entry in subquery
Date: 2003-10-02 12:58:30
Message-ID: 64565.216.238.112.88.1065099510.squirrel@$HOSTNAME
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I run the following script to export some data from my development
database and then update or insert the records into to the quality
assurance testing database, but I get a warning notice that I don't
understand. Aside from that notice, the script appears to work as
intended, i.e., updating existing report definitions and adding any new
ones defined in the dev environment but not appearing in QAT.

Here is the script:

\set ON_ERROR_STOP ON

COPY report TO '/home/postgres/report.sql';

\c paidqat
CREATE TEMPORARY TABLE temptable AS SELECT * FROM report;

DELETE FROM temptable;

COPY temptable FROM '/home/postgres/report.sql';

UPDATE report SET resource = (
SELECT resource FROM temptable s1
WHERE s1.title = report.title)
WHERE EXISTS(SELECT 1 FROM temptable s1
WHERE s1.title = report.title);

INSERT INTO report (
SELECT * FROM temptable s1 EXCEPT
SELECT * FROM report s2 WHERE s2.title = report.title);

The warning notice refers to the last command in the script, i.e., the
INSERT, but inserts do occur successfully as a result.

Here is the run and the resulting notice message:

bash-2.05a$ psql -f urep.sql -U paid paiddev
COPY
You are now connected to database paidqat.
SELECT
DELETE 6
COPY
UPDATE 6
psql:urep.sql:20: NOTICE: Adding missing FROM-clause entry in subquery
for table "report"
INSERT 0 1
bash-2.05a$

~Berend Tober

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Petr Bravenec 2003-10-02 14:05:04 return next in recursive function
Previous Message Fabio Benavides Murillo 2003-10-02 12:49:11 migrate from postgres to mysql