Re: Wishlist?

From: Ezequiel Tolnay <mail(at)etolnay(dot)com(dot)ar>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Wishlist?
Date: 2005-07-25 01:44:04
Message-ID: dc1g0b$uil$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ezequiel Tolnay 2005-07-25 02:00:14 Re: Wishlist?
Previous Message Ezequiel Tolnay 2005-07-25 01:35:14 Re: Wishlist?