Re: [pgAdmin4][Patch]: RM1592 - Download as CSV should be supported for DDL

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: RM1592 - Download as CSV should be supported for DDL
Date: 2016-09-19 15:18:41
Message-ID: CA+OCxoyUdxLTM-X8+wVjTngOR5X+RL4o+WK8DF=M3EOa3Md=ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Mon, Sep 19, 2016 at 3:03 PM, Surinder Kumar
<surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
> Hi
>
> Please find attached patch with fix.
>>
>> Download as CSV
>> button should be enabled only for SELECT queries.

I'm not sure there's a way to do this without parsing the query.
Simply matching on ^select certainly won't work reliably - for
example, there could be multiple statements in the script, or it could
be PERFORM ... or UPDATE ... RETURNING ...

I think we need to leave the button enabled, but give the user a
message if no data is returned, e.g.

=======
Download as CSV
-------------------------

The query executed did not return any data.

[OK]
========

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

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

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Surinder Kumar 2016-09-19 15:23:52 [pgAdmin4][Patch]: RM1627 - Objects are not visible after creation until press refresh button
Previous Message Dave Page 2016-09-19 14:58:10 Re: PATCH: To fix the issue where user gets error following application server restart (pgAdmin4)