psql - add special variable to reflect the last query status

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема psql - add special variable to reflect the last query status
Дата
Msg-id alpine.DEB.2.20.1704042158020.12290@lancre
обсуждение исходный текст
Ответы Re: psql - add special variable to reflect the last query status
Список pgsql-hackers
After some discussions about what could be useful since psql scripts now 
accepts tests, this patch sets a few variables which can be used by psql 
after a "front door" (i.e. actually typed by the user) query:

  - RESULT_STATUS: the status of the query
  - ERROR: whether the query failed
  - ERROR_MESSAGE: ...
  - ROW_COUNT: #rows affected

  SELECT * FROM ;
  \if :ERROR
    \echo oops
    \q
  \endif

I'm not sure that the names are right. Maybe STATUS would be better than 
RESULT_STATUS.

-- 
Fabien.
Вложения

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

Предыдущее
От: David Steele
Дата:
Сообщение: Re: Re: PATCH: pageinspect / add page_checksum andbt_page_items(bytea)
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Parallel Append implementation