Best practice for naming temp table trigger functions

Поиск
Список
Период
Сортировка
От Sebastien Flaesch
Тема Best practice for naming temp table trigger functions
Дата
Msg-id DBAP191MB128959B0FE1ABE28C04ACDFFB0089@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответы Re: Best practice for naming temp table trigger functions  (Sebastien Flaesch <sebastien.flaesch@4js.com>)
Список pgsql-sql
Hello!

Temporary tables can get triggers in PostgreSQL.

Triggers are defined with a trigger function.

A temp table name is local to the current SQL session so there is no conflict with concurrent code doing the same CREATE TEMP TABLE mytable ...

However, user functions called by triggers are global to the schema and can enter in conflict...

What is the best practice, to avoid such issues?

I guess I could use some session id to build a unique function name.

But I would like to have that function dropped when the temp table is destroyed ...

Or, is there a way to define triggers directly with some anonymous code block?

Seb

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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: ERROR: extra data after last expected column
Следующее
От: scott macri
Дата:
Сообщение: Re: ERROR: extra data after last expected column