Re: [pgadmin-hackers] [pgAdmin4] [Patch]: Grant Wizard

2016-03-08 Thread Surinder Kumar
Hi,

I forgot to add 'node.ui.js' file in the previous patch, please ignore the
previous patch.
Attached is the new patch,

Please review the patch and let me know for any comments.


On Tue, Mar 8, 2016 at 10:44 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> PFA patch with following changes:
>
> 1. Extends SqlTabControl to write a new function 'onWizardChange',
> instead of writing it in backform.pgadmin.js file.
>
> Also, validations in privilegeControl are not working properly, when
> validations gets fixed, I will send an updated patch.
>
> This is complete patch, as Khusboo's patch also merged in attached patch
> and
> patches of "Sequence" and "Functions" macros are already committed.
>
>
> On Fri, Mar 4, 2016 at 8:06 PM, Dave Page  wrote:
>
>> A couple of corrections below 
>>
>> On Fri, Mar 4, 2016 at 1:39 PM, Dave Page  wrote:
>> > Hi
>> >
>> > On Thu, Mar 3, 2016 at 12:49 PM, Surinder Kumar
>> >  wrote:
>> >> Hi,
>> >>
>> >> PFA patch for Grant Wizard.
>> >>
>> >> Before applying grant wizard patch:
>> >>
>> >> 1. Apply patch for "wizard JS file" which Khushboo had shared
>> with
>> >> Ashesh personally.
>> >> I am using that patch with few changes in that. Ashesh will
>> >> review
>> >> and commit that patch.
>> >>
>> >> 2. Apply patches of "Sequence" and "Functions" macros.
>> >>
>> >>
>> >> Please review the patch and Let me know for any comments.
>> >
>> > Initial feedback:
>> >
>> > - Why does this add specific knowledge of the Grant Wizard to the
>> > Browser module? It should be a plugin that loads itself at runtime.
>> > Any changes to the browser to support that should be entirely generic
>> > and usable by any module.
>>
> Fixed.
>
>> >
>> > - The comment above also applies to the core templates. CSS should be
>> > advertised by the plugin, and the browser can add it into the rendered
>> > output when the module is dynamically loaded.
>>
> Fixed.
>
>> >
>> > - +""" Implements Grant Wizard""" - why the leading space? Please
>> > review all comments and code for such small details.
>>
> Done
>
>> >
>> > - The Python code to detect and alias various Python 2/3 classes
>> > should be centralised, as I've seen it in at least one other module.
>> >
>>
> Removed it, as far as it is not required.
>
>> > - In other module names, we've separated multiple words with a hypen.
>> > e.g. server-groups. s/grantwizard/grant-wizard/g
>>
>> That should be an underscore, not a hyphen:
>>
>> s/grantwizard/grant_wizard/g
>
>
>> >
>> > - The published routes for this module are all under
>> >
>> > - "GET /browser/static/js/wizard.js HTTP/1.1" 404 -
>> >
>> > - For consistency, when naming CSS/JS files that are core to a module,
>> > please use the module name, e.g.
>> > /web/pgadmin/tools/grant-wizard/static/css/grant-wizard.css
>>
>> /web/pgadmin/tools/grant_wizard/static/css/grant_wizard.css
>>
> Done
>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


grant_wizard_v3.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Control for selecting multiple columns [pgadmin4]

2016-03-08 Thread Dave Page
Hi,

Do you have a test dialogue or similar in which I can test this code?
Ideally an addition to the test module would be good.

Thanks.

On Tue, Mar 8, 2016 at 7:34 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA backform control for selecting multiple columns.(This control depends
> on column node.)
>
> Usage:
>
> {
>   id: 'columns', label: '{{ _('Columns') }}',
>   type: 'collection', group: '{{ _('Definition') }}', editable:true,
>   canDelete: true, canAdd: true, control: Backform.MultiColumnSelectControl,
>   deps: ['index'], node: 'column',
>   model: pgBrowser.Node.Model.extend({
> keys: ['column'],
> defaults: {
>   column: undefined
> }
>   })
> }
>
>
> Note: When using this control model should have *column* attribute. And
> node property should be *column*.
>
>
>
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB 
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin-hackers] Control for selecting multiple columns [pgadmin4]

2016-03-08 Thread Harshal Dhumal
Hi Dave,

Currently there is no test dialogue to test this control.
Also Ashesh has suggested some changes. Once I complete those changes; I'll
resubmit the patch along with test dialogue to test it.



-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 

On Tue, Mar 8, 2016 at 4:16 PM, Dave Page  wrote:

> Hi,
>
> Do you have a test dialogue or similar in which I can test this code?
> Ideally an addition to the test module would be good.
>
> Thanks.
>
> On Tue, Mar 8, 2016 at 7:34 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA backform control for selecting multiple columns.(This control depends
>> on column node.)
>>
>> Usage:
>>
>> {
>>   id: 'columns', label: '{{ _('Columns') }}',
>>   type: 'collection', group: '{{ _('Definition') }}', editable:true,
>>   canDelete: true, canAdd: true, control: Backform.MultiColumnSelectControl,
>>   deps: ['index'], node: 'column',
>>   model: pgBrowser.Node.Model.extend({
>> keys: ['column'],
>> defaults: {
>>   column: undefined
>> }
>>   })
>> }
>>
>>
>> Note: When using this control model should have *column* attribute. And
>> node property should be *column*.
>>
>>
>>
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB 
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] [pgAdmin4] [Patch]: Grant Wizard

2016-03-08 Thread Dave Page
On Tue, Mar 8, 2016 at 10:00 AM, Surinder Kumar
 wrote:
> Hi,
>
> I forgot to add 'node.ui.js' file in the previous patch, please ignore the
> previous patch.
> Attached is the new patch,
>
> Please review the patch and let me know for any comments.

Is this dependent on any other patches? The menu option never seems to
be enabled for me when I test against git-master.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] PATCH: Collation node [pgAdmin4]

2016-03-08 Thread Murtuza Zabuawala
Hi Dave,

PFA updated patch for collation node.

Regards,
Murtuza

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Thu, Feb 25, 2016 at 7:53 PM, Dave Page  wrote:

> Hi
>
> On Tue, Feb 9, 2016 at 10:15 AM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch for collation node.
>>
>> FYI, patch for this node is already reviewed by Neel, but in this patch
>> we have added parent id in generate browser node function and also added
>> code to handle sql panel request.
>>
>
> I think this has bit-rotted, as it's not working for me:
>
> - SQL is not being generated by the Create dialogue. Updating comments on
> existing collations works though.
>
> - Reverse engineered SQL contains both leading and trailing blank lines.
>
> -  The Python file is missing the introductory pydoc comment and blank
> line after the header.
>
> - 4 space indentation is not consistently applied to SQL templates
>
> - Slony schemas should not be special-cased.
>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


collation_node_v4.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4] [Patch]: Grant Wizard

2016-03-08 Thread Surinder Kumar
The menu option is dependent only on certain nodes like:

1. Schema Node
2. Views Collection Node
3. Tables Collection Node
4. Sequences Collection Node
5. Functions Collection Node

It will be enabled on click of above listed nodes.

On Tue, Mar 8, 2016 at 6:57 PM, Dave Page  wrote:

> On Tue, Mar 8, 2016 at 10:00 AM, Surinder Kumar
>  wrote:
> > Hi,
> >
> > I forgot to add 'node.ui.js' file in the previous patch, please ignore
> the
> > previous patch.
> > Attached is the new patch,
> >
> > Please review the patch and let me know for any comments.
>
> Is this dependent on any other patches? The menu option never seems to
> be enabled for me when I test against git-master.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgadmin-hackers] PATCH: Updated ACL parsing function. [pgAdmin4]

2016-03-08 Thread Murtuza Zabuawala
Hi All,

I have updated "parse_priv_to_db" function to return list instead of string.
I have also updated the common macro template under servers node.
(Please review & verify respective nodes ACL functionality though)

This will also allow us to operate on individual privileges & also we
needed this functionality for column node.

For example,

*Earlier:* priv was string

GRANT {{ priv }} ON {{ type }} TO {{ conn|qtIdent(role) }};

*Now:* priv will be List, which we need to handle in jinja templates.

GRANT *{{ priv|join(', ') }}* ON {{ type }} TO {{ conn|qtIdent(role) }};


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


updated_parse_priv_function_templates.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] PATCH: Updated acl parsing on tablespace node [pgAdmin4]

2016-03-08 Thread Murtuza Zabuawala
Hi,

PFA updated patch to update acl parsing with new changes.
Removed hardcoded string and passed acl list instead.


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Updated_tablespace_acl_parsing.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] Bug fixed in Asynchronous connection

2016-03-08 Thread Akshay Joshi
Hi All

During testing I have found one issue in Asynchronous connection logic,  we
fetch column info only when there is some row return by the sql query,
which is not correct, Column info should be fetch even if there is no data,
so at least we can display the columns. Attached is the patch to fix this
issue.

Please review it and if it looks good please commit it.

-- 
*Akshay Joshi*
*Principal Software Engineer *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*


Async_bug_fixed.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] PATCH: Schema/Catalog Node [pgAdmin4]

2016-03-08 Thread Dave Page
On Tue, Mar 8, 2016 at 2:18 PM, Ashesh Vashi 
wrote:

> On Tue, Mar 8, 2016 at 7:36 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> On Tue, Mar 8, 2016 at 12:20 AM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>>
>>> On Thu, Mar 3, 2016 at 8:27 PM, Dave Page  wrote:
>>>
 Hi

 On Sun, Feb 28, 2016 at 6:49 AM, Ashesh Vashi <
 ashesh.va...@enterprisedb.com> wrote:

> Hi Dave,
>
> As discussed, I have worked on this patch to improve some code level
> changes.
> (because - Murtuza was not available due to some other engagement.)
>
> Can you please review it, and share your feedback?
>

 I think it's  mostly there. I've attached an updated patch where I've
 fixed a few minor issues as I read through the code. The following (likely
 simple) issues need to be fixed:

 - Dropping a schema fails with an error message of "
 schema/pg/9.2_plus/sql/get_name.sql".

>>> Done.
>>>

 - Creating a schema appears to fail with "'data' is undefined",
 however the schema is created, it's just that the dialogue doesn't close
 and the new schema isn't added to the tree.

>>> Done.
>>>

 - There is some discrepancy between default privileges as displayed on
 the properties summary, the edit dialogue, and the RE-SQL. As you can see
 in the screenshot, the SQL just GRANTS ALL, and the properties panel
 doesn't show anything.

>>> Yes - there were some typos in the schema/catalog node implementation,
>>> which I have resolved now.
>>>
>>> Please find the updated patch.
>>>
>> One more updated patch:
>> Some of the catalogs will not have all the schema child objects.
>> Hence - they will need to check certain thing likes they're not being
>> loading in the catalog with such property (i.e. pg_catalog).
>>
> As per my conversation with Murtuza, who has already implemented
> catalog_obejcts for this kind of catalogs, these objects are only supported
> for catalogs like information_schema (and, PPAS specific dbo, sys).
>
>> To ease the work, I have introduced a class name SchemaChildModule, which
>> does that job for us.
>>
> Please find the patch as per his input.
>
>
Can you split out the new changes please? I just spent 30 minutes tweaking
the last patch.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin-hackers] PATCH: Schema/Catalog Node [pgAdmin4]

2016-03-08 Thread Ashesh Vashi
On Tue, Mar 8, 2016 at 8:08 PM, Dave Page  wrote:

>
>
> On Tue, Mar 8, 2016 at 2:18 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> On Tue, Mar 8, 2016 at 7:36 PM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Tue, Mar 8, 2016 at 12:20 AM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
 Hi Dave,


 On Thu, Mar 3, 2016 at 8:27 PM, Dave Page  wrote:

> Hi
>
> On Sun, Feb 28, 2016 at 6:49 AM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> As discussed, I have worked on this patch to improve some code level
>> changes.
>> (because - Murtuza was not available due to some other engagement.)
>>
>> Can you please review it, and share your feedback?
>>
>
> I think it's  mostly there. I've attached an updated patch where I've
> fixed a few minor issues as I read through the code. The following (likely
> simple) issues need to be fixed:
>
> - Dropping a schema fails with an error message of "
> schema/pg/9.2_plus/sql/get_name.sql".
>
 Done.

>
> - Creating a schema appears to fail with "'data' is undefined",
> however the schema is created, it's just that the dialogue doesn't close
> and the new schema isn't added to the tree.
>
 Done.

>
> - There is some discrepancy between default privileges as displayed on
> the properties summary, the edit dialogue, and the RE-SQL. As you can see
> in the screenshot, the SQL just GRANTS ALL, and the properties panel
> doesn't show anything.
>
 Yes - there were some typos in the schema/catalog node implementation,
 which I have resolved now.

 Please find the updated patch.

>>> One more updated patch:
>>> Some of the catalogs will not have all the schema child objects.
>>> Hence - they will need to check certain thing likes they're not being
>>> loading in the catalog with such property (i.e. pg_catalog).
>>>
>> As per my conversation with Murtuza, who has already implemented
>> catalog_obejcts for this kind of catalogs, these objects are only supported
>> for catalogs like information_schema (and, PPAS specific dbo, sys).
>>
>>> To ease the work, I have introduced a class name SchemaChildModule,
>>> which does that job for us.
>>>
>> Please find the patch as per his input.
>>
>>
> Can you split out the new changes please? I just spent 30 minutes tweaking
> the last patch.
>
Sure.
Here is the patch based on the v10 patch.

--
Thanks & Regards,
Ashesh Vashi

>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


schema_catalog_node_v10-v11.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Add support for Schemas and Catalogs.

2016-03-08 Thread Dave Page
Add support for Schemas and Catalogs.

Initial patch by Murtuza Zabuawala with further hacking by Ashesh Vashi and I.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=a92d4841d1f47fdac018a9d0654234d82052d5cf

Modified Files
--
.../servers/databases/schemas/__init__.py  | 987 +
.../databases/schemas/static/img/catalog.png   | Bin 0 -> 387 bytes
.../databases/schemas/static/img/coll-catalog.png  | Bin 0 -> 371 bytes
.../databases/schemas/static/img/coll-schema.png   | Bin 0 -> 374 bytes
.../databases/schemas/static/img/schema.png| Bin 0 -> 376 bytes
.../schemas/templates/catalog/js/catalog.js| 111 +++
.../catalog/pg/9.1_plus/allowed_privs.json |  26 +
.../templates/catalog/pg/9.1_plus/sql/acl.sql  |  23 +
.../templates/catalog/pg/9.1_plus/sql/alter.sql|   1 +
.../templates/catalog/pg/9.1_plus/sql/create.sql   |  17 +
.../templates/catalog/pg/9.1_plus/sql/get_name.sql |   1 +
.../catalog/pg/9.1_plus/sql/is_catalog.sql |   9 +
.../templates/catalog/pg/9.1_plus/sql/nodes.sql|  16 +
.../catalog/pg/9.1_plus/sql/properties.sql |  27 +
.../templates/catalog/pg/9.1_plus/sql/update.sql   |  30 +
.../catalog/pg/9.2_plus/allowed_privs.json |  30 +
.../templates/catalog/pg/9.2_plus/sql/acl.sql  |  23 +
.../templates/catalog/pg/9.2_plus/sql/alter.sql|   1 +
.../templates/catalog/pg/9.2_plus/sql/create.sql   |  17 +
.../templates/catalog/pg/9.2_plus/sql/get_name.sql |   1 +
.../catalog/pg/9.2_plus/sql/is_catalog.sql |   9 +
.../templates/catalog/pg/9.2_plus/sql/nodes.sql|  16 +
.../catalog/pg/9.2_plus/sql/properties.sql |  28 +
.../templates/catalog/pg/9.2_plus/sql/update.sql   |  30 +
.../templates/catalog/pg/macros/catalogs.sql   |  25 +
.../catalog/ppas/9.1_plus/allowed_privs.json   |  26 +
.../templates/catalog/ppas/9.1_plus/sql/acl.sql|  23 +
.../templates/catalog/ppas/9.1_plus/sql/alter.sql  |   1 +
.../templates/catalog/ppas/9.1_plus/sql/create.sql |  17 +
.../catalog/ppas/9.1_plus/sql/get_name.sql |   1 +
.../catalog/ppas/9.1_plus/sql/is_catalog.sql   |   9 +
.../templates/catalog/ppas/9.1_plus/sql/nodes.sql  |  17 +
.../catalog/ppas/9.1_plus/sql/properties.sql   |  31 +
.../templates/catalog/ppas/9.1_plus/sql/update.sql |  30 +
.../catalog/ppas/9.2_plus/allowed_privs.json   |  30 +
.../templates/catalog/ppas/9.2_plus/sql/acl.sql|  23 +
.../templates/catalog/ppas/9.2_plus/sql/alter.sql  |   1 +
.../templates/catalog/ppas/9.2_plus/sql/create.sql |  17 +
.../catalog/ppas/9.2_plus/sql/get_name.sql |   1 +
.../catalog/ppas/9.2_plus/sql/is_catalog.sql   |   9 +
.../templates/catalog/ppas/9.2_plus/sql/nodes.sql  |  17 +
.../catalog/ppas/9.2_plus/sql/properties.sql   |  29 +
.../templates/catalog/ppas/9.2_plus/sql/update.sql |  30 +
.../templates/catalog/ppas/macros/catalogs.sql |  29 +
.../schemas/templates/schema/js/schema.js  | 234 +
.../schema/pg/9.1_plus/allowed_privs.json  |  26 +
.../templates/schema/pg/9.1_plus/sql/acl.sql   |  23 +
.../templates/schema/pg/9.1_plus/sql/alter.sql |  35 +
.../templates/schema/pg/9.1_plus/sql/create.sql|   7 +
.../templates/schema/pg/9.1_plus/sql/defacl.sql|  39 +
.../templates/schema/pg/9.1_plus/sql/delete.sql|   1 +
.../templates/schema/pg/9.1_plus/sql/get_name.sql  |   1 +
.../schema/pg/9.1_plus/sql/is_catalog.sql  |   9 +
.../templates/schema/pg/9.1_plus/sql/nodes.sql |  21 +
.../templates/schema/pg/9.1_plus/sql/oid.sql   |   1 +
.../schema/pg/9.1_plus/sql/properties.sql  |  35 +
.../templates/schema/pg/9.1_plus/sql/update.sql|  83 ++
.../schema/pg/9.2_plus/allowed_privs.json  |  30 +
.../templates/schema/pg/9.2_plus/sql/acl.sql   |  23 +
.../templates/schema/pg/9.2_plus/sql/alter.sql |  35 +
.../templates/schema/pg/9.2_plus/sql/create.sql|   7 +
.../templates/schema/pg/9.2_plus/sql/defacl.sql|  40 +
.../templates/schema/pg/9.2_plus/sql/delete.sql|   1 +
.../templates/schema/pg/9.2_plus/sql/get_name.sql  |   1 +
.../schema/pg/9.2_plus/sql/is_catalog.sql  |   9 +
.../templates/schema/pg/9.2_plus/sql/nodes.sql |  21 +
.../templates/schema/pg/9.2_plus/sql/oid.sql   |   1 +
.../schema/pg/9.2_plus/sql/properties.sql  |  36 +
.../templates/schema/pg/9.2_plus/sql/update.sql|  83 ++
.../schema/ppas/9.1_plus/allowed_privs.json|  26 +
.../templates/schema/ppas/9.1_plus/sql/acl.sql |  23 +
.../templates/schema/ppas/9.1_plus/sql/alter.sql   |  35 +
.../templates/schema/ppas/9.1_plus/sql/create.sql  |   7 +
.../templates/schema/ppas/9.1_plus/sql/defacl.sql  |  39 +
.../templates/schema/ppas/9.1_plus/sql/delete.sql  |   1 +
.../schema/ppas/9.1_plus/sql/get_name.sql  |   1 +
.../schema/ppas/9.1_plus/sql/is_catalog.sql|   9 +
.../templates/schema/ppas/9.1_plus/sql/nodes.sql   |  21 +
.../templates/schema/ppas

Re: [pgadmin-hackers] PATCH: Schema/Catalog Node [pgAdmin4]

2016-03-08 Thread Dave Page
On Tue, Mar 8, 2016 at 2:46 PM, Ashesh Vashi
 wrote:
> On Tue, Mar 8, 2016 at 8:08 PM, Dave Page  wrote:
>>
>>
>>
>> On Tue, Mar 8, 2016 at 2:18 PM, Ashesh Vashi
>>  wrote:
>>>
>>> On Tue, Mar 8, 2016 at 7:36 PM, Ashesh Vashi
>>>  wrote:

 Hi Dave,

 On Tue, Mar 8, 2016 at 12:20 AM, Ashesh Vashi
  wrote:
>
> Hi Dave,
>
>
> On Thu, Mar 3, 2016 at 8:27 PM, Dave Page  wrote:
>>
>> Hi
>>
>> On Sun, Feb 28, 2016 at 6:49 AM, Ashesh Vashi
>>  wrote:
>>>
>>> Hi Dave,
>>>
>>> As discussed, I have worked on this patch to improve some code level
>>> changes.
>>> (because - Murtuza was not available due to some other engagement.)
>>>
>>> Can you please review it, and share your feedback?
>>
>>
>> I think it's  mostly there. I've attached an updated patch where I've
>> fixed a few minor issues as I read through the code. The following 
>> (likely
>> simple) issues need to be fixed:
>>
>> - Dropping a schema fails with an error message of
>> "schema/pg/9.2_plus/sql/get_name.sql".
>
> Done.
>>
>>
>> - Creating a schema appears to fail with "'data' is undefined",
>> however the schema is created, it's just that the dialogue doesn't close 
>> and
>> the new schema isn't added to the tree.
>
> Done.
>>
>>
>> - There is some discrepancy between default privileges as displayed on
>> the properties summary, the edit dialogue, and the RE-SQL. As you can 
>> see in
>> the screenshot, the SQL just GRANTS ALL, and the properties panel doesn't
>> show anything.
>
> Yes - there were some typos in the schema/catalog node implementation,
> which I have resolved now.
>
> Please find the updated patch.

 One more updated patch:
 Some of the catalogs will not have all the schema child objects.
 Hence - they will need to check certain thing likes they're not being
 loading in the catalog with such property (i.e. pg_catalog).
>>>
>>> As per my conversation with Murtuza, who has already implemented
>>> catalog_obejcts for this kind of catalogs, these objects are only supported
>>> for catalogs like information_schema (and, PPAS specific dbo, sys).

 To ease the work, I have introduced a class name SchemaChildModule,
 which does that job for us.
>>>
>>> Please find the patch as per his input.
>>>
>>
>> Can you split out the new changes please? I just spent 30 minutes tweaking
>> the last patch.
>
> Sure.
> Here is the patch based on the v10 patch.

Thanks - patch committed. I made the following changes:

- Removed explicit support for 9.0 and below.
- Hid the default ACLs from the properties list for catalogs.
- Tidied up some of the SQL formatting

Open questions:

- We don't allow default ACLs to be specified when creating a schema
(neither does pgAdmin). Why not? Shouldn't we?

- We create new objects in 2 SQL statements, one that runs create.sql
and one that runs alter.sql to apply ACL, label options and more. I
strongly believe we need to push this into a single statement for all
object types, to ensure creation is completely atomic. Right now, you
can easily get an error by trying to set an unregistered security
label, which keeps the create dialogue open, however the object has
been successfully created.

Thoughts?


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Always fetch column info from the server, even if the

2016-03-08 Thread Dave Page
Always fetch column info from the server, even if there are no rows.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=f08aa6a3138a4e762548b33bc104f2bee2675bb4
Author: Akshay Joshi 

Modified Files
--
web/pgadmin/utils/driver/psycopg2/__init__.py | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Bug fixed in Asynchronous connection

2016-03-08 Thread Dave Page
Thanks, committed.

On Tue, Mar 8, 2016 at 2:29 PM, Akshay Joshi 
wrote:

> Hi All
>
> During testing I have found one issue in Asynchronous connection logic,
>  we fetch column info only when there is some row return by the sql query,
> which is not correct, Column info should be fetch even if there is no data,
> so at least we can display the columns. Attached is the patch to fix this
> issue.
>
> Please review it and if it looks good please commit it.
>
> --
> *Akshay Joshi*
> *Principal Software Engineer *
>
>
>
> *Phone: +91 20-3058-9517 <%2B91%2020-3058-9517>Mobile: +91 976-788-8246*
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin-hackers] PATCH: Schema/Catalog Node [pgAdmin4]

2016-03-08 Thread Ashesh Vashi
On Tue, Mar 8, 2016 at 9:23 PM, Dave Page  wrote:

> On Tue, Mar 8, 2016 at 2:46 PM, Ashesh Vashi
>  wrote:
> > On Tue, Mar 8, 2016 at 8:08 PM, Dave Page  wrote:
> >>
> >>
> >>
> >> On Tue, Mar 8, 2016 at 2:18 PM, Ashesh Vashi
> >>  wrote:
> >>>
> >>> On Tue, Mar 8, 2016 at 7:36 PM, Ashesh Vashi
> >>>  wrote:
> 
>  Hi Dave,
> 
>  On Tue, Mar 8, 2016 at 12:20 AM, Ashesh Vashi
>   wrote:
> >
> > Hi Dave,
> >
> >
> > On Thu, Mar 3, 2016 at 8:27 PM, Dave Page  wrote:
> >>
> >> Hi
> >>
> >> On Sun, Feb 28, 2016 at 6:49 AM, Ashesh Vashi
> >>  wrote:
> >>>
> >>> Hi Dave,
> >>>
> >>> As discussed, I have worked on this patch to improve some code
> level
> >>> changes.
> >>> (because - Murtuza was not available due to some other engagement.)
> >>>
> >>> Can you please review it, and share your feedback?
> >>
> >>
> >> I think it's  mostly there. I've attached an updated patch where
> I've
> >> fixed a few minor issues as I read through the code. The following
> (likely
> >> simple) issues need to be fixed:
> >>
> >> - Dropping a schema fails with an error message of
> >> "schema/pg/9.2_plus/sql/get_name.sql".
> >
> > Done.
> >>
> >>
> >> - Creating a schema appears to fail with "'data' is undefined",
> >> however the schema is created, it's just that the dialogue doesn't
> close and
> >> the new schema isn't added to the tree.
> >
> > Done.
> >>
> >>
> >> - There is some discrepancy between default privileges as displayed
> on
> >> the properties summary, the edit dialogue, and the RE-SQL. As you
> can see in
> >> the screenshot, the SQL just GRANTS ALL, and the properties panel
> doesn't
> >> show anything.
> >
> > Yes - there were some typos in the schema/catalog node
> implementation,
> > which I have resolved now.
> >
> > Please find the updated patch.
> 
>  One more updated patch:
>  Some of the catalogs will not have all the schema child objects.
>  Hence - they will need to check certain thing likes they're not being
>  loading in the catalog with such property (i.e. pg_catalog).
> >>>
> >>> As per my conversation with Murtuza, who has already implemented
> >>> catalog_obejcts for this kind of catalogs, these objects are only
> supported
> >>> for catalogs like information_schema (and, PPAS specific dbo, sys).
> 
>  To ease the work, I have introduced a class name SchemaChildModule,
>  which does that job for us.
> >>>
> >>> Please find the patch as per his input.
> >>>
> >>
> >> Can you split out the new changes please? I just spent 30 minutes
> tweaking
> >> the last patch.
> >
> > Sure.
> > Here is the patch based on the v10 patch.
>
> Thanks - patch committed. I made the following changes:
>
> - Removed explicit support for 9.0 and below.
> - Hid the default ACLs from the properties list for catalogs.
> - Tidied up some of the SQL formatting
>
> Open questions:
>
> - We don't allow default ACLs to be specified when creating a schema
> (neither does pgAdmin). Why not? Shouldn't we?
>
Hmm.. I don't see any reason, why we should not do it.
We have adopted that from pgAdmin III.

>
> - We create new objects in 2 SQL statements, one that runs create.sql
> and one that runs alter.sql to apply ACL, label options and more. I
> strongly believe we need to push this into a single statement for all
> object types, to ensure creation is completely atomic. Right now, you
> can easily get an error by trying to set an unregistered security
> label, which keeps the create dialogue open, however the object has
> been successfully created.
>
Agree.
Even if they needed to be created from two, or more separate templates,
they should ran together unless there are some statements, which require to
run in separate transaction.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


>
> Thoughts?
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] PATCH: Schema/Catalog Node [pgAdmin4]

2016-03-08 Thread Dave Page
On Tue, Mar 8, 2016 at 4:34 PM, Ashesh Vashi 
wrote:

> On Tue, Mar 8, 2016 at 9:23 PM, Dave Page  wrote:
>
>> On Tue, Mar 8, 2016 at 2:46 PM, Ashesh Vashi
>>  wrote:
>> > On Tue, Mar 8, 2016 at 8:08 PM, Dave Page  wrote:
>> >>
>> >>
>> >>
>> >> On Tue, Mar 8, 2016 at 2:18 PM, Ashesh Vashi
>> >>  wrote:
>> >>>
>> >>> On Tue, Mar 8, 2016 at 7:36 PM, Ashesh Vashi
>> >>>  wrote:
>> 
>>  Hi Dave,
>> 
>>  On Tue, Mar 8, 2016 at 12:20 AM, Ashesh Vashi
>>   wrote:
>> >
>> > Hi Dave,
>> >
>> >
>> > On Thu, Mar 3, 2016 at 8:27 PM, Dave Page 
>> wrote:
>> >>
>> >> Hi
>> >>
>> >> On Sun, Feb 28, 2016 at 6:49 AM, Ashesh Vashi
>> >>  wrote:
>> >>>
>> >>> Hi Dave,
>> >>>
>> >>> As discussed, I have worked on this patch to improve some code
>> level
>> >>> changes.
>> >>> (because - Murtuza was not available due to some other
>> engagement.)
>> >>>
>> >>> Can you please review it, and share your feedback?
>> >>
>> >>
>> >> I think it's  mostly there. I've attached an updated patch where
>> I've
>> >> fixed a few minor issues as I read through the code. The following
>> (likely
>> >> simple) issues need to be fixed:
>> >>
>> >> - Dropping a schema fails with an error message of
>> >> "schema/pg/9.2_plus/sql/get_name.sql".
>> >
>> > Done.
>> >>
>> >>
>> >> - Creating a schema appears to fail with "'data' is undefined",
>> >> however the schema is created, it's just that the dialogue doesn't
>> close and
>> >> the new schema isn't added to the tree.
>> >
>> > Done.
>> >>
>> >>
>> >> - There is some discrepancy between default privileges as
>> displayed on
>> >> the properties summary, the edit dialogue, and the RE-SQL. As you
>> can see in
>> >> the screenshot, the SQL just GRANTS ALL, and the properties panel
>> doesn't
>> >> show anything.
>> >
>> > Yes - there were some typos in the schema/catalog node
>> implementation,
>> > which I have resolved now.
>> >
>> > Please find the updated patch.
>> 
>>  One more updated patch:
>>  Some of the catalogs will not have all the schema child objects.
>>  Hence - they will need to check certain thing likes they're not being
>>  loading in the catalog with such property (i.e. pg_catalog).
>> >>>
>> >>> As per my conversation with Murtuza, who has already implemented
>> >>> catalog_obejcts for this kind of catalogs, these objects are only
>> supported
>> >>> for catalogs like information_schema (and, PPAS specific dbo, sys).
>> 
>>  To ease the work, I have introduced a class name SchemaChildModule,
>>  which does that job for us.
>> >>>
>> >>> Please find the patch as per his input.
>> >>>
>> >>
>> >> Can you split out the new changes please? I just spent 30 minutes
>> tweaking
>> >> the last patch.
>> >
>> > Sure.
>> > Here is the patch based on the v10 patch.
>>
>> Thanks - patch committed. I made the following changes:
>>
>> - Removed explicit support for 9.0 and below.
>> - Hid the default ACLs from the properties list for catalogs.
>> - Tidied up some of the SQL formatting
>>
>> Open questions:
>>
>> - We don't allow default ACLs to be specified when creating a schema
>> (neither does pgAdmin). Why not? Shouldn't we?
>>
> Hmm.. I don't see any reason, why we should not do it.
> We have adopted that from pgAdmin III.
>
>>
>> - We create new objects in 2 SQL statements, one that runs create.sql
>> and one that runs alter.sql to apply ACL, label options and more. I
>> strongly believe we need to push this into a single statement for all
>> object types, to ensure creation is completely atomic. Right now, you
>> can easily get an error by trying to set an unregistered security
>> label, which keeps the create dialogue open, however the object has
>> been successfully created.
>>
> Agree.
> Even if they needed to be created from two, or more separate templates,
> they should ran together unless there are some statements, which require to
> run in separate transaction.
>

OK, I added tasks to do both to our internal tracker.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company