Re: Wishlist? - Mailing list pgsql-general

From Ezequiel Tolnay
Subject Re: Wishlist?
Date
Msg-id dc1g0b$uil$1@news.hub.org
Whole thread Raw
In response to Re: Wishlist?  (Roman Neuhauser <neuhauser@sigpipe.cz>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Ezequiel Tolnay
Date:
Subject: Re: Wishlist?
Next
From: Jeffrey Cook
Date:
Subject: PGSQL programmer needed!!!