Re: building a row with a plpgsql function - Mailing list pgsql-novice

From Michael Kleiser
Subject Re: building a row with a plpgsql function
Date
Msg-id 4188E061.4090005@webde-ag.de
Whole thread Raw
In response to building a row with a plpgsql function  (Raphael Bauduin <raphael.bauduin@be.easynet.net>)
Responses Re: building a row with a plpgsql function
List pgsql-novice
Raphael Bauduin wrote:
> Hi,
>
> We have a table collectiong all details of an item:
> Here is a simplified representation of the tables
> Tables:
>
> items
> ------
> item_id
>
>
> item_details
> ------------
> item_detail_id
> item_id
> item_detail_name
> item_detail_value
>
>
> That way, we can easily have a variable number of detail for the items
> (some can have 10 details, some only one).

Be carefull: With this design, you can't declare any indexes
and constraints on an item-detail !
You also can't use different types for the item-details.
Triggers would be more complicated.

Consider to make the item-details to table-columns.




pgsql-novice by date:

Previous
From: Raphael Bauduin
Date:
Subject: building a row with a plpgsql function
Next
From: Raphael Bauduin
Date:
Subject: Re: building a row with a plpgsql function