Error using pgadmin4 HEAD

2017-07-27 Thread Dave Cramer
When I start pgadmin4 application I get the following error

The application server could not be contacted!

Thanks,

Dave Cramer


Re: Error using pgadmin4 HEAD

2017-07-28 Thread Dave Cramer
Hi Kushboo,

Thanks for the quick reply. I compiled it from HEAD. I will follow the
instructions for deployment and get back to you .

Dave

Dave Cramer

On 27 July 2017 at 21:59, Khushboo Vashi 
wrote:

> Hi Dave,
>
> Please provide below information to investigate:
>
> 1. OS Details
> 2. pgAdmin 4 version
> 3. The steps you followed to install the application
>
>
> pgAdmin 4 documentation
> <https://www.pgadmin.org/docs/pgadmin4/1.x/deployment.html> to help in
> deployment process.
>
> Thanks,
> Khushboo
>
> On Fri, Jul 28, 2017 at 3:08 AM, Dave Cramer  wrote:
>
>> When I start pgadmin4 application I get the following error
>>
>> The application server could not be contacted!
>>
>> Thanks,
>>
>> Dave Cramer
>>
>
>


Re: Error using pgadmin4 HEAD

2017-07-28 Thread Dave Cramer
OK,

I am running macos 10.12.6
compiled from source using QT5.5clang
using current HEAD version
followed the instructions config_local has SERVER_MODE = False
python setup.py does not error

from the runtime dir executed 'open pgadmin4.app'

The error message is the same "The application server could not be
contacted"

Thanks,

Dave Cramer

On 28 July 2017 at 07:49, Dave Cramer  wrote:

> Hi Kushboo,
>
> Thanks for the quick reply. I compiled it from HEAD. I will follow the
> instructions for deployment and get back to you .
>
> Dave
>
> Dave Cramer
>
> On 27 July 2017 at 21:59, Khushboo Vashi 
> wrote:
>
>> Hi Dave,
>>
>> Please provide below information to investigate:
>>
>> 1. OS Details
>> 2. pgAdmin 4 version
>> 3. The steps you followed to install the application
>>
>>
>> pgAdmin 4 documentation
>> <https://www.pgadmin.org/docs/pgadmin4/1.x/deployment.html> to help in
>> deployment process.
>>
>> Thanks,
>> Khushboo
>>
>> On Fri, Jul 28, 2017 at 3:08 AM, Dave Cramer 
>> wrote:
>>
>>> When I start pgadmin4 application I get the following error
>>>
>>> The application server could not be contacted!
>>>
>>> Thanks,
>>>
>>> Dave Cramer
>>>
>>
>>
>


Re: Error using pgadmin4 HEAD

2017-07-29 Thread Dave Cramer
Rob,

Will do, thanks!



Dave Cramer

On 29 July 2017 at 02:41, Robert Eckhardt  wrote:

> Dave,
>
> We just set up 3 workstations if you don't mind waiting a couple of days
> we can go in on Monday and share the directions we followed.  Maybe that
> will help spell out how we can improve the documentation as well.
>
> Rob
>
> On Jul 29, 2017 2:34 PM, "Murtuza Zabuawala"  enterprisedb.com> wrote:
>
>> Hi,
>>
>> With pgAdmin4 version 1.6, we have changed the way we bundle and serve
>> the javascript and other static files. Refer steps in this email thread
>> <https://www.postgresql.org/message-id/cakkotzst2nnzavaf4vd5fo-nm_dcq4qen4fcgydx-xabfe7...@mail.gmail.com>,
>> if you want to use it from git repository, Another way is to download and
>> use the source which is already bundled from here
>> <https://www.pgadmin.org/download/pgadmin-4-source-code/>
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Sat, Jul 29, 2017 at 2:27 AM, Dave Cramer 
>> wrote:
>>
>>> OK,
>>>
>>> I am running macos 10.12.6
>>> compiled from source using QT5.5clang
>>> using current HEAD version
>>> followed the instructions config_local has SERVER_MODE = False
>>> python setup.py does not error
>>>
>>> from the runtime dir executed 'open pgadmin4.app'
>>>
>>> The error message is the same "The application server could not be
>>> contacted"
>>>
>>> Thanks,
>>>
>>> Dave Cramer
>>>
>>> On 28 July 2017 at 07:49, Dave Cramer  wrote:
>>>
>>>> Hi Kushboo,
>>>>
>>>> Thanks for the quick reply. I compiled it from HEAD. I will follow the
>>>> instructions for deployment and get back to you .
>>>>
>>>> Dave
>>>>
>>>> Dave Cramer
>>>>
>>>> On 27 July 2017 at 21:59, Khushboo Vashi >>> om> wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> Please provide below information to investigate:
>>>>>
>>>>> 1. OS Details
>>>>> 2. pgAdmin 4 version
>>>>> 3. The steps you followed to install the application
>>>>>
>>>>>
>>>>> pgAdmin 4 documentation
>>>>> <https://www.pgadmin.org/docs/pgadmin4/1.x/deployment.html> to help
>>>>> in deployment process.
>>>>>
>>>>> Thanks,
>>>>> Khushboo
>>>>>
>>>>> On Fri, Jul 28, 2017 at 3:08 AM, Dave Cramer 
>>>>> wrote:
>>>>>
>>>>>> When I start pgadmin4 application I get the following error
>>>>>>
>>>>>> The application server could not be contacted!
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Dave Cramer
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>


Fix key error

2017-08-07 Thread Dave Cramer
I don't think this line
in web/pgadmin/browser/server_groups/servers/types.py does what it should.

default_path = config.DEFAULT_BINARY_PATHS[st.stype] or ""

will ever succeed if the key does not exist

Attached patch should work.

Dave Cramer


fixkeyerror.patch
Description: Binary data


Can someone tell me what this code does ?

2017-08-07 Thread Dave Cramer
I'm fairly new to Python so excuse my naiveté.

This code: in web/pgadmin/utils/driver/__init__.py  does not appear to load
the drivers into the drivers dictionary ? Or am I missing something

def init_app(app):
drivers = dict()

setattr(app, '_pgadmin_server_drivers', drivers)
DriverRegistry.load_drivers()

return drivers



Dave Cramer


Re: Can someone tell me what this code does ?

2017-08-08 Thread Dave Cramer
Hi,

I guess my question was a bit vague. I get that it loads drivers. But note
it does not actually put them anywhere.

First it creates a dict
sets the attribute in the app
loads the drivers dynamically
and returns an empty dict.

>From what I can tell this:

DriverRegistry.load_drivers()

is all it does?






Dave Cramer

On 7 August 2017 at 23:35, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> This piece of code allow us to dynamically import all the available driver
> modules from '../utils/driver/' directory into our application.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> <https://community.postgresrocks.net/>
>
> On Tue, Aug 8, 2017 at 4:20 AM, Dave Cramer  wrote:
>
>> I'm fairly new to Python so excuse my naiveté.
>>
>> This code: in web/pgadmin/utils/driver/__init__.py  does not appear to
>> load the drivers into the drivers dictionary ? Or am I missing something
>>
>> def init_app(app):
>> drivers = dict()
>>
>> setattr(app, '_pgadmin_server_drivers', drivers)
>> DriverRegistry.load_drivers()
>>
>> return drivers
>>
>>
>>
>> Dave Cramer
>>
>
>


Re: Can someone tell me what this code does ?

2017-08-09 Thread Dave Cramer
So what is the policy of the project? Ideally the cruft should be removed.

Would a patch doing so be committed?

Dave Cramer

On 9 August 2017 at 00:28, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Yes, you are correct, at a moment that's all it does.
>
> On Tue, Aug 8, 2017 at 6:37 PM, Dave Cramer  wrote:
>
>> Hi,
>>
>> I guess my question was a bit vague. I get that it loads drivers. But
>> note it does not actually put them anywhere.
>>
>> First it creates a dict
>> sets the attribute in the app
>> loads the drivers dynamically
>> and returns an empty dict.
>>
>> From what I can tell this:
>>
>> DriverRegistry.load_drivers()
>>
>> is all it does?
>>
>>
>>
>>
>>
>>
>> Dave Cramer
>>
>> On 7 August 2017 at 23:35, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> This piece of code allow us to dynamically import all the available
>>> driver modules from '../utils/driver/' directory into our application.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> [image: https://community.postgresrocks.net/]
>>> <https://community.postgresrocks.net/>
>>>
>>> On Tue, Aug 8, 2017 at 4:20 AM, Dave Cramer 
>>> wrote:
>>>
>>>> I'm fairly new to Python so excuse my naiveté.
>>>>
>>>> This code: in web/pgadmin/utils/driver/__init__.py  does not appear to
>>>> load the drivers into the drivers dictionary ? Or am I missing something
>>>>
>>>> def init_app(app):
>>>> drivers = dict()
>>>>
>>>> setattr(app, '_pgadmin_server_drivers', drivers)
>>>> DriverRegistry.load_drivers()
>>>>
>>>> return drivers
>>>>
>>>>
>>>>
>>>> Dave Cramer
>>>>
>>>
>>>
>>
>


Re: [pgadmin4][Patch] Greenplum specific DDL and Dashboard display

2017-08-18 Thread Dave Cramer
Hi Violet.

I don't really like the way this has been implemented. It adds a variable
which is only used for gpdb.

There are other places in the code where the behaviour is changed if the
server is ppas or regular postgres.

Candidly I think all of this needs restructuring.

Dave Cramer

On 15 August 2017 at 23:29, Violet Cheng  wrote:

> Hi,
>
> Any comment on this patch? If no, will it be committed soon?
>
> Thanks,
> Violet
>
> On Wed, Aug 9, 2017 at 12:05 PM, Sarah McAlear 
> wrote:
>
>> Hi Hackers!
>>
>> This patch enables Greenplum users to see the same charts on the
>> dashboard as postgres users. It also adds some additional information to
>> the DDL that is Greenplum specific and necessary to create a new table.
>>
>> Thanks!
>> Sarah
>>
>>
>>
>


Re: [pgadmin4][Patch] Greenplum specific DDL and Dashboard display

2017-08-22 Thread Dave Cramer
Hi,

I've been able to get back to this and test it. So far so good. It applies
more or less cleanly against 1.6 and everything I've tried so far works

I'll update more as I test it.

Thanks

Dave Cramer

On 21 August 2017 at 05:29, Teng Zhang  wrote:

> Hi,
>
> Thanks for the review, here is a fixed patch working for GBDP which shows
> the appropriate graphs.
> In this fix, we toke out the changes to diver/psycopg2 and implemented the
> greenplum version checking process in the ppas way mentioned by Dave
> Cramer.
>
> Regards,
> Teng Zhang & Hao Wang
>
> On Mon, Aug 21, 2017 at 3:55 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> On Mon, Aug 21, 2017 at 1:23 PM, Dave Page  wrote:
>>
>>> Ashesh, do you have a recommended way to do this?
>>>
>>> I haven't looked at the patch, but I assume it adds a database driver
>>> module for GPDB?
>>>
>> I have not looked at the patch yet.
>> I will take a look at it.
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> <http://www.enterprisedb.com/>
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> <http://www.linkedin.com/in/asheshvashi>
>>
>>>
>>> On Mon, Aug 21, 2017 at 8:50 AM, Jing Li  wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> Since we're hoping to get this change working for GPDB we've currently
>>>> using this method to detect if it's gpdb and show the appropriate graphs.
>>>> Right now it displays errors on the dashboard if it's connected to a gpdb
>>>> server.
>>>> For this patch specifically, the goal is to improve the experience for
>>>> greenplum users so they can get the same information as someone connected
>>>> to a postgres server.
>>>>
>>>> I do agree that this is a bigger discussion about how we handle
>>>> behavior change overall if it's regular postgres or something else. Let's
>>>> talk about how we can restructure this behavior in a wider context. Are you
>>>> open to meeting about it?
>>>>
>>>> Thanks,
>>>> ~Jing
>>>>
>>>>
>>>>
>>>> On Fri, Aug 18, 2017 5:37 AM, Dave Cramer davecra...@gmail.com wrote:
>>>>
>>>>> Hi Violet.
>>>>>
>>>>> I don't really like the way this has been implemented. It adds a
>>>>> variable which is only used for gpdb.
>>>>>
>>>>> There are other places in the code where the behaviour is changed if
>>>>> the server is ppas or regular postgres.
>>>>>
>>>>> Candidly I think all of this needs restructuring.
>>>>>
>>>>> Dave Cramer
>>>>>
>>>>> On 15 August 2017 at 23:29, Violet Cheng  wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Any comment on this patch? If no, will it be committed soon?
>>>>>
>>>>> Thanks,
>>>>> Violet
>>>>>
>>>>> On Wed, Aug 9, 2017 at 12:05 PM, Sarah McAlear 
>>>>> wrote:
>>>>>
>>>>> Hi Hackers!
>>>>>
>>>>> This patch enables Greenplum users to see the same charts on the
>>>>> dashboard as postgres users. It also adds some additional information to
>>>>> the DDL that is Greenplum specific and necessary to create a new table.
>>>>>
>>>>> Thanks!
>>>>> Sarah
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>


Re: [pgadmin4][Patch] Greenplum specific DDL and Dashboard display

2017-08-22 Thread Dave Cramer
Ok,

Surely this :

self.table_template_path = 'table/sql/' + (
+'#{0}#{1}#'.format(server_type, ver)
+if server_type == 'gpdb' else
+'#{0}#'.format(ver)
+)

could be written in a more readable manner ??


Dave Cramer

On 22 August 2017 at 14:25, Dave Cramer  wrote:

> Hi,
>
> I've been able to get back to this and test it. So far so good. It applies
> more or less cleanly against 1.6 and everything I've tried so far works
>
> I'll update more as I test it.
>
> Thanks
>
> Dave Cramer
>
> On 21 August 2017 at 05:29, Teng Zhang  wrote:
>
>> Hi,
>>
>> Thanks for the review, here is a fixed patch working for GBDP which shows
>> the appropriate graphs.
>> In this fix, we toke out the changes to diver/psycopg2 and
>> implemented the greenplum version checking process in the ppas way
>> mentioned by Dave Cramer.
>>
>> Regards,
>> Teng Zhang & Hao Wang
>>
>> On Mon, Aug 21, 2017 at 3:55 PM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> On Mon, Aug 21, 2017 at 1:23 PM, Dave Page  wrote:
>>>
>>>> Ashesh, do you have a recommended way to do this?
>>>>
>>>> I haven't looked at the patch, but I assume it adds a database driver
>>>> module for GPDB?
>>>>
>>> I have not looked at the patch yet.
>>> I will take a look at it.
>>>
>>> --
>>>
>>> Thanks & Regards,
>>>
>>> Ashesh Vashi
>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>> <http://www.enterprisedb.com/>
>>>
>>>
>>> *http://www.linkedin.com/in/asheshvashi*
>>> <http://www.linkedin.com/in/asheshvashi>
>>>
>>>>
>>>> On Mon, Aug 21, 2017 at 8:50 AM, Jing Li  wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> Since we're hoping to get this change working for GPDB we've currently
>>>>> using this method to detect if it's gpdb and show the appropriate graphs.
>>>>> Right now it displays errors on the dashboard if it's connected to a gpdb
>>>>> server.
>>>>> For this patch specifically, the goal is to improve the experience for
>>>>> greenplum users so they can get the same information as someone connected
>>>>> to a postgres server.
>>>>>
>>>>> I do agree that this is a bigger discussion about how we handle
>>>>> behavior change overall if it's regular postgres or something else. Let's
>>>>> talk about how we can restructure this behavior in a wider context. Are 
>>>>> you
>>>>> open to meeting about it?
>>>>>
>>>>> Thanks,
>>>>> ~Jing
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Aug 18, 2017 5:37 AM, Dave Cramer davecra...@gmail.com wrote:
>>>>>
>>>>>> Hi Violet.
>>>>>>
>>>>>> I don't really like the way this has been implemented. It adds a
>>>>>> variable which is only used for gpdb.
>>>>>>
>>>>>> There are other places in the code where the behaviour is changed if
>>>>>> the server is ppas or regular postgres.
>>>>>>
>>>>>> Candidly I think all of this needs restructuring.
>>>>>>
>>>>>> Dave Cramer
>>>>>>
>>>>>> On 15 August 2017 at 23:29, Violet Cheng  wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Any comment on this patch? If no, will it be committed soon?
>>>>>>
>>>>>> Thanks,
>>>>>> Violet
>>>>>>
>>>>>> On Wed, Aug 9, 2017 at 12:05 PM, Sarah McAlear 
>>>>>> wrote:
>>>>>>
>>>>>> Hi Hackers!
>>>>>>
>>>>>> This patch enables Greenplum users to see the same charts on the
>>>>>> dashboard as postgres users. It also adds some additional information to
>>>>>> the DDL that is Greenplum specific and necessary to create a new table.
>>>>>>
>>>>>> Thanks!
>>>>>> Sarah
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>> --
>>>> Dave Page
>>>> Blog: http://pgsnake.blogspot.com
>>>> Twitter: @pgsnake
>>>>
>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>> The Enterprise PostgreSQL Company
>>>>
>>>
>>>
>>
>


Re: [pgadmin4][Patch] Greenplum specific DDL and Dashboard display

2017-08-22 Thread Dave Cramer
On 22 August 2017 at 16:41, Dave Cramer  wrote:

> Ok,
>
> Surely this :
>
> self.table_template_path = 'table/sql/' + (
> +'#{0}#{1}#'.format(server_type, ver)
> +if server_type == 'gpdb' else
> +'#{0}#'.format(ver)
> +)
>
> could be written in a more readable manner ??
>
>
>
Apologies, after reading a bit, this is apparently idiomatic python.

Please ignore


> Dave Cramer
>
> On 22 August 2017 at 14:25, Dave Cramer  wrote:
>
>> Hi,
>>
>> I've been able to get back to this and test it. So far so good. It
>> applies more or less cleanly against 1.6 and everything I've tried so far
>> works
>>
>> I'll update more as I test it.
>>
>> Thanks
>>
>> Dave Cramer
>>
>> On 21 August 2017 at 05:29, Teng Zhang  wrote:
>>
>>> Hi,
>>>
>>> Thanks for the review, here is a fixed patch working for GBDP which
>>> shows the appropriate graphs.
>>> In this fix, we toke out the changes to diver/psycopg2 and
>>> implemented the greenplum version checking process in the ppas way
>>> mentioned by Dave Cramer.
>>>
>>> Regards,
>>> Teng Zhang & Hao Wang
>>>
>>> On Mon, Aug 21, 2017 at 3:55 PM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
>>>> On Mon, Aug 21, 2017 at 1:23 PM, Dave Page  wrote:
>>>>
>>>>> Ashesh, do you have a recommended way to do this?
>>>>>
>>>>> I haven't looked at the patch, but I assume it adds a database driver
>>>>> module for GPDB?
>>>>>
>>>> I have not looked at the patch yet.
>>>> I will take a look at it.
>>>>
>>>> --
>>>>
>>>> Thanks & Regards,
>>>>
>>>> Ashesh Vashi
>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>>> <http://www.enterprisedb.com/>
>>>>
>>>>
>>>> *http://www.linkedin.com/in/asheshvashi*
>>>> <http://www.linkedin.com/in/asheshvashi>
>>>>
>>>>>
>>>>> On Mon, Aug 21, 2017 at 8:50 AM, Jing Li  wrote:
>>>>>
>>>>>> Hi Dave,
>>>>>>
>>>>>> Since we're hoping to get this change working for GPDB we've
>>>>>> currently using this method to detect if it's gpdb and show the 
>>>>>> appropriate
>>>>>> graphs. Right now it displays errors on the dashboard if it's connected 
>>>>>> to
>>>>>> a gpdb server.
>>>>>> For this patch specifically, the goal is to improve the experience
>>>>>> for greenplum users so they can get the same information as someone
>>>>>> connected to a postgres server.
>>>>>>
>>>>>> I do agree that this is a bigger discussion about how we handle
>>>>>> behavior change overall if it's regular postgres or something else. Let's
>>>>>> talk about how we can restructure this behavior in a wider context. Are 
>>>>>> you
>>>>>> open to meeting about it?
>>>>>>
>>>>>> Thanks,
>>>>>> ~Jing
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Aug 18, 2017 5:37 AM, Dave Cramer davecra...@gmail.com wrote:
>>>>>>
>>>>>>> Hi Violet.
>>>>>>>
>>>>>>> I don't really like the way this has been implemented. It adds a
>>>>>>> variable which is only used for gpdb.
>>>>>>>
>>>>>>> There are other places in the code where the behaviour is changed if
>>>>>>> the server is ppas or regular postgres.
>>>>>>>
>>>>>>> Candidly I think all of this needs restructuring.
>>>>>>>
>>>>>>> Dave Cramer
>>>>>>>
>>>>>>> On 15 August 2017 at 23:29, Violet Cheng  wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Any comment on this patch? If no, will it be committed soon?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Violet
>>>>>>>
>>>>>>> On Wed, Aug 9, 2017 at 12:05 PM, Sarah McAlear 
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hi Hackers!
>>>>>>>
>>>>>>> This patch enables Greenplum users to see the same charts on the
>>>>>>> dashboard as postgres users. It also adds some additional information to
>>>>>>> the DDL that is Greenplum specific and necessary to create a new table.
>>>>>>>
>>>>>>> Thanks!
>>>>>>> Sarah
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Dave Page
>>>>> Blog: http://pgsnake.blogspot.com
>>>>> Twitter: @pgsnake
>>>>>
>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>> The Enterprise PostgreSQL Company
>>>>>
>>>>
>>>>
>>>
>>
>


Re: [pgadmin4][Patch] Greenplum specific DDL and Dashboard display

2017-08-24 Thread Dave Cramer
Can we get some movement on this patch? This seems like a more sane way to
go to support different "products"

Dave Cramer

On 22 August 2017 at 16:56, Dave Cramer  wrote:

>
> On 22 August 2017 at 16:41, Dave Cramer  wrote:
>
>> Ok,
>>
>> Surely this :
>>
>> self.table_template_path = 'table/sql/' + (
>> +'#{0}#{1}#'.format(server_type, ver)
>> +if server_type == 'gpdb' else
>> +'#{0}#'.format(ver)
>> +)
>>
>> could be written in a more readable manner ??
>>
>>
>>
> Apologies, after reading a bit, this is apparently idiomatic python.
>
> Please ignore
>
>
>> Dave Cramer
>>
>> On 22 August 2017 at 14:25, Dave Cramer  wrote:
>>
>>> Hi,
>>>
>>> I've been able to get back to this and test it. So far so good. It
>>> applies more or less cleanly against 1.6 and everything I've tried so far
>>> works
>>>
>>> I'll update more as I test it.
>>>
>>> Thanks
>>>
>>> Dave Cramer
>>>
>>> On 21 August 2017 at 05:29, Teng Zhang  wrote:
>>>
>>>> Hi,
>>>>
>>>> Thanks for the review, here is a fixed patch working for GBDP which
>>>> shows the appropriate graphs.
>>>> In this fix, we toke out the changes to diver/psycopg2 and
>>>> implemented the greenplum version checking process in the ppas way
>>>> mentioned by Dave Cramer.
>>>>
>>>> Regards,
>>>> Teng Zhang & Hao Wang
>>>>
>>>> On Mon, Aug 21, 2017 at 3:55 PM, Ashesh Vashi <
>>>> ashesh.va...@enterprisedb.com> wrote:
>>>>
>>>>> On Mon, Aug 21, 2017 at 1:23 PM, Dave Page  wrote:
>>>>>
>>>>>> Ashesh, do you have a recommended way to do this?
>>>>>>
>>>>>> I haven't looked at the patch, but I assume it adds a database driver
>>>>>> module for GPDB?
>>>>>>
>>>>> I have not looked at the patch yet.
>>>>> I will take a look at it.
>>>>>
>>>>> --
>>>>>
>>>>> Thanks & Regards,
>>>>>
>>>>> Ashesh Vashi
>>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>>>> <http://www.enterprisedb.com/>
>>>>>
>>>>>
>>>>> *http://www.linkedin.com/in/asheshvashi*
>>>>> <http://www.linkedin.com/in/asheshvashi>
>>>>>
>>>>>>
>>>>>> On Mon, Aug 21, 2017 at 8:50 AM, Jing Li  wrote:
>>>>>>
>>>>>>> Hi Dave,
>>>>>>>
>>>>>>> Since we're hoping to get this change working for GPDB we've
>>>>>>> currently using this method to detect if it's gpdb and show the 
>>>>>>> appropriate
>>>>>>> graphs. Right now it displays errors on the dashboard if it's connected 
>>>>>>> to
>>>>>>> a gpdb server.
>>>>>>> For this patch specifically, the goal is to improve the experience
>>>>>>> for greenplum users so they can get the same information as someone
>>>>>>> connected to a postgres server.
>>>>>>>
>>>>>>> I do agree that this is a bigger discussion about how we handle
>>>>>>> behavior change overall if it's regular postgres or something else. 
>>>>>>> Let's
>>>>>>> talk about how we can restructure this behavior in a wider context. Are 
>>>>>>> you
>>>>>>> open to meeting about it?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> ~Jing
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Aug 18, 2017 5:37 AM, Dave Cramer davecra...@gmail.com
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Violet.
>>>>>>>>
>>>>>>>> I don't really like the way this has been implemented. It adds a
>>>>>>>> variable which is only used for gpdb.
>>>>>>>>
>>>>>>>> There are other places in the code where the behaviour is changed
>>>>>>>> if the server is ppas or regular postgres.
>>>>>>>>
>>>>>>>> Candidly I think all of this needs restructuring.
>>>>>>>>
>>>>>>>> Dave Cramer
>>>>>>>>
>>>>>>>> On 15 August 2017 at 23:29, Violet Cheng  wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Any comment on this patch? If no, will it be committed soon?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Violet
>>>>>>>>
>>>>>>>> On Wed, Aug 9, 2017 at 12:05 PM, Sarah McAlear >>>>>>> > wrote:
>>>>>>>>
>>>>>>>> Hi Hackers!
>>>>>>>>
>>>>>>>> This patch enables Greenplum users to see the same charts on the
>>>>>>>> dashboard as postgres users. It also adds some additional information 
>>>>>>>> to
>>>>>>>> the DDL that is Greenplum specific and necessary to create a new table.
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>> Sarah
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Dave Page
>>>>>> Blog: http://pgsnake.blogspot.com
>>>>>> Twitter: @pgsnake
>>>>>>
>>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>>> The Enterprise PostgreSQL Company
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: [pgadmin4][Patch] Greenplum specific DDL and Dashboard display

2017-08-25 Thread Dave Cramer
I'm suggesting that it be pushed

Dave Cramer

On 24 August 2017 at 23:00, Teng Zhang  wrote:

> Sure, you can get as much as you like.
> Thanks
>
> -- Forwarded message ------
> From: Dave Cramer 
> Date: Thu, Aug 24, 2017 at 8:34 PM
> Subject: Re: [pgadmin4][Patch] Greenplum specific DDL and Dashboard display
> To: Teng Zhang 
> Cc: Ashesh Vashi , pgadmin-hackers <
> pgadmin-hack...@postgresql.org>, Dave Page , Jing Li <
> jin...@pivotal.io>
>
>
> Can we get some movement on this patch? This seems like a more sane way to
> go to support different "products"
>
> Dave Cramer
>
> On 22 August 2017 at 16:56, Dave Cramer  wrote:
>
>>
>> On 22 August 2017 at 16:41, Dave Cramer  wrote:
>>
>>> Ok,
>>>
>>> Surely this :
>>>
>>> self.table_template_path = 'table/sql/' + (
>>> +'#{0}#{1}#'.format(server_type, ver)
>>> +if server_type == 'gpdb' else
>>> +'#{0}#'.format(ver)
>>> +    )
>>>
>>> could be written in a more readable manner ??
>>>
>>>
>>>
>> Apologies, after reading a bit, this is apparently idiomatic python.
>>
>> Please ignore
>>
>>
>>> Dave Cramer
>>>
>>> On 22 August 2017 at 14:25, Dave Cramer  wrote:
>>>
>>>> Hi,
>>>>
>>>> I've been able to get back to this and test it. So far so good. It
>>>> applies more or less cleanly against 1.6 and everything I've tried so far
>>>> works
>>>>
>>>> I'll update more as I test it.
>>>>
>>>> Thanks
>>>>
>>>> Dave Cramer
>>>>
>>>> On 21 August 2017 at 05:29, Teng Zhang  wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Thanks for the review, here is a fixed patch working for GBDP which
>>>>> shows the appropriate graphs.
>>>>> In this fix, we toke out the changes to diver/psycopg2 and
>>>>> implemented the greenplum version checking process in the ppas way
>>>>> mentioned by Dave Cramer.
>>>>>
>>>>> Regards,
>>>>> Teng Zhang & Hao Wang
>>>>>
>>>>> On Mon, Aug 21, 2017 at 3:55 PM, Ashesh Vashi <
>>>>> ashesh.va...@enterprisedb.com> wrote:
>>>>>
>>>>>> On Mon, Aug 21, 2017 at 1:23 PM, Dave Page  wrote:
>>>>>>
>>>>>>> Ashesh, do you have a recommended way to do this?
>>>>>>>
>>>>>>> I haven't looked at the patch, but I assume it adds a database
>>>>>>> driver module for GPDB?
>>>>>>>
>>>>>> I have not looked at the patch yet.
>>>>>> I will take a look at it.
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Thanks & Regards,
>>>>>>
>>>>>> Ashesh Vashi
>>>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>>>>> <http://www.enterprisedb.com/>
>>>>>>
>>>>>>
>>>>>> *http://www.linkedin.com/in/asheshvashi*
>>>>>> <http://www.linkedin.com/in/asheshvashi>
>>>>>>
>>>>>>>
>>>>>>> On Mon, Aug 21, 2017 at 8:50 AM, Jing Li  wrote:
>>>>>>>
>>>>>>>> Hi Dave,
>>>>>>>>
>>>>>>>> Since we're hoping to get this change working for GPDB we've
>>>>>>>> currently using this method to detect if it's gpdb and show the 
>>>>>>>> appropriate
>>>>>>>> graphs. Right now it displays errors on the dashboard if it's 
>>>>>>>> connected to
>>>>>>>> a gpdb server.
>>>>>>>> For this patch specifically, the goal is to improve the experience
>>>>>>>> for greenplum users so they can get the same information as someone
>>>>>>>> connected to a postgres server.
>>>>>>>>
>>>>>>>> I do agree that this is a bigger discussion about how we handle
>>>>>>>> behavior change overall if it's regular postgres or something else. 
>>>>>>>> Let's
>>>>>>>> talk about how we can restructure this behavior in a wider context. 
>>>>>>>> Are you
>>>>>>>> open to meeting about it?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> ~Jing
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Aug 18, 2017 5:37 AM, Dave Cramer davecra...@gmail.com
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi Violet.
>>>>>>>>>
>>>>>>>>> I don't really like the way this has been implemented. It adds a
>>>>>>>>> variable which is only used for gpdb.
>>>>>>>>>
>>>>>>>>> There are other places in the code where the behaviour is changed
>>>>>>>>> if the server is ppas or regular postgres.
>>>>>>>>>
>>>>>>>>> Candidly I think all of this needs restructuring.
>>>>>>>>>
>>>>>>>>> Dave Cramer
>>>>>>>>>
>>>>>>>>> On 15 August 2017 at 23:29, Violet Cheng 
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Any comment on this patch? If no, will it be committed soon?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Violet
>>>>>>>>>
>>>>>>>>> On Wed, Aug 9, 2017 at 12:05 PM, Sarah McAlear <
>>>>>>>>> smcal...@pivotal.io> wrote:
>>>>>>>>>
>>>>>>>>> Hi Hackers!
>>>>>>>>>
>>>>>>>>> This patch enables Greenplum users to see the same charts on the
>>>>>>>>> dashboard as postgres users. It also adds some additional information 
>>>>>>>>> to
>>>>>>>>> the DDL that is Greenplum specific and necessary to create a new 
>>>>>>>>> table.
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>> Sarah
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Dave Page
>>>>>>> Blog: http://pgsnake.blogspot.com
>>>>>>> Twitter: @pgsnake
>>>>>>>
>>>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>>>> The Enterprise PostgreSQL Company
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>


fix keyerror problems

2017-08-25 Thread Dave Cramer
See attached patch


Dave Cramer


keyerror.patch
Description: Binary data


Re: fix keyerror problems

2017-08-25 Thread Dave Cramer
Even better.

I'm a python noob so help me out!

Dave Cramer

On 25 August 2017 at 15:17, Harshal Dhumal 
wrote:

> how about this?
>
> default_path = (
> config.DEFAULT_BINARY_PATHS.get(st.stype, "")
>  )
>
>
>
>
> On Sat, Aug 26, 2017 at 12:24 AM, Dave Cramer 
> wrote:
>
>> See attached patch
>>
>>
>> Dave Cramer
>>
>
>


fix get_types for GPDB

2017-08-30 Thread Dave Cramer
This patch allows create column to see available types in the dropdown


Dave Cramer
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
index 11d40dd..ef08d48 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
@@ -111,6 +111,11 @@ class BaseTableView(PGChildNodeView):
 if server_type == 'gpdb' else
 '#{0}#'.format(ver)
 )
+self.data_type_template_path='datatype/sql/'+ (
+'#{0}#{1}#'.format(server_type, ver)
+if server_type == 'gpdb' else
+'#{0}#'.format(ver)
+)
 self.partition_template_path = 'partition/sql/#{0}#'.format(ver)
 
 # Template for Column ,check constraint and exclusion
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/datatype/sql/gpdb_5.0_plus/get_types.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/datatype/sql/gpdb_5.0_plus/get_types.sql
new file mode 100644
index 000..7634321
--- /dev/null
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/datatype/sql/gpdb_5.0_plus/get_types.sql
@@ -0,0 +1,25 @@
+SELECT
+*
+FROM
+(SELECT
+format_type(t.oid,NULL) AS typname,
+CASE WHEN typelem > 0 THEN typelem ELSE t.oid END as elemoid,
+typlen, typtype, t.oid, nspname,
+(SELECT COUNT(1) FROM pg_type t2 WHERE t2.typname = t.typname) > 1 AS 
isdup,
+FALSE  AS is_collatable
+FROM
+pg_type t
+JOIN
+pg_namespace nsp ON typnamespace=nsp.oid
+WHERE
+(NOT (typname = 'unknown' AND nspname = 'pg_catalog'))
+AND
+{{ condition }}
+{% if add_serials %}
+{# Here we will add serials types manually #}
+UNION SELECT 'smallserial', 0, 2, 'b', 0, 'pg_catalog', false, false
+UNION SELECT 'bigserial', 0, 8, 'b', 0, 'pg_catalog', false, false
+UNION SELECT 'serial', 0, 4, 'b', 0, 'pg_catalog', false, false
+{% endif %}
+) AS dummy
+ORDER BY nspname <> 'pg_catalog', nspname <> 'public', nspname, 1
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
index 085ab43..e086290 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
@@ -233,8 +233,14 @@ class TypeView(PGChildNodeView, DataTypeReader):
 # Declare allows acl on type
 self.acl = ['U']
 
-# we will set template path for sql scripts
-self.template_path = 'type/sql/#{0}#'.format(self.manager.version)
+ver = self.manager.version
+server_type = self.manager.server_type
+# Set the template path for the SQL scripts
+self.template_path = 'type/sql/' + (
+'#{0}#{1}#'.format(server_type, ver)
+if server_type == 'gpdb' else
+'#{0}#'.format(ver)
+)
 
 return f(*args, **kwargs)
 return wrap
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py
index 852724d..69e94b1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py
@@ -95,7 +95,7 @@ class DataTypeReader:
 try:
 
 SQL = render_template(
-
'/datatype/sql/#{0}#/get_types.sql'.format(conn.manager.version),
+"/".join([self.data_type_template_path,'get_types.sql']),
 condition=condition,
 add_serials=add_serials)
 status, rset = conn.execute_2darray(SQL)