Re: CREATE TABLE with a name derived from a string

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE TABLE with a name derived from a string
Date: 2003-02-15 17:22:23
Message-ID: 873cmpihm8.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

JSavage(at)data-mate(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2003-02-15 17:28:10 Re: Why must SELECT DISTINCT, ORDER BY expressions must appear in target list?
Previous Message Raymond O'Donnell 2003-02-15 16:22:08 Re: Postgres Windows ADO help needed