Re: ALTER OBJECT any_name SET SCHEMA name

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: ALTER OBJECT any_name SET SCHEMA name
Дата
Msg-id AANLkTimjOZpa0F7PMPWURNi68B7he8zYD2472aBXmAwr@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ALTER OBJECT any_name SET SCHEMA name  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: ALTER OBJECT any_name SET SCHEMA name  (David Fetter <david@fetter.org>)
Re: ALTER OBJECT any_name SET SCHEMA name  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Re: ALTER OBJECT any_name SET SCHEMA name  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Список pgsql-hackers
On Sat, Nov 20, 2010 at 11:23 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> Ah, nuts.  I see now there's a v7.  Never mind...

OK.  I looked at the right version, now.  Hopefully.

It seems we have no regression tests at all for any of the existing
SET SCHEMA commands.  This seems like a good time to correct that
oversight, and also add some for the new commands you're adding here.
(It might be helpful to submit the regression tests for the existing
commands as a separate patch.) Also, you're missing psql tab
completion support, which would be nice to have.

In CheckSetNamespace() you have the message 'already exists in schema'
there where the existing, similar checks say 'is already in schema',
which is a bit confusing.  But that code looks useful, and in fact I
think we should use it for the existing object types also to avoid
code duplication.  This is technically a regression in terms of
translatability, since instead of a single string that says something
like 'function %s is already in schema %s', you'll have '%s is already
in schema %s', and where the first %s is provided by
getObjectDescription().  But that doesn't seem like a problem, because
(1) we're already doing it that way for dependency error messages
anyway and (2) as far as I can tell from a visual scan and some
hacking with Google Translate, all of the languages for which we have
backend translations put the object type next to the object name
anyway.

So, attached is a proposed patch that just adds CheckSetNamespace()
and makes the existing SET SCHEMA commands use it.  Barring
objections, I'll go ahead and commit this part.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Fwd: patch: format function - fixed oid
Следующее
От: Robert Haas
Дата:
Сообщение: Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)