If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > A column (attribute) with differnt domians

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-26-11, 10:23
fcd2suxs fcd2suxs is offline
Registered User
 
Join Date: May 2011
Posts: 7
A column (attribute) with differnt domians

Hello,

I have (let us say) an abject and hypothetically let us say CAR, this object can have attribute and these attributes might have different type domains. for example, the car speed is 200 and the car does not have an airbag

So I can have something like this

Attribute (attribute_id attribute name)
1 speed
2 has air bag
....

and I have

table car_attribute (car_id .., attribute_id.., attribute_value boolean ) or

table car_attribute (car_id .., attribute_id.., attribute_value real ) or

.....

What are the design options and is there is a special features in postgres helps in this design.

Regards
Reply With Quote
  #2 (permalink)  
Old 07-26-11, 10:26
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,408
This is what the hstore module is for.

PostgreSQL: Documentation: Manuals: PostgreSQL 9.0: hstore
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On