public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM#1420 - Reverse engineered SQL incomplete for Databases
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch]: RM#1420 - Reverse engineered SQL incomplete for Databases
@ 2016-07-11 09:58  Surinder Kumar <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Surinder Kumar @ 2016-07-11 09:58 UTC (permalink / raw)
  To: pgadmin-hackers

Hi

Please find attached patch with fix and review.
Included missing Create and Drop comments in generated sql query.

Thanks,
Surinder Kumar


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


Attachments:

  [application/octet-stream] RM#1420.patch (786B, 3-RM%231420.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/__init__.py
index 1f7fd07..08b682d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/__init__.py
@@ -860,8 +860,16 @@ class DatabaseView(PGChildNodeView):
         frmtd_variables = parse_variables_from_db(res1['rows'])
         result.update(frmtd_variables)

+        sql_header = """
+-- Database: {0}
+
+-- DROP DATABASE {0};
+
+""".format(result['name'])
+
         SQL = self.get_new_sql(gid, sid, result, did)
         SQL = re.sub('\n{2,}', '\n\n', SQL)
+        SQL = sql_header + SQL
         SQL = SQL.strip('\n')
         return ajax_response(response=SQL)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin4][Patch]: RM#1420 - Reverse engineered SQL incomplete for Databases
@ 2016-07-13 11:42  Dave Page <[email protected]>
  parent: Surinder Kumar <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2016-07-13 11:42 UTC (permalink / raw)
  To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers

Thanks, applied.

On Mon, Jul 11, 2016 at 10:58 AM, Surinder Kumar
<[email protected]> wrote:
> Hi
>
> Please find attached patch with fix and review.
> Included missing Create and Drop comments in generated sql query.
>
> Thanks,
> Surinder Kumar
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> 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


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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-07-13 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-07-11 09:58 [pgAdmin4][Patch]: RM#1420 - Reverse engineered SQL incomplete for Databases Surinder Kumar <[email protected]>
2016-07-13 11:42 ` Dave Page <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox