Re: pgAdmin 4 commit: Fix the feature tests failuers.

2017-08-29 Thread Harshal Dhumal
Hi Ashesh,

I ran feature test case on mac couple times however I didn't get failure
which Dave and you got.
In my case feature test cases mostly falling in xxs_debugger test case.

This was because as when we configure database sever to debug functions it
adds 21 its own functions in database and when we run this feature test, it
adds one more function (with name test_function) to actually debug it.
But due to its name (test_function) it appears at bottom in visible area of
browser and some times
selenium fails to click on that element. To overcome this I have renamed
test function name from *test_function*
to *a_test_function *so that it will appear at top position under function
collection node (patch attached).


-- 
*Harshal Dhumal*
*Sr. Software Engineer*

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

On Fri, Aug 25, 2017 at 9:11 PM, Ashesh Vashi  wrote:

> On Fri, Aug 25, 2017 at 8:26 PM, Dave Page  wrote:
>
>> QueryToolFeatureTest seems to be failing on both Jenkins and my test mac
>> system since this was applied. The other one below seems more intermittent.
>>
>> ==
>> ERROR: runTest (pgadmin.feature_tests.query_t
>> ool_tests.QueryToolFeatureTest)
>> Query tool feature test
>> --
>> Traceback (most recent call last):
>>   File 
>> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_tool_tests.py",
>> line 84, in runTest
>> self._query_tool_explain_cost()
>>   File 
>> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_tool_tests.py",
>> line 361, in _query_tool_explain_cost
>> canvas.find_element_by_xpath("//*[contains(string(),'Total Cost')]")
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webelement.py", line 260, in
>> find_element_by_xpath
>> return self.find_element(by=By.XPATH, value=xpath)
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webelement.py", line 510, in find_element
>> {"using": by, "value": value})['value']
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webelement.py", line 493, in _execute
>> return self._parent.execute(command, params)
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webdriver.py", line 249, in execute
>> self.error_handler.check_response(response)
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/errorhandler.py", line 193, in
>> check_response
>> raise exception_class(message, screen, stacktrace)
>> NoSuchElementException: Message: no such element: Unable to locate
>> element: {"method":"xpath","selector":"//*[contains(string(),'Total
>> Cost')]"}
>>
>   (Session info: chrome=60.0.3112.101)
>>   (Driver info: chromedriver=2.29.461585 
>> (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac
>> OS X 10.11.6 x86_64)
>>
>>
>> ==
>> ERROR: runTest (pgadmin.feature_tests.view_da
>> ta_dml_queries.CheckForViewDataTest)
>> Validate Insert, Update operations in View/Edit data with given test data
>> --
>> Traceback (most recent call last):
>>   File 
>> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
>> line 107, in runTest
>> self._verify_row_data(True)
>>   File 
>> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
>> line 291, in _verify_row_data
>> result_row = self.page.find_by_xpath(xpath)
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
>> line 148, in find_by_xpath
>> return self.wait_for_element(lambda driver:
>> driver.find_element_by_xpath(xpath))
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
>> line 232, in wait_for_element
>> return self._wait_for("element to exist", element_if_it_exists)
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
>> line 282, in _wait_for
>> "Timed out waiting for " + waiting_for_message)
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/support/wait.py", line 71, in until
>> value = method(self._driver)
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
>> line 227, in element_if_it_exists
>> if element.is_displayed() and element.is_enabled():
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webelement.py", line 157, in is_enabled
>> return self._execute(Command.IS_ELEMENT_ENABLED)['value']
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pack

Re: pgAdmin 4 commit: Fix the feature tests failuers.

2017-08-29 Thread Dave Page
On Tue, Aug 29, 2017 at 8:41 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi Ashesh,
>
> I ran feature test case on mac couple times however I didn't get failure
> which Dave and you got.
> In my case feature test cases mostly falling in xxs_debugger test case.
>
> This was because as when we configure database sever to debug functions it
> adds 21 its own functions in database and when we run this feature test, it
> adds one more function (with name test_function) to actually debug it.
> But due to its name (test_function) it appears at bottom in visible area
> of browser and some times
> selenium fails to click on that element. To overcome this I have renamed
> test function name from *test_function*
> to *a_test_function *so that it will appear at top position under
> function collection node (patch attached).
>

Wouldn't it be better to scroll until it's in view? That seems like it
would be much less likely to break in the future.

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

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


Re: pgAdmin 4 commit: Update docs to more accurately reflect the SERVER_MOD

2017-08-29 Thread Dave Page
Hi

On Mon, Aug 28, 2017 at 7:51 AM, Akshay Joshi  wrote:

> Hi Dave
>
> Changes looks good to me, only one thing is that I also override
> 'DATA_DIR' and 'TEST_SQLITE_PATH' parameter in my config_local.py, so we
> should include both the parameters in 'desktop_deployment.rst' file.
>

DATA_DIR is only used to derive the other paths isn't it? and
TEST_SQLITE_PATH is a developer option, so I'm inclined to leave that out
of the user docs.


>
> On Fri, Aug 25, 2017 at 4:45 PM, Dave Page  wrote:
>
>> Akshay, Ashesh,
>>
>> I've committed these doc changes to reflect the paths/SERVER_MODE
>> changes. Could you both please review them and let me know if I missed
>> anything of importance, or if anything isn't clear?
>>
>> Thanks.
>>
>> On Fri, Aug 25, 2017 at 12:13 PM, Dave Page  wrote:
>>
>>> Update docs to more accurately reflect the SERVER_MODE config
>>> requirements.
>>>
>>> Branch
>>> --
>>> master
>>>
>>> Details
>>> ---
>>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdif
>>> f;h=5c016f0993fb557052cce7e11cd6ad818bd7c3a3
>>>
>>> Modified Files
>>> --
>>> docs/en_US/desktop_deployment.rst | 39 ++
>>> -
>>> docs/en_US/server_deployment.rst  | 18 --
>>> 2 files changed, 18 insertions(+), 39 deletions(-)
>>>
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
>
> --
> *Akshay Joshi*
> *Principal Software Engineer *
>
>
>
> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246
> <+91%2097678%2088246>*
>



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

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


Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in Desktop Runtime on Mac OS X

2017-08-29 Thread Surinder Kumar
Hi Ashesh,

Can you please review this patch please?

Thanks,
Surinder

On Wed, Aug 16, 2017 at 3:43 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi,
>
> Updated patch contains changes:
>
>- Enable definePlugin for development environment as well. Just adding
>definePlugin in plugins array.
>The variable process.env.NODE_ENV is useful to write conditional code
>in pgAdmin4 JS modules.
>
> For example:
>
> if (process.env.NODE_ENV !== 'production') {
>   // Write development environment specific code
> } else {
>   // Write production only code.
> }
>
> Please review this patch and let me know for changes.
>
> Thanks,
> Surinder
> ​
>
> On Tue, Aug 1, 2017 at 11:32 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Ashesh,
>>
>> 1. Now we are using `envType` variable in definePlugin which sets
>> environment variable NODE_ENV globally which is used by React to create
>> development or production build.
>> where:
>>  envType - determine build type is either `production` or
>> `development`​ depending on the environment set in package.json > scripts.
>>
>> 2. In `UglifyJSPlugin`, i am setting compress > `warnings to false`,
>> because here warning flag is meant to display warnings on terminal while
>> creating build in production mode. so it is set to false.
>>
>> I didn't created an RM for #2 as it is minor change, if needed, i will
>> create.
>>
>> ​Reference to webpack definePlugin:
>> https://webpack.js.org/guides/production/#node-environment-variable​
>>
>> Please find updated patch with fixed review comments and review.
>>
>> Thanks,
>> Surinder
>>
>> On Mon, Jul 31, 2017 at 3:31 PM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> On Fri, Jul 28, 2017 at 12:42 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi,

 I inspect the react code and in call stacks, found
 `process.env.NODE_ENV` is undefined due to which 'SyntheticEvent.call' is
 not callable.

 So, to fix this, i add 'definePlugin' to plugins for `dev` environment
 in `webpack.config.js`. Initially it was added only for `production`
 environment. but it is needed for both, because React code is conditional
 based on environment variables set.

>>>
 Please find attached patch and review.

>>> As discussed, you're setting 'production', even in the 'development'
>>> mode.
>>>
>>> Please understand the code, and share the updated patch.
>>> Also - share the references next time, so that - committer can
>>> understand the reason for these changes.
>>>
>>> -- Thanks, Ashesh
>>>

 Thanks,
 Surinder

>>>
>>>
>>
>


pgAdmin 4 commit: Cleanup feature tests. Fixes #2586

2017-08-29 Thread Dave Page
Cleanup feature tests. Fixes #2586

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=ceb9438000cea77f7054693a292cf4bd5850b4a0
Author: Harshal Dhumal 

Modified Files
--
.../connect_to_server_feature_test.py  |  84 -
.../copy_selected_query_results_feature_test.py|  17 +-
.../feature_tests/pg_datatype_validation_test.py   |  36 +-
.../feature_tests/query_tool_journey_test.py   |  21 +-
web/pgadmin/feature_tests/query_tool_tests.py  | 407 ++---
web/pgadmin/feature_tests/view_data_dml_queries.py |   6 +-
.../xss_checks_panels_and_query_tool_test.py   |  40 +-
.../xss_checks_pgadmin_debugger_test.py|  76 ++--
.../feature_tests/xss_checks_roles_control_test.py |  17 +-
web/regression/feature_utils/pgadmin_page.py   |   8 +-
10 files changed, 181 insertions(+), 531 deletions(-)



Re: [pgAdmin4][RM2586] Cleanup feature test

2017-08-29 Thread Dave Page
Thanks, patch applied (test time now down to 209s :-) ).

On Mon, Aug 28, 2017 at 11:04 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find attached updated patch
>
> On Fri, Aug 25, 2017 at 2:32 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Thu, Aug 24, 2017 at 11:51 AM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Last week Sarah, Matt and I had call regarding some issues with feature
>>> test cases.
>>> For example in auto commit disable test scenario from query tool test
>>> cases by removing code line
>>> *self.page.find_by_id("btn-auto-commit").click() *the test case
>>> scenario was not falling.
>>> This issue was due to previously on going database transaction. This
>>> issue was also with test scenarios like
>>> auto commit enable and auto rollback enabled. The attached patch fixes
>>> this issue.
>>>
>>> @Sarah and Matt can you please give this patch a try to check if issues
>>> we discussed last week are fixed.
>>>
>>
>> I don't think Matt and Sarah are working on pgAdmin any more :-(
>>
>> I just tried this patch, and whilst the tests all passed, it spent quite
>> some time typing "select * from hats" into random places in the query tool,
>> such that it ended up running queries like
>>
>> select * select * select * from hats from hats from hats
>>
>> I don't remember it doing that before; I think it was a) clearing
>> codemirror each time and b) entering the text much more quickly (in fact I
>> just tried it, and it enters the text and executes the query so fast the
>> screen basically strobes).
>>
> Fixed.
>
>
>> Performance-wise, I got 266 seconds with the patch, and 378 without, so
>> there's definitely some good improvement here, just a little funkyness with
>> the query tool journey test.
>>
>
> Recently Wenlin Zhang has fixed this in this commit
> .
> Here is link
> 
> to email thread.
>
>
>> Thanks.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


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

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


pgAdmin 4 commit: Allow pgAdmin to run with config database versions fr

2017-08-29 Thread Dave Page
Allow pgAdmin to run with config database versions from the future. Fixes #2664

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=7835da267b390ce8fc97c68ca735e0e0c8bde94a
Author: Surinder Kumar 

Modified Files
--
web/pgadmin/__init__.py | 24 ++--
web/setup.py| 20 +++-
2 files changed, 41 insertions(+), 3 deletions(-)



Re: [pgAdmin4][Patch]: Ensure any changes to the config database are backward compatible

2017-08-29 Thread Dave Page
Thanks, patch applied.

On Fri, Aug 25, 2017 at 3:12 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Created an RM  to track this
> issue.
>
> On Fri, Aug 25, 2017 at 7:19 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> ​Hi,​
>>
>> We will use config variable `SCHEMA_VERSION` to keep track of SQLite
>> database changes. Whenever there is any change is performed in the
>> database, the count of schema version will be incremented by 1 and the same
>> will be updated in SQLite table `version`.
>>
>> So, these changes make sure the database migration is not performed on
>> the older version of pgAdmin4 and this way the same database will work
>> irrespective of pgAdmin4 version.
>>
>> Also, this will only work for future pgAdmin4 versions.
>>
>> Please find attached patch and review.
>>
>> Thanks,
>> Surinder
>>
>
>


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

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


Re: [pgAdmin4][Patch]: Allow user to provide custom SSL certificates and provide .pgpass file

2017-08-29 Thread Dave Page
Hi

On Fri, Aug 25, 2017 at 2:45 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find updated patch,
> - For displaying hidden files I have added preference option in Storage
> section.
>

How painful would it be to include it on the file dialogue as well?


> - Updated Docs & Screenshots.
> - User can use 'prefer' option to enable SSL options.
>

Cool.

A couple of other things I realised in playing with this:

1) The SSL tab should come before Advanced I think.

2) The docs now mention the default SSL files. In server mode, using
defaults is probably a bad idea I suspect (because they would be shared).
Should we force the values to /dev/null (and whatever is appropriate on
Windows) if running in server mode? Users can always override that with
something from their storage area.

Thoughts?

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

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


Re: [pgaweb][patch] Use https link for git repo

2017-08-29 Thread Matthew Kleiman
bump.

On Tue, Aug 15, 2017 at 3:58 AM Matthew Kleiman  wrote:

> Hi Hackers,
>
> As per discussion on
> https://www.postgresql.org/message-id/flat/CAGRPzo-_dSYr5Y1D%2B0uBLo39Bb6MVTg3%3DCM%3DhrmX7LdF%3DfQbhQ%40mail.gmail.com#CAGRPzo-_dSYr5Y1D+0uBLo39Bb6MVTg3=CM=hrmX7LdF=fq...@mail.gmail.com,
> I've updated the pgadmin website with the attached patch. Instead of the
> docs pointing developers to an ssh repo link, it points them to https.
>
> Thanks,
> Matt
>


Re: [pgaweb][patch] Use https link for git repo

2017-08-29 Thread Dave Page
On Tue, Aug 29, 2017 at 3:30 PM, Matthew Kleiman 
wrote:

> bump.
>
> On Tue, Aug 15, 2017 at 3:58 AM Matthew Kleiman 
> wrote:
>
>> Hi Hackers,
>>
>> As per discussion on https://www.postgresql.org/message-id/flat/CAGRPzo-_
>> dSYr5Y1D%2B0uBLo39Bb6MVTg3%3DCM%3DhrmX7LdF%3DfQbhQ%
>> 40mail.gmail.com#CAGRPzo-_dSYr5Y1D+0uBLo39Bb6MVTg3=CM=
>> hrmX7LdF=fq...@mail.gmail.com, I've updated the pgadmin website with the
>> attached patch. Instead of the docs pointing developers to an ssh repo
>> link, it points them to https.
>>
>>
Hi

I prefer to keep it as git:// - I've seen caching weirdness with http(s) in
the past.

git:// is supported, and per the thread, Magnus did fix the issue seen. Is
there any other reason to change it?

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

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


Re: [pgaweb][patch] Use https link for git repo

2017-08-29 Thread Magnus Hagander
On Tue, Aug 29, 2017 at 4:45 PM, Dave Page  wrote:

>
>
> On Tue, Aug 29, 2017 at 3:30 PM, Matthew Kleiman 
> wrote:
>
>> bump.
>>
>> On Tue, Aug 15, 2017 at 3:58 AM Matthew Kleiman 
>> wrote:
>>
>>> Hi Hackers,
>>>
>>> As per discussion on https://www.postgresql.org/
>>> message-id/flat/CAGRPzo-_dSYr5Y1D%2B0uBLo39Bb6MVTg3%3DCM%
>>> 3DhrmX7LdF%3DfQbhQ%40mail.gmail.com#CAGRPzo-_dSYr5Y1D+
>>> 0uBLo39Bb6MVTg3=CM=hrmX7LdF=fq...@mail.gmail.com, I've updated the
>>> pgadmin website with the attached patch. Instead of the docs pointing
>>> developers to an ssh repo link, it points them to https.
>>>
>>>
> Hi
>
> I prefer to keep it as git:// - I've seen caching weirdness with http(s)
> in the past.
>

Those weirdnesses *should* all be gone if it uses the smart http mode,
which we didn't support until a few weeks ago, but do now.



> git:// is supported, and per the thread, Magnus did fix the issue seen. Is
> there any other reason to change it?
>
>
Security? In particular, MITM:ing initial connections etc.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/ 
 Work: https://www.redpill-linpro.com/ 


Re: [pgaweb][patch] Use https link for git repo

2017-08-29 Thread Dave Page
On Tue, Aug 29, 2017 at 3:55 PM, Magnus Hagander 
wrote:

>
>
> On Tue, Aug 29, 2017 at 4:45 PM, Dave Page  wrote:
>
>>
>>
>> On Tue, Aug 29, 2017 at 3:30 PM, Matthew Kleiman 
>> wrote:
>>
>>> bump.
>>>
>>> On Tue, Aug 15, 2017 at 3:58 AM Matthew Kleiman 
>>> wrote:
>>>
 Hi Hackers,

 As per discussion on https://www.postgresql.org/
 message-id/flat/CAGRPzo-_dSYr5Y1D%2B0uBLo39Bb6MVTg3%3DCM%3Dh
 rmX7LdF%3DfQbhQ%40mail.gmail.com#CAGRPzo-_dSYr5Y1D+0uBLo39B
 b6MVTg3=CM=hrmX7LdF=fq...@mail.gmail.com, I've updated the pgadmin
 website with the attached patch. Instead of the docs pointing developers to
 an ssh repo link, it points them to https.


>> Hi
>>
>> I prefer to keep it as git:// - I've seen caching weirdness with http(s)
>> in the past.
>>
>
> Those weirdnesses *should* all be gone if it uses the smart http mode,
> which we didn't support until a few weeks ago, but do now.
>
>
>
>> git:// is supported, and per the thread, Magnus did fix the issue seen.
>> Is there any other reason to change it?
>>
>>
> Security? In particular, MITM:ing initial connections etc.
>

Good point.

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

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


pgAdmin4: Cleanup in role dependency test cases

2017-08-29 Thread Navnath Gadakh
Hi Dave,

Role dependency test cases are failing due to database error *'ERROR: cache
lookup failed for database XX'. *Test-suite throwing error on* "DROP
ROLE ".*
This is intermittent issue I was executing test cases on all
servers (pg9.2-10 and ppas9.2-10)

Somehow the 'DROP database' didn't drop the shared dependencies correctly
in role dependency test cases.
PostgreSQL still thinks that Role owns 1 table in the database which is
dropped now .Due to that role was not able to drop.
This could be a bug in PG. Anyway, since the database is dropped, it is
safe to manually remove the user as it is not of any use more.


Please find the patch.

Thanks.

-- 
Regards,
Navnath Gadakh

EnterpriseDB Corporation
The Enterprise PostgreSQL Company


role_dependencies_tests_modification_v1.patch
Description: Binary data


[pgAdmin4][Patch] ACI tree compatible with Greenplum

2017-08-29 Thread Teng Zhang
Hi Hackers,

Attached is a patch that makes ACI tree works better with Greenplum.

When connected to a Greenplum database server
- Hide items that not work with GPDB, such as Triggers, FDW, FTS_*, etc
- Tables/Views/Catalogs/Language node can expand correctly
- Views/Languages/Catalogs can show properties dialog with correct
information
- Show a greenplum icon at the server node

Regards,
Teng Zhang & Hao Wang
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py 
b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
index c4c841a4..fd0e8e3a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
@@ -53,6 +53,7 @@ class CastModule(CollectionNodeModule):
 
 def __init__(self, *args, **kwargs):
 super(CastModule, self).__init__(*args, **kwargs)
+self.min_gpdbver = 10
 
 def get_nodes(self, gid, sid, did):
 """
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
 
b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
index 603b7f9e..32dc151c 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
@@ -60,6 +60,7 @@ class EventTriggerModule(CollectionNodeModule):
 super(EventTriggerModule, self).__init__(*args, **kwargs)
 self.min_ver = 90300
 self.max_ver = None
+self.min_gpdbver = 10
 
 def get_nodes(self, gid, sid, did):
 """
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py 
b/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py
index 8d9d108f..46a09237 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py
@@ -60,6 +60,7 @@ class ExtensionModule(CollectionNodeModule):
 Initialising the base class
 """
 super(ExtensionModule, self).__init__(*args, **kwargs)
+self.min_gpdbver = 10
 
 def get_nodes(self, gid, sid, did):
 """
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py
 
b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py
index d4ba568e..5b6624d5 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py
@@ -64,6 +64,7 @@ class ForeignDataWrapperModule(CollectionNodeModule):
 self.max_ver = None
 
 super(ForeignDataWrapperModule, self).__init__(*args, **kwargs)
+self.min_gpdbver = 10
 
 def get_nodes(self, gid, sid, did):
 """
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py 
b/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py
index b1e796e6..80ba7c70 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py
@@ -223,7 +223,9 @@ class LanguageView(PGChildNodeView):
 self.manager = self.driver.connection_manager(kwargs['sid'])
 self.conn = self.manager.connection(did=kwargs['did'])
 # Set the template path for the SQL scripts
-self.template_path = 
"languages/sql/#{0}#".format(self.manager.version)
+self.template_path = 
("languages/sql/#gpdb#{0}#".format(self.manager.version)
+if self.manager.server_type == 'gpdb'
+else 
"languages/sql/#{0}#".format(self.manager.version))
 
 return f(*args, **kwargs)
 
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/gpdb_5.0_plus/acl.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/gpdb_5.0_plus/acl.sql
new file mode 100644
index ..ef55a511
--- /dev/null
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/gpdb_5.0_plus/acl.sql
@@ -0,0 +1,34 @@
+SELECT 'lanacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname 
grantor,
+array_agg(privilege_type) as privileges, array_agg(is_grantable) as 
grantable
+FROM
+(SELECT
+d.grantee, d.grantor, d.is_grantable,
+CASE d.privilege_type
+WHEN 'USAGE' THEN 'U'
+ELSE 'UNKNOWN'
+END AS privilege_type
+FROM
+(SELECT lanacl FROM pg_language lan
+LEFT OUTER JOIN pg_shdescription descr ON (lan.oid=descr.objoid 
AND descr.classoid='pg_language'::regclass)
+WHERE lan.oid = {{ lid|qtLiteral }}::OID
+