Re: How to implement a value alias or synonym

Поиск
Список
Период
Сортировка
От Carlos Oliva
Тема Re: How to implement a value alias or synonym
Дата
Msg-id C34A4F8A078F5E4285EB8B10FF0DAF3102E9026D@pbsi-sbsxch.PosBus.local
обсуждение исходный текст
Ответ на How to implement a value alias or synonym  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Список pgsql-general

http://www.postgresql.org/message-id/440D446E.7040509@cybertec.at

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Gauthier, Dave
Sent: Wednesday, July 10, 2013 3:49 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] How to implement a value alias or synonym

 

Hi:

 

v9.0.1 on linux

 

Is there a way to query on synonyms of a value transparent to the user? 
For example, a column called "animal" can have any text value, including 'horse' and 'cow' and 'pig'.  But I want the user to find all the animal='pig' records if they specify 'hog' instead. 

So..

               select * from thetable where animal = 'pig'

..would generate the same results as...

               select * from thetable where animal = 'hog'

 

There are no 'hog' records in the table, just 'pig' records.  And I want to have control over the synonyms, perhaps in some sort of ref table ?

 

Thanks in Advance for any ideas.




В списке pgsql-general по дате отправления:

Предыдущее
От: "Gauthier, Dave"
Дата:
Сообщение: How to implement a value alias or synonym
Следующее
От: "Carlos Oliva"
Дата:
Сообщение: Re: How to implement a value alias or synonym