Re: Does this table exist?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
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 20:55:29
Message-ID: Pine.BSF.4.10.10011021251170.77024-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Well, you can do
select * from pg_class where relname='<name>'
which will tell you if there's a view/table/index
with that name.

Stephan Szabo
sszabo(at)bigpanda(dot)com

On Thu, 2 Nov 2000, Alvaro Herrera wrote:

> Hi
>
> I'm Alvaro Herrera, from Chile, South America, where I study CS
> (mostly). I'm new to PostgreSQL and to SQL in general.
>
> That's for my introduction.
>
> Now, I'm building a database to hold customer data that needs to be
> organized in a one-table-per-customer manner. No, I don't think there's
> another way to do this, as these tables are potentially very big not in
> the sense that I have too many customers, but in that I need to hold
> very large amounts of data for each.
>
> Now, the question is: Is there a way to know if a given table exist?
> Besides doing a direct query to it, of course, as I think that would be
> too much of a dinamite-fishing way of doing it.
>
> Thanks in advance, and excuse my poor english if it offends you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ashley Clark 2000-11-02 21:01:45 Re: Does this table exist?
Previous Message Alvaro Herrera 2000-11-02 20:44:48 Does this table exist?