Search Postgresql Archives

Re: creating a function with another function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 12, 2009 at 3:41 PM, David Fetter <david@xxxxxxxxxx> wrote:
> On Mon, Oct 12, 2009 at 02:12:35PM -0500, Dave Huber wrote:
>> Is it possible to execute a CREATE OR REPLACE FUNCTION with another
>> function or even have a function modify itself?
>
> Yes, but doing any of that is a sign that you're working with a broken
> design.  That, or you're looking to make an entry in the International
> Obfuscated Database Programming Contest ;)

Surely, there are valid cases of having a function create a function.
Suppose (just off the top of my head), you create a helper function
that generates triggers on a table for record archiving.

I agree though that having a function modify itself sounds like
something that is much better done as dynamic sql (inside a function).

merlin

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux