Re: query for schema existence and create schema in jdbc?

Поиск
Список
Период
Сортировка
От Samuel Gendler
Тема Re: query for schema existence and create schema in jdbc?
Дата
Msg-id AANLkTi=uAUAFg2pY6woKiCLrF24kw-FsJfCqE9kVn1QH@mail.gmail.com
обсуждение исходный текст
Ответ на query for schema existence and create schema in jdbc?  ("Hiller, Dean (Contractor)" <dean.hiller@broadridge.com>)
Список pgsql-jdbc


On Fri, Jan 21, 2011 at 6:14 AM, Hiller, Dean (Contractor) <dean.hiller@broadridge.com> wrote:

I need a way(and don’t care if it is not portable) to

 

1.       Query to see if a schema exists or not

2.       Create the schema if it doesn’t exist

3.       Drop and recreate the schema if it does exist

 

ALL through JDBC.  Is this possible?



run this query, which returns a boolean:

select exists (select * from pg_catalog.pg_namespace where nspname = 'new_schema');

then either execute 'create schema new_schema;' or 'drop schema new_schema cascade; create schema new_schema;'

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

Предыдущее
От: "Hiller, Dean (Contractor)"
Дата:
Сообщение: Re: query for schema existence and create schema in jdbc?
Следующее
От: rsmogura
Дата:
Сообщение: Re: [HACKERS] Fwd: Weird issues when reading UDT from stored function