public inbox for [email protected]  
help / color / mirror / Atom feed
From: Akshay Joshi <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: RM 1847 SQL script generated by pgAdmin 4 to create table has errors.
Date: Fri, 14 Oct 2016 16:40:42 +0530
Message-ID: <CANxoLDd+JLvC_rjZ7oCcjrnMQK=Pw0BziGNfLZiFc5tV2jU-mA@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi All

Please find the attached patch to fix the RM #1847 SQL script generated by
pgAdmin 4 to create table has errors.


-- 
*Akshay Joshi*
*Principal Software Engineer *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*


-- 
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_1847.patch (3.3K, 3-RM_1847.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/templates/catalog_object_column/sql/9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/templates/catalog_object_column/sql/9.1_plus/properties.sql
index b2ca255..1bb7146 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/templates/catalog_object_column/sql/9.1_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/templates/catalog_object_column/sql/9.1_plus/properties.sql
@@ -11,7 +11,7 @@ SELECT
 	indkey, coll.collname, nspc.nspname as collnspname , attoptions,
 	-- Start pgAdmin4, added to save time on client side parsing
 	CASE WHEN length(coll.collname) > 0 AND length(nspc.nspname) > 0  THEN
-	  concat(coll.collname,'."',nspc.nspname,'"')
+	  concat(quote_ident(nspc.nspname),'.',quote_ident(coll.collname))
 	ELSE '' END AS collspcname,
 	CASE WHEN strpos(format_type(ty.oid,att.atttypmod), '.') > 0 THEN
 	  split_part(format_type(ty.oid,att.atttypmod), '.', 2)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.1_plus/properties.sql
index bb96cff..fa5c3f3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.1_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.1_plus/properties.sql
@@ -11,7 +11,7 @@ SELECT att.attname as name, att.*, def.*, pg_catalog.pg_get_expr(def.adbin, def.
 	indkey, coll.collname, nspc.nspname as collnspname , attoptions,
 	-- Start pgAdmin4, added to save time on client side parsing
 	CASE WHEN length(coll.collname) > 0 AND length(nspc.nspname) > 0  THEN
-	  concat(quote_ident(coll.collname),'.',quote_ident(nspc.nspname))
+	  concat(quote_ident(nspc.nspname),'.',quote_ident(coll.collname))
 	ELSE '' END AS collspcname,
 	CASE WHEN strpos(format_type(ty.oid,att.atttypmod), '.') > 0 THEN
 	  split_part(format_type(ty.oid,att.atttypmod), '.', 2)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/properties.sql
index b383496..22cef71 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/properties.sql
@@ -11,7 +11,7 @@ SELECT att.attname as name, att.*, def.*, pg_catalog.pg_get_expr(def.adbin, def.
 	indkey, coll.collname, nspc.nspname as collnspname , attoptions,
 	-- Start pgAdmin4, added to save time on client side parsing
 	CASE WHEN length(coll.collname) > 0 AND length(nspc.nspname) > 0  THEN
-	  concat(quote_ident(coll.collname),'.',quote_ident(nspc.nspname))
+	  concat(quote_ident(nspc.nspname),'.',quote_ident(coll.collname))
 	ELSE '' END AS collspcname,
 	CASE WHEN strpos(format_type(ty.oid,att.atttypmod), '.') > 0 THEN
 	  split_part(format_type(ty.oid,att.atttypmod), '.', 2)


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin4][Patch]: RM 1847 SQL script generated by pgAdmin 4 to create table has errors.
  In-Reply-To: <CANxoLDd+JLvC_rjZ7oCcjrnMQK=Pw0BziGNfLZiFc5tV2jU-mA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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