Skip site navigation (1) Skip section navigation (2)

Re: Persistent user-defined functions

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: David T <intrepid__x(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Persistent user-defined functions
Date: 2008-03-28 08:03:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Thu, Mar 27, 2008 at 11:10:39PM -0400, David T wrote:
> Anyway - I would like these new functions to be permanently available
> to a database, or to all databases.  These functions will ultimately
> be called from PHP, where there is no guarantee of server state in
> between requests (maybe a reboot occurs and my functions are lost,
> etc...).  On the other hand, it is inefficient to "CREATE OR REPLACE"
> all the time.  Can anybody suggest a lightweight method to keep these
> functions permanently available, or point me towards a resource that
> might assist?

Once you have created a function in a database, it stays until you drop
it. No crash will lose it for example. You will have to do the creation
once for each database and if you create them in template1 they will
automatically appear whenever you create a new database.

Have a nice day,
Martijn van Oosterhout   <kleptog(at)svana(dot)org>
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

In response to

pgsql-general by date

Next:From: josep porresDate: 2008-03-28 08:16:34
Subject: PL/pgSQL Documentation, biblio, etc
Previous:From: ashishDate: 2008-03-28 07:48:07
Subject: Re: Need help on how to backup a table

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group