Re: [SQL] ENUM vs DOMAIN vs FKyed loookup table

2009-04-12 Thread Dirk Jagdmann
> When you need to choose between enum types, domain types or lookup tables > with foreign keys, what do you usualy choose? When I have a column with valid values that I know when writing my tables and that will *never* change I use an enum. For example a human gender type (and remember that there

Re: Fw: [SQL] ERROR: operator does not exist: date ~~ unknown

2009-04-12 Thread Tom Lane
Rohit Suman writes: > Ya...I simply changed column type to text and it worked. :D > I had requirements where I needed such a functionality. There was no way to > do it any other way... You should really, really take a second look at those "requirements". Applying a textual pattern match to a dat

Fw: [SQL] ERROR: operator does not exist: date ~~ unknown

2009-04-12 Thread Rohit Suman
Ya...I simply changed column type to text and it worked. :D I had requirements where I needed such a functionality. There was no way to do it any other way... Thanks man - Forwarded Message From: Pavel Stehule To: Rohit Suman Cc: pgsql-sql@postgresql.org Sent: Sunday, 12 April, 200

Re: [SQL] ERROR: operator does not exist: date ~~ unknown

2009-04-12 Thread Pavel Stehule
Hello it means - there are not operator LIKE for datatype date. Why do you do it? Try to look on date_part or extract functions. Fast solution, bot not optimal, is cast date to text via function to_char(date, 'mask') regards Pavel Stehule 2009/4/12 Rohit Suman : > Hi > > I've a table bins in w