Re: Can column name aliases be supported?

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can column name aliases be supported?
Date: 2012-08-23 14:19:05
Message-ID: 0AD01C53605506449BA127FB8B99E5E11802BF4E@FMSMSX105.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Updateable views. This is great. I didn't know about these. Absolutely delicious !
I found a great example here... http://vibhorkumar.wordpress.com/2011/10/28/instead-of-trigger/

The problem of user updating >1 alias remains, but I have no problem bouncing them if they attempt that. Maybe return a "-E- You cannot update multiple aliases of the same base value" (something like that). I'd just have to detect this circumstance, raise the message and bounce (return OLD).

Does this sound doable?

-----Original Message-----
From: Craig Ringer [mailto:ringerc(at)ringerc(dot)id(dot)au]
Sent: Thursday, August 23, 2012 9:52 AM
To: Gauthier, Dave
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Can column name aliases be supported?

On 08/23/2012 09:32 PM, Gauthier, Dave wrote:

> The view approach for queries is workable, at least for queries. Thanks for the input on that and the idea to replicate the various aliases in the view!

The key issue with all your approaches is whether the client can ever `UPDATE` the view. If they can, and you duplicate the column under multiple aliases, what happens when they `UPDATE` two of the aliases to different values?

> I too would like to shoot the clients. But as they say, the customer is always right !

Heh, I wouldn't shoot them. Fire the client means:

http://sixrevisions.com/project-management/how-to-fire-bad-clients/

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message javad M 2012-08-23 14:31:43 Cannot Run EnterpriseDB Postgresql Installation
Previous Message Tom Lane 2012-08-23 14:18:28 Re: At what point does a big table start becoming too big?