Hi,
While fixing and testing Unicode issues throughout pgadmin4 nodes I found
bellow issues (other than Unicode) which was preventing me further testing.
So these need to checked in first before we can apply Unicode related issue
patch.
1. *event_trigger_sql.patch*: returns correct value of 'eventfunname' when
schema of of trgger function is other than public.
2.*check_constraint_sql.patch*: Wrong sql was generated for check
constraint when we rename table name and check name at the same time from
table edit mode.
3.*dependents_sql*.patch: dependents sql was failing because of following
issue.
On non utf-8 encoding database bellow type casting queries fail as it
treats 0 (zero) as null instead of integer.
SELECT 0::text;
SELECT CAST(0 AS text);
db error:
ERROR: null character not permitted
********** Error **********
ERROR: null character not permitted
SQL state: 54000
--
*Harshal Dhumal*
*Software Engineer*
EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/properties.sql
index 662d04b..e7b81af 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/properties.sql
@@ -1,7 +1,12 @@
SELECT e.oid, e.xmin, e.evtname AS name, upper(e.evtevent) AS eventname,
pg_catalog.pg_get_userbyid(e.evtowner) AS eventowner,
e.evtenabled AS enabled,
-e.evtfoid AS eventfuncoid, quote_ident(n.nspname) || '.' || e.evtfoid::regproc AS eventfunname,
+e.evtfoid AS eventfuncoid,
+CASE
+ WHEN n.nspname = 'public'
+ THEN quote_ident(n.nspname) || '.' || cast(e.evtfoid::regproc as text)
+ ELSE cast(e.evtfoid::regproc as text)
+END AS eventfunname,
array_to_string(array(select quote_literal(x) from unnest(evttags) as t(x)), ', ') AS when,
pg_catalog.obj_description(e.oid, 'pg_event_trigger') AS comment,
(SELECT array_agg(provider || '=' || label) FROM pg_seclabel sl1 WHERE sl1.objoid=e.oid) AS seclabels,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/update.sql
index 6c27923..da1c8ef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/update.sql
@@ -1,13 +1,13 @@
{% if data %}
{% if data.name != o_data.name %}
-ALTER TABLE {{ conn|qtIdent(o_data.nspname, o_data.relname) }}
+ALTER TABLE {{ conn|qtIdent(o_data.nspname, data.table) }}
RENAME CONSTRAINT {{ conn|qtIdent(o_data.name) }} TO {{ conn|qtIdent(data.name) }};{% endif -%}
{% if 'convalidated' in data and o_data.convalidated != data.convalidated and not data.convalidated %}
-ALTER TABLE {{ conn|qtIdent(o_data.nspname, o_data.relname) }}
+ALTER TABLE {{ conn|qtIdent(o_data.nspname, data.table) }}
VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};{% endif -%}
{% if data.comment is defined and data.comment != o_data.comment %}
-COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(o_data.nspname, o_data.relname) }}
+COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(o_data.nspname, data.table) }}
IS {{ data.comment|qtLiteral }};{% endif %}
{% endif -%}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/templates/depends/sql/default/dependents.sql b/web/pgadmin/browser/server_groups/servers/templates/depends/sql/default/dependents.sql
index 881e1eb..e2ba3d6 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/depends/sql/default/dependents.sql
+++ b/web/pgadmin/browser/server_groups/servers/templates/depends/sql/default/dependents.sql
@@ -1,6 +1,6 @@
{% if fetch_dependencies %}
SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, ad.adsrc,
- CASE WHEN cl.relkind IS NOT NULL THEN cl.relkind || COALESCE(dep.refobjsubid::text, '')
+ CASE WHEN cl.relkind IS NOT NULL THEN cl.relkind || COALESCE(dep.refobjsubid::character varying, '')
WHEN tg.oid IS NOT NULL THEN 'T'::text
WHEN ty.oid IS NOT NULL AND ty.typbasetype = 0 THEN 'y'::text
WHEN ty.oid IS NOT NULL AND ty.typbasetype != 0 THEN 'd'::text
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers