Re: How can I detect if a schema exists?

From: felix(at)crowfix(dot)com
To: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I detect if a schema exists?
Date: 2013-01-10 00:25:54
Message-ID: 20130110002554.GD17453@crowfix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 10, 2013 at 09:11:59AM +0900, Ian Lawrence Barwick wrote:

> How about:
>
> SELECT TRUE FROM information_schema.schemata WHERE schema_name = 'xyzzy'
>
> ? (Though I notice this table only seems to show the schemas owned by the
> user if the user is not a superuser).

I'll have to play with the users and permissions, but that sounds like
it could be a feature; the code wants to know if the user can use the
schema.

--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix(at)crowfix(dot)com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message yatler sahri 2013-01-10 00:49:25 Re: ..
Previous Message Adrian Klaver 2013-01-10 00:21:33 Re: currval of sequence xxx_seq is not yet defined in this session?