FOUND not set by EXECUTE?

Поиск
Список
Период
Сортировка
От David Wheeler
Тема FOUND not set by EXECUTE?
Дата
Msg-id CDE78BFA-F213-412A-82F5-42422BCFF1E6@kineticode.com
обсуждение исходный текст
Ответы Re: FOUND not set by EXECUTE?
Список pgsql-hackers
I had expected the FOUND PL/pgSQL variable to be set by an UPDATE  
statement executed by an EXECUTE statement, but it doesn't appear to  
work:

try=# drop table try;
DROP TABLE
try=# CREATE TABLE try (
try(#   id integer
try(# );
CREATE TABLE
try=# INSERT INTO try VALUES (1);
INSERT 0 1
try=# CREATE OR REPLACE FUNCTION try_me () RETURNS VOID AS $$
try$# DECLARE
try$#   rcount integer;
try$# BEGIN
try$#    EXECUTE 'UPDATE try SET ID = 12';
try$#    RAISE NOTICE 'Found:     %', FOUND;
try$#    GET DIAGNOSTICS rcount = ROW_COUNT;
try$#    RAISE NOTICE 'Row Count: %', rcount;
try$# END;
try$# $$ LANGUAGE plpgsql SECURITY DEFINER;
CREATE FUNCTION
try=# SELECT try_me();
NOTICE:  Found:     f
NOTICE:  Row Count: 1
try_me
--------
(1 row)

Note that FOUND is false, but the ROW_COUNT fetched by GET  
DIAGNOSTICS is set to 1. So shouldn't FOUND be true? Or does it just  
not work with EXECUTE and need to be documented as such? Or am I just  
missing something obvious?

Thanks,

David


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Summer of Code -- mentors needed as well
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Summer of Code -- mentors needed as well