Adding missing FROM-clause entry in subquery

Поиск
Список
Период
Сортировка
От
Тема Adding missing FROM-clause entry in subquery
Дата
Msg-id 64565.216.238.112.88.1065099510.squirrel@$HOSTNAME
обсуждение исходный текст
Ответы Re: Adding missing FROM-clause entry in subquery
Список 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




В списке pgsql-general по дате отправления:

Предыдущее
От: Howard Lowndes
Дата:
Сообщение: Re: BLOBs, pg_dump & pg_restore
Следующее
От: Petr Bravenec
Дата:
Сообщение: return next in recursive function