Check if table or View exists

Поиск
Список
Период
Сортировка
От Jeff Williams
Тема Check if table or View exists
Дата
Msg-id 18361.203.10.121.80.1207013701.squirrel@webmail-cp6.syra.net.au
обсуждение исходный текст
Ответ на Re: simple update queries take a long time - postgres 8.3.1  (mark <markkicks@gmail.com>)
Ответы Re: Check if table or View exists
Список pgsql-general
I am developing an application where I will have a default table and/or
view for a select statement for my application.  If a client has a special
requirement I would like to have a alternate table of the same name in a
different schema with the change structure.

Schema A
   Default table - coretable.foo

Schema B
   Client specific table client.foo

How can I check if a table or alternate view exists in schema B.

ie

if client.foo exists // check for a view or table
  // my code will use client.foo table
else
  // my code will use coretable.foo
endif

Also is it possible to check via function/via in postgress and not have to
rely on my application to do the check.  If so how.





В списке pgsql-general по дате отправления:

Предыдущее
От: "korry"
Дата:
Сообщение: Re: [HACKERS] Connection to PostgreSQL Using Certificate: Wrong Permissions on Private Key File
Следующее
От: Clemens Schwaighofer
Дата:
Сообщение: Re: Survey: renaming/removing script binaries (createdb, createuser...)