X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 08AC03A5F4B for ; Thu, 27 Jan 2005 17:44:08 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 89743-01 for ; Thu, 27 Jan 2005 17:43:57 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.198]) by svr1.postgresql.org (Postfix) with ESMTP id AA3193A5DA4 for ; Thu, 27 Jan 2005 17:43:56 +0000 (GMT) Received: by wproxy.gmail.com with SMTP id 40so277893wri for ; Thu, 27 Jan 2005 09:43:56 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=dR+pqYiNknWQqBe9JGCimnH1yQd4tDyqXPNzJ8t6uh7LeeIHb5UghCF7hpcn+jYXSiqYXW5AORaUhluWB2fKtBgfli5FIinWjksTaMqab3HboHPFIb1NLWlgCpXP+F+gWCubtq0qwfhTnrfmXNMxRzs50RnNkOkJSD9mYAet4Hk= Received: by 10.54.20.25 with SMTP id 25mr88252wrt; Thu, 27 Jan 2005 09:43:56 -0800 (PST) Received: by 10.54.20.47 with HTTP; Thu, 27 Jan 2005 09:43:56 -0800 (PST) Message-ID: <1dc7f0e30501270943683ced12@mail.gmail.com> Date: Thu, 27 Jan 2005 12:43:56 -0500 From: Alexandre Leclerc Reply-To: Alexandre Leclerc To: Dawid Kuroczko Subject: Re: Flattening a kind of 'dynamic' table Cc: PERFORM In-Reply-To: <758d5e7f050127082755f9af12@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1dc7f0e305012707234159cfc8@mail.gmail.com> <758d5e7f050127082755f9af12@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.024 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200501/548 X-Sequence-Number: 10238 On Thu, 27 Jan 2005 17:27:40 +0100, Dawid Kuroczko wrote: > On Thu, 27 Jan 2005 10:23:34 -0500, Alexandre Leclerc > wrote: > > Here a normal listing of design.product_department_time: > > product_id | department_id | req_time > > ------------+---------------+---------- > > 906 | A | 3000 > > 906 | C | 3000 > > 906 | D | 1935 > > 907 | A | 1500 > > 907 | C | 1500 > > 907 | D | 4575 > > 924 | A | 6000 > > 924 | C | 1575 > > Well, I did something like this recently; it can be done though > maybe not very efficiently... > > Unfortunately we will need a rowtype with all the departaments: > CREATE DOMAIN departaments AS (a int, b int, c int, d int, ...); Thank you for this help Dawid, I'll have to take some time to look at this suggestion. If I must create a domain with all the departments I'll have a problem because the user is creating and deleting departments as it pleases him. Any counter-ideas? Regards. -- Alexandre Leclerc