Re: database design questions

From: "hubert depesz lubaczewski" <depesz(at)gmail(dot)com>
To: "Ottavio Campana" <ottavio(at)campana(dot)vi(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: database design questions
Date: 2006-04-04 09:15:57
Message-ID: 9e4684ce0604040215l6bf56a38i34abee6b5a0f4ceb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/3/06, Ottavio Campana <ottavio(at)campana(dot)vi(dot)it> wrote:
>
> 1) The database I'm going to develop is a big list with a catalog of
> items and I want to store subsets of this list representing the
> available items in several places.
> My idea is to create the big table with all the elements and then to
> create another table, where each row holds a pair (id_item, id_place)
> and thanks to this create several views, joining the two tables
> and selecting the rows with a give id_place.
> Do you think it's too heavy? Is there a simpler way to do it?

sorry but i dont understand your description. could you make a small example
of this layout?

2) do you think it's possible in a plpgsql procedure select the name of
> a table into a variable and use that variable in the query?

possible, but not really good way. read about 'execute' in plpgsql.

3) faq 4.11.1 says
> how can I do it with a INT8 instead of a INT4?

use bigserial instead of serial

depesz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2006-04-04 12:08:01 Re: Migrating data from Oracle 9i to PostgreSQL
Previous Message Kai Hessing 2006-04-04 09:13:08 Re: Performance Killer 'IN' ?