Re: [HACKERS] PERFORM effects FOUND patch (Was: I must be

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] PERFORM effects FOUND patch (Was: I must be
Дата
Msg-id 2000.1024960465@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] PERFORM effects FOUND patch (Was: I must be  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> Jan Wieck <JanWieck@Yahoo.com> writes:
>> Perform has nothing to do with ORACLE. It was added because people tried
>> to call other "procedures" and didn't want any result back.

> Well, in that case we can do what we want with it.

> Does anyone object to making it set FOUND?

Given the lack of objection, I have committed the attached patch for 7.3,
along with a suitable documentation update.

            regards, tom lane

*** src/pl/plpgsql/src/pl_exec.c.orig    Mon Mar 25 02:41:10 2002
--- src/pl/plpgsql/src/pl_exec.c    Mon Jun 24 18:23:11 2002
***************
*** 969,977 ****
      else
      {
          /*
!          * PERFORM: evaluate query and discard result.    This cannot share
!          * code with the assignment case since we do not wish to
!          * constraint the discarded result to be only one row/column.
           */
          int            rc;

--- 969,979 ----
      else
      {
          /*
!          * PERFORM: evaluate query and discard result (but set FOUND
!          * depending on whether at least one row was returned).
!          *
!          * This cannot share code with the assignment case since we do not
!          * wish to constrain the discarded result to be only one row/column.
           */
          int            rc;

***************
*** 984,989 ****
--- 986,993 ----
          rc = exec_run_select(estate, expr, 0, NULL);
          if (rc != SPI_OK_SELECT)
              elog(ERROR, "query \"%s\" didn't return data", expr->query);
+
+         exec_set_found(estate, (estate->eval_processed != 0));

          exec_eval_cleanup(estate);
      }



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

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: calling a plpgsql procedure
Следующее
От: Dan Weston
Дата:
Сообщение: Re: Need help on index!!!