Search Postgresql Archives

How to implement a value alias or synonym

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux