From: | Andreas <maps(dot)on(at)gmx(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | How to manage category-ids as array-fields ? |
Date: | 2008-06-13 16:02:45 |
Message-ID: | 48529A25.1050808@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi,
I get from an outside source tables as simple textfiles to import.
Those are obviously results of views with joined tables.
Among the normal stuff are columns that have one or a list of id-numbers
devided by a semicolon.
In the next column there is the corresponding text for this ids.
It looks like this:
17, ... , "1; 2;", "cat; mouse;", ...
23, ..., "3;", "dog;", ...
42, ..., "2; 7;", "mouse; horse;", ...
Obviously the meaning is that some entity has those listed attributes.
Most likely they are stored as a n:m-relation like:
17, 1
17, 2
23, 3
42, 2
42, 7
Is there a way to reproduce the output in the form above (as array) ?
Is there a way to import the data in the form above, so it gets neately
stored in a n:m ?
Is it seen as a conceptual good solution to store such information
within a text-column or array?
I'd rather doubt that PG would watch the integrity of those ids then.
From | Date | Subject | |
---|---|---|---|
Next Message | novice | 2008-06-16 01:48:01 | Results with leading zero |
Previous Message | Volkan YAZICI | 2008-06-13 12:31:15 | Re: Create Table Problem |