From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Alvaro Herrera <alvherre(at)protecne(dot)cl> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Does this table exist? |
Date: | 2000-11-02 21:40:22 |
Message-ID: | 26999.973201222@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Alvaro Herrera <alvherre(at)protecne(dot)cl> writes:
> Now, the question is: Is there a way to know if a given table exist?
Several people pointed out that you can easily do that by fishing around
in the system catalogs, but that seems like a bad solution to me. How
will you distinguish the tables that correspond to customers from the
other tables that are hanging around your database?
Seems like a better approach is to make an additional table that lists
all the customers and the names of their dedicated tables. I won't
argue with you about whether you really need a dedicated table for the
bulky per-customer info, but surely there are a lot of smaller per-
customer items --- name, address, phone, that sort of thing --- that
are most reasonably kept in a master table. Just add a column for the
name of the bulky table.
Also, you might want to think about making all these per-customer tables
be inheritance children of a single prototype table.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Aggarwal , Ajay | 2000-11-02 22:32:12 | question on SELECT using LIKE |
Previous Message | Norman Clarke | 2000-11-02 21:34:12 | Re: Speed issues with update |