Re: design/copying a bunch of records - Mailing list pgsql-novice

From Josh Berkus
Subject Re: design/copying a bunch of records
Date
Msg-id 200307231128.07025.josh@agliodbs.com
Whole thread Raw
In response to design/copying a bunch of records  (M Spreij <nemo@mechintosh.com>)
Responses Re: design/copying a bunch of records  (M Spreij <nemo@mechintosh.com>)
List pgsql-novice
Martin,

>    So I figured the best way was to copy the records from the
> admin-set to user-sets (but suggestions for other ways are very
> welcome!), and was wondering if there is a 'good' way to copy about
> 50 records to different tables every time you add a user account -
> the only way I can think of is write some loops in PHP. Better ways?
> TIA!

Yes ... the better way is to just have all products in one big table with a
column to indicate what user they belong to.   And then to modify the PHP
query for each user so that it always includes both his and the admin's
products.  The same approach should be used with other "user specific"
tables.

--
Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-novice by date:

Previous
From: M Spreij
Date:
Subject: design/copying a bunch of records
Next
From: "Clyde Wright"
Date:
Subject: psql and jdbc insert discrepencies