Re: Privilege required for IF EXISTS event if the object already exists - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: Privilege required for IF EXISTS event if the object already exists
Date
Msg-id 61BA1B88.9070506@anastigmatix.net
Whole thread Raw
In response to Re: Privilege required for IF EXISTS event if the object already exists  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On 12/15/21 11:10, David G. Johnston wrote:
>>     IF NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'foo') THEN

Orthogonally to any other comments,

IF pg_catalog.to_regnamespace('foo') IS NULL THEN

might be tidier, if you don't need to support PG < 9.5.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: speed up text_position() for utf-8
Next
From: Tomas Vondra
Date:
Subject: Re: logical decoding and replication of sequences