On Sat, Nov 20, 2010 at 11:23 PM, Robert Haas <robertmh...@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
check_set_namespace.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers