Re: how to search for relation by name? - Mailing list pgsql-general

From DM
Subject Re: how to search for relation by name?
Date
Msg-id eae6a62a0904221514m10513b07jf5e9b7047447e2a7@mail.gmail.com
Whole thread Raw
In response to how to search for relation by name?  (zach cruise <zachc1980@gmail.com>)
Responses Re: how to search for relation by name?
List pgsql-general
Here is the sql

SELECT c.oid,
  n.nspname,
  c.relname
FROM pg_catalog.pg_class c
     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relname LIKE ('%dt%')
  AND pg_catalog.pg_table_is_visible(c.oid)

replace dt with your sequence name

pg_catalog has the information.

Thanks
Deepak


On Wed, Apr 22, 2009 at 2:36 PM, zach cruise <zachc1980@gmail.com> wrote:
when i try to copy database (into another database), i get "relation
does not exist" errors for 'super objects' like sequences. (that is
fine since i am using pg_dump, not pg_dumpall) but there is one
relation i can't find to recreate in the new database.

how can i search database for relation by name (some catalog table)?

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: zach cruise
Date:
Subject: how to search for relation by name?
Next
From: Erik Jones
Date:
Subject: Re: Yet another "drop table vs delete" question