Re: CREATE ROLE IF NOT EXISTS

Поиск
Список
Период
Сортировка
От David Christensen
Тема Re: CREATE ROLE IF NOT EXISTS
Дата
Msg-id CAOxo6X+HM=XBtWCsNV6zbUCCCWtwyQMREERJ7rFRu3-4NMbYGw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: CREATE ROLE IF NOT EXISTS  (Mark Dilger <mark.dilger@enterprisedb.com>)
Ответы Re: CREATE ROLE IF NOT EXISTS  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Modulo other issues/discussions, here is a version of this patch that implements CREATE OR REPLACE ROLE just by handing off to AlterRole if it's determined that the role already exists; presumably any/all additional considerations would need to be added in both places were there a separate code path for this.

It might be worth refactoring the AlterRole into a helper if there are any deviations in messages, etc, but could be a decent approach to handling the problem (which arguably would have similar restrictions/requirements in ALTER ROLE itself) in a single location.

Best,

David
Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: On login trigger: take three
Следующее
От: "Bossart, Nathan"
Дата:
Сообщение: Re: partial heap only tuples