Re: CREATE TABLE with a name derived from a string - Mailing list pgsql-general

From Greg Stark
Subject Re: CREATE TABLE with a name derived from a string
Date
Msg-id 873cmpihm8.fsf@stark.dyndns.tv
Whole thread Raw
In response to CREATE TABLE with a name derived from a string  (JSavage@data-mate.com (Savage))
List pgsql-general
JSavage@data-mate.com (Savage) writes:

> I am creating a DB for a multi user IM system. Each user can store
> their history. Each user also has a unique ID. There will be many
> users and a lot of history will be generated by each user, so we are
> going to create a history table per user, with a tablename that is
> derived from the unique userid.

As others have mentioned this is a bad idea. A really really bad idea.

On option is to just put userid first in your primary key and use it on all
lookups. That's what indexes are for.

--
greg

pgsql-general by date:

Previous
From: "Raymond O'Donnell"
Date:
Subject: Re: Postgres Windows ADO help needed
Next
From: Greg Stark
Date:
Subject: Re: Why must SELECT DISTINCT, ORDER BY expressions must appear in target list?