How to use one function which can be accessed for all schemas

Поиск
Список
Период
Сортировка
От Wetmore, Matthew (CTR)
Тема How to use one function which can be accessed for all schemas
Дата
Msg-id 5d61c61ce2574b969895d5a4b6ba2602@express-scripts.com
обсуждение исходный текст
Ответ на How to use one function which can be accessed for all schemas  (intmail01 <intmail01@gmail.com>)
Ответы Re: How to use one function which can be accessed for all schemas
Список pgsql-sql

Schema qualify your function and trigger names.  Schema qualify everything, it’s good practice and doesn’t need to rely on search_path.

This error say exactly that.

 

CREATE FUNCTION test(…

 

CREATE FUNCTION myschema.test(

 

From: intmail01 <intmail01@gmail.com>
Sent: Tuesday, January 9, 2024 12:15 AM
To: pgsql-sql@lists.postgresql.org
Subject: [EXTERNAL] How to use one function which can be accessed for all schemas

 

Hi,

 

I have several schemas in my database, I want to create just one function to use with all these schema.

I create the function in a main schema then the trigger call the function and error occurs : "No function matches the given name and argument types. You might need to add explicit type casts."

 

How to use just one function which can  be work amongst all shemas in the db ?

My objective is to reduce update of functions code just once not for many schemas. I dont want to duplicate my functions for each schema.

 

Thanks

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to use one function which can be accessed for all schemas
Следующее
От: Bindra Bambharoliya
Дата:
Сообщение: Re: How to use one function which can be accessed for all schemas