Re: [FEATURE] Add schema option to all relevant objects - Mailing list pgadmin-hackers

From Guillaume Lelarge
Subject Re: [FEATURE] Add schema option to all relevant objects
Date
Msg-id 1309895244.2762.13.camel@laptop
Whole thread Raw
In response to [FEATURE] Add schema option to all relevant objects  (Thom Brown <thom@linux.com>)
Responses Re: [FEATURE] Add schema option to all relevant objects
Re: [FEATURE] Add schema option to all relevant objects
Re: [FEATURE] Add schema option to all relevant objects
List pgadmin-hackers
Hi Thom,

On Tue, 2011-07-05 at 20:23 +0100, Thom Brown wrote:
> [...]
> I noticed that objects which can be moved to different schemas can't
> be moved in PgAdmin, so I looked to see if there was any request to
> have this implemented, and found this ticket:
> http://code.pgadmin.org/trac/ticket/5
>

Exactly. I did a complete patch once, but my main issue, that I couldn't
fix, was the refresh of the schemas in the browser.

> So I have now implemented this.  A schema drop-down box will appear in
> the properties dialogue for each relevant object beneath the owner
> drop-down.

Did you fix the issue with the refresh of the browser? (I can't check
yet, I'm doing a last time compile of Jasmin's patch :) )

>   I noticed that the Extensions properties dialogue already
> had one in it (and I've changed how it works),

Oops, that was probably a bad move. Extensions don't have schemas by
themselves. Their objects have one, but not the extension in itself.
(Once again, I may be wrong as I didn't read your patch yet)

>  but left it where it
> was.  In order to implement these changes, I had to also fix quite a
> few bugs, and while I was at it, implemented a few additional changes.
>  They are as follows:
>
> - Prevent functions having a complete rewrite when changing owner
> - Add the ability to specify an owner for operators at creation time
> - Fix invalid syntax on text search configuration, parser and template
> when modifying the name
> - Fix unescaped name when modifying text search configuration, parser
> and template name
> - Disabled the owner field on text search dictionaries as it cannot be modified
> - Allow renaming types for versions 8.4 and higher
>

You're gonna hate me, but can you extract the fixes, one by one, from
the actual new feature? even if we won't apply all of them to 1.14, I
don't want to mix them with the real new feature (at least for
pgAdmin :) ).

> I also refactored some code, including re-basing the extensions class
> on the pgSchema class rather than pgDatabase

Bad move once again. An extension doesn't have a schema.

> , replace explicit SET
> OWNER clauses with common function

Can you explain that one?

>  and tore out a few things from the
> text search classes which were just causing problems rather than
> helping.
>

More explanations please?

> Anyway, patch attached.  I've tested every object's creation and
> modification in various combinations on PostgreSQL 8.4 and 9.0, but if
> this patch is a viable candidate for committing then will need testing
> on earlier versions too.  Plus some code review since I'm a n00b.
> Also look at how I'm selecting the list of schemas in case there
> should be any additional ones which should be filtered out.
>

Will look into it.

> Cheers!
>

Thanks a lot for your work. This patch was something I was waiting for.

BTW, are you going to char(11)?


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Fwd: Discussion - Search Objects
Next
From: Dave Page
Date:
Subject: Re: [FEATURE] Add schema option to all relevant objects