Fixes #1123 - Options other than 'Create' are not available in the

procedure node.

This patch also includes other fixes related 'procedure' node as below:
* Generate correct statement for dropping procedure.
* Fetch the missing schema name for the EXEC script.
* Removed the 'DROP CASCADE' menu options, as it is not supported by
  procedure.
This commit is contained in:
Murtuza Zabuawala 2016-05-29 15:28:11 +05:30 committed by Ashesh Vashi
parent 7e51a8fd56
commit c96f28b66f
5 changed files with 11 additions and 5 deletions

View File

@ -1272,6 +1272,12 @@ It may have been removed by another user or moved to another schema.
"""
resp_data = self._fetch_properties(gid, sid, did, scid, fnid)
# Fetch the schema name from OID
if 'pronamespace' in resp_data:
resp_data['pronamespace'] = self._get_schema(
resp_data['pronamespace']
)
name = resp_data['pronamespace'] + "." + resp_data['name_with_args']
# Fetch only arguments

View File

@ -20,7 +20,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Function) {
// Inherit Functions Node
if (!pgBrowser.Nodes['procedure']) {
pgAdmin.Browser.Nodes['procedure'] = Function.extend({
pgAdmin.Browser.Nodes['procedure'] = pgBrowser.Node.extend({
type: 'procedure',
sqlAlterHelp: 'sql-alterprocedure.html',
sqlCreateHelp: 'sql-createprocedure.html',
@ -61,7 +61,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Function) {
]);
},
canDrop: pgSchemaNode.canChildDrop,
canDropCascade: pgSchemaNode.canChildDrop,
canDropCascade: false,
model: Function.model.extend({
defaults: _.extend({},
Function.model.prototype.defaults,

View File

@ -17,5 +17,5 @@ WHERE
{% endif %}
{% if name %}
DROP PROCEDURE {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
DROP PROCEDURE {{ conn|qtIdent(nspname, name) }};
{% endif %}

View File

@ -17,5 +17,5 @@ WHERE
{% endif %}
{% if name %}
DROP PROCEDURE {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
DROP PROCEDURE {{ conn|qtIdent(nspname, name) }};
{% endif %}

View File

@ -17,5 +17,5 @@ WHERE
{% endif %}
{% if name %}
DROP PROCEDURE {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
DROP PROCEDURE {{ conn|qtIdent(nspname, name) }};
{% endif %}