Search Postgresql Archives

Re: Wishlist?

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

 



Roman Neuhauser wrote:
    What would your hassle-free CREATE OR REPLACE do in this situation?
    What should the fiew look like after you replace foo() with
    foo(int4)?

    CREATE TYPE t1 AS (
     a INTEGER,
     b INTEGER,
     c INTEGER
    );
    CREATE TYPE t1 AS (
     a TEXT,
     c TEXT
    );

    CREATE FUNCTION foo() RETURNS SETOF t1 ...

    CREATE VIEW fiew AS SELECT a * b, c FROM SELECT foo();

    CREATE OR REPLACE FUNCTION foo(INTEGER) RETURNS SETOF t2 ...

In this case it would not allow the replace, since the function has both type and interface dependencies and you're changing both the type and the interface.

The idea is to use the NOOVERLOAD feature on functions that would be used as an interface for the front-end, where the addition or modification of a parameter or a result column is quite common, and functions very rarely need or use overloading features.

Please have a look at my reply to the sister thread.

Cheers,

Ezequiel Tolnay

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[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