Re: Privilege required for IF EXISTS event if the object already exists

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Shay Rojansky <roji(at)roji(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Privilege required for IF EXISTS event if the object already exists
Date: 2021-12-15 16:44:56
Message-ID: 61BA1B88.9070506@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-12-15 16:56:04 Re: logical decoding and replication of sequences
Previous Message John Naylor 2021-12-15 16:43:37 Re: speed up text_position() for utf-8