From: | "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> |
---|---|
To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Can column name aliases be supported? |
Date: | 2012-08-23 13:32:12 |
Message-ID: | 0AD01C53605506449BA127FB8B99E5E11802BF0F@FMSMSX105.amr.corp.intel.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks for all the replies !
The real problem has nothing to do with names. I just used that as a vehicle for articulating the problem.
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!
I take it that duplication of the aliases as formal table columns, synched up with a before trigger is a bad idea? Is there any fruit on the end of that branch? (after looking at RULES, I expect only a single dried raisin :-))
Regarding the RULES approach, I've never used RULES before, so please bear with me a bit :-)
My stab at this using the base example...
create rule lastnamealias1
on update PEOPLE.lname
do instead update PEOPLE.last_name;
create rule lastnamealias2
on update PEOPLE.surname
do instead update PEOPLE.last_name;
does that look correct (given that last_name is the actual c olumn name)?
I too would like to shoot the clients. But as they say, the customer is always right !
Thanks Again everyone !
-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Chris Angelico
Sent: Thursday, August 23, 2012 1:23 AM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Can column name aliases be supported?
On Thu, Aug 23, 2012 at 2:19 PM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> wrote:
> On 08/23/2012 11:56 AM, Chris Angelico wrote:
>>
>> Here's an out-of-the-box suggestion.
>>
>> Drop the column altogether and have a single column "name". Trying to
>> divide names up never works properly. Does "surname" mean family name?
>> Not all cultures put the family name last. Is "last_name" simply the
>> part of the name after the last space?
>
> +1 to that, and it gets way worse:
>
> http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-abo
> ut-names/
Yes, that link was posted on python-list a little while back, and that's what I had in mind as I was writing that up. Couldn't remember the actual link though. Thanks!
> and while you're at it, read this:
>
> http://www.joelonsoftware.com/articles/Unicode.html
Definitely. I disagree with Joel Spolsky on many things, but I agree with that post. These days, Unicode is an absolute necessity. Our PHP-based web site has a number of issues with Unicode input, but at least everything that goes through the database (we use Postgres for
everything) is safe.
ChrisA
--
Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
From | Date | Subject | |
---|---|---|---|
Next Message | Bill Moran | 2012-08-23 13:37:26 | Re: At what point does a big table start becoming too big? |
Previous Message | Anthony | 2012-08-23 12:00:07 | Re: Amazon High I/O instances |