public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin4][Patch]: RM1588 - User can not change the code of header through right if package created without body
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin4][Patch]: RM1588 - User can not change the code of header through right if package created without body
@ 2016-09-19 09:29 Surinder Kumar <[email protected]>
2016-09-19 14:33 ` Re: [pgAdmin4][Patch]: RM1588 - User can not change the code of header through right if package created without body Dave Page <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Surinder Kumar @ 2016-09-19 09:29 UTC (permalink / raw)
To: pgadmin-hackers
Hi
Please find attached patch with fix:
Minor changes in template file. Checks were missing for creating package
body and drop package body.
Please review.
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] RM1588.patch (2.9K, 3-RM1588.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.1_plus/update.sql
index 757bcef..3eeaf9e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.1_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.1_plus/update.sql
@@ -1,7 +1,7 @@
{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
{% if data %}
-{% if o_data.pkgbodysrc and data.pkgbodysrc == '' %}
+{% if data.pkgheadsrc is defined and data.pkgheadsrc != o_data.pkgheadsrc and o_data.pkgbodysrc != None %}
DROP PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }};
{% endif %}
{% if data.pkgheadsrc %}
@@ -11,15 +11,6 @@ IS
{{data.pkgheadsrc}}
END {{ conn|qtIdent(data.name) }};
-CREATE OR REPLACE PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }}
-IS
-{% if data.pkgbodysrc %}
-{{data.pkgbodysrc}}
-{% else %}
-{{o_data.pkgbodysrc}}
-{% endif %}
-END {{ conn|qtIdent(data.name) }};
-{% else %}
{% if data.pkgbodysrc %}
CREATE OR REPLACE PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }}
@@ -27,7 +18,6 @@ IS
{{data.pkgbodysrc}}
END {{ conn|qtIdent(data.name) }};
{% endif %}
-{% endif %}
{% if data.pkgacl %}
{% if 'deleted' in data.pkgacl %}
{% for priv in data.pkgacl.deleted %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.2_plus/update.sql
index 757bcef..edcd883 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.2_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.2_plus/update.sql
@@ -1,7 +1,7 @@
{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
{% if data %}
-{% if o_data.pkgbodysrc and data.pkgbodysrc == '' %}
+{% if data.pkgheadsrc is defined and data.pkgheadsrc != o_data.pkgheadsrc and o_data.pkgbodysrc != None %}
DROP PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }};
{% endif %}
{% if data.pkgheadsrc %}
@@ -11,15 +11,7 @@ IS
{{data.pkgheadsrc}}
END {{ conn|qtIdent(data.name) }};
-CREATE OR REPLACE PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }}
-IS
-{% if data.pkgbodysrc %}
-{{data.pkgbodysrc}}
-{% else %}
-{{o_data.pkgbodysrc}}
{% endif %}
-END {{ conn|qtIdent(data.name) }};
-{% else %}
{% if data.pkgbodysrc %}
CREATE OR REPLACE PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }}
@@ -27,7 +19,6 @@ IS
{{data.pkgbodysrc}}
END {{ conn|qtIdent(data.name) }};
{% endif %}
-{% endif %}
{% if data.pkgacl %}
{% if 'deleted' in data.pkgacl %}
{% for priv in data.pkgacl.deleted %}
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin4][Patch]: RM1588 - User can not change the code of header through right if package created without body
2016-09-19 09:29 [pgAdmin4][Patch]: RM1588 - User can not change the code of header through right if package created without body Surinder Kumar <[email protected]>
@ 2016-09-19 14:33 ` Dave Page <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Page @ 2016-09-19 14:33 UTC (permalink / raw)
To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers
Thanks, applied.
On Mon, Sep 19, 2016 at 10:29 AM, Surinder Kumar
<[email protected]> wrote:
> Hi
>
> Please find attached patch with fix:
> Minor changes in template file. Checks were missing for creating package
> body and drop package body.
>
> Please review.
>
>
> 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-09-19 14:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-09-19 09:29 [pgAdmin4][Patch]: RM1588 - User can not change the code of header through right if package created without body Surinder Kumar <[email protected]>
2016-09-19 14:33 ` 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