How to tell which statement is being executed

Поиск
Список
Период
Сортировка
От Garfield Lewis
Тема How to tell which statement is being executed
Дата
Msg-id AM8PR05MB825745F8A78FDB189A3F4AC7E3A5A@AM8PR05MB8257.eurprd05.prod.outlook.com
обсуждение исходный текст
Ответы Re: How to tell which statement is being executed
Список pgsql-general

Hi All,

 

If I create a C function, is there a way from within that function for me to:

 

  1. know whether it is being triggered by an INSERT or UPDATE statement
    1. I’ve done some digging and it seems you can get this information if you provide a Planner hook, however, I need to know this much later in my function not in the Planner
    2. Is there some way for me to get to the PlannedStmt (or anything else that may have the command type) from within my function?
  2. column attribute (specifically the TYPMOD) for the affected column

 

BTW, is there a more appropriate Postgres list/group/blog that is specifically dedicated to these types of programming questions or is it ok to post this here?

 

Regards,

Garfield

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

Предыдущее
От: Philip Semanchuk
Дата:
Сообщение: Re: Local postgres manual
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to tell which statement is being executed