Re: Can column name aliases be supported?

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Bosco Rama <postgres(at)boscorama(dot)com>
Cc: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can column name aliases be supported?
Date: 2012-08-23 02:04:27
Message-ID: 50358FAB.8060908@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/23/2012 06:41 AM, Bosco Rama wrote:
> Ooops! Hit send too fast...
>
> On 08/22/12 15:34, Bosco Rama wrote:
>> On 08/22/12 15:19, Gauthier, Dave wrote:
>>>
>>> I know a view can be used to alias one of them.
>>
>> It can alias all of them:
>>
>> create view xyz as
>> select *, last_name as lname, last_name as surname
>> from mytable;
>>
>> (not the nicest version but functional)
>
> ... and then use an INSTEAD/ALSO rule to do the update, if needed.

... though if the user UPDATEd more then one of them, who knows what'd
happen.

I'd either (a) fire the client, or (b) define different views for
different clients, with appropriate DO INSTEAD triggers (9.1) or rules
(9.0 and below).

(a) would be awfully tempting.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2012-08-23 02:17:16 Re: What text format is this and can I import it into Postgres?
Previous Message Chris Travers 2012-08-23 01:42:31 no null checking/check constraint checking in nested tables: Bug, missing feature, or desired behavior?