public inbox for [email protected]
help / color / mirror / Atom feedFrom: Surinder Kumar <[email protected]>
To: Dave Page <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL
Date: Thu, 24 Nov 2016 17:43:35 +0530
Message-ID: <CAM5-9D97YhGDXQZfOg+FBf0nDedQvydWH+mAmr2iRi0rOL9PSA@mail.gmail.com> (raw)
In-Reply-To: <CA+OCxowo2158=USKZ1nFvpogA4BO2R3UcHHC6xWzSsiGOdj6eg@mail.gmail.com>
References: <CAM5-9D-ti4O0bE3W_=puMMWPjO4qR525gYfKuGSYAiGow-AZdQ@mail.gmail.com>
<CA+OCxowGDMCf_YJauW=u24X_7X4XMnT5tkca4qMRZCpH8z2mDA@mail.gmail.com>
<CAM5-9D8XX_BVPi2XQODAK5DPRrhi9sTMHQDh_KTu0p9FjkU=dQ@mail.gmail.com>
<CA+OCxozBD1OBWQTG5SvdnVFipuScgK1nNaXUxazDSXqif_gtzQ@mail.gmail.com>
<CAM5-9D8osVRFd4s9kps-Bnuqw53WPFT4TN8ayuOO0Hr5nzuwxA@mail.gmail.com>
<CA+OCxowo2158=USKZ1nFvpogA4BO2R3UcHHC6xWzSsiGOdj6eg@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi
Please find updated patch with change.
On Fri, Oct 21, 2016 at 9:16 PM, Dave Page <[email protected]> wrote:
> On Fri, Oct 21, 2016 at 4:42 PM, Surinder Kumar
> <[email protected]> wrote:
> > On Fri, Oct 21, 2016 at 8:52 PM, Dave Page <[email protected]> wrote:
> >>
> >> Hi
> >>
> >> On Fri, Oct 21, 2016 at 4:16 PM, Surinder Kumar
> >> <[email protected]> wrote:
> >> > Hi
> >> >
> >> > This fix is for exclusion constraint.
> >> > The options like "order" and "nulls" must be conditional. i.e. include
> >> > only
> >> > when access method type is other than "gist".
> >>
> >> When creating an index, the asc/desc options are disabled if gist/gin
> >> used. I think they also should be here.
> >>
> >> Also, what about gin indexes in this case?
> >
> > As per documentation,
> > The access method must support amgettuple (see Chapter 52); at present
> this
> > means GIN cannot be used
>
> OK, but this patch (unlike the last one) only seems to check for gist.
>
I have modified the code so It will check for 'gist' and 'spgist'
>
> --
> 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
Attachments:
[application/octet-stream] RM1840_exclusion_constraint_v2.patch (3.8K, 3-RM1840_exclusion_constraint_v2.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/9.1_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/9.1_plus/create.sql
index db29048..93f3648 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/9.1_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/9.1_plus/create.sql
@@ -1,7 +1,7 @@
ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} EXCLUDE {% if data.amname and data.amname != '' %}USING {{data.amname}}{% endif %} (
{% for col in data.columns %}{% if loop.index != 1 %},
- {% endif %}{{ conn|qtIdent(col.column)}} {% if col.oper_class and col.oper_class != '' %}{{col.oper_class}} {% endif%}{% if col.order %}ASC{% else %}DESC{% endif %} NULLS {% if col.nulls_order %}FIRST{% else %}LAST{% endif %} WITH {{col.operator}}{% endfor %}){% if data.fillfactor %}
+ {% endif %}{{ conn|qtIdent(col.column)}} {% if data.amname is defined and data.amname not in ['gist', 'spgist'] %}{% if col.oper_class and col.oper_class != '' %}{{col.oper_class}} {% endif%}{% if col.order %}ASC{% else %}DESC{% endif %} NULLS {% if col.nulls_order %}FIRST{% else %}LAST{% endif %}{% endif %} WITH {{col.operator}}{% endfor %}){% if data.fillfactor %}
WITH (FILLFACTOR={{data.fillfactor}}){% endif %}{% if data.spcname and data.spcname != "pg_default" %}
USING INDEX TABLESPACE {{ conn|qtIdent(data.spcname) }}{% endif %}
@@ -14,4 +14,4 @@ ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }}
IS {{ data.comment|qtLiteral }};
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/9.2_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/9.2_plus/create.sql
index db29048..93f3648 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/9.2_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/9.2_plus/create.sql
@@ -1,7 +1,7 @@
ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} EXCLUDE {% if data.amname and data.amname != '' %}USING {{data.amname}}{% endif %} (
{% for col in data.columns %}{% if loop.index != 1 %},
- {% endif %}{{ conn|qtIdent(col.column)}} {% if col.oper_class and col.oper_class != '' %}{{col.oper_class}} {% endif%}{% if col.order %}ASC{% else %}DESC{% endif %} NULLS {% if col.nulls_order %}FIRST{% else %}LAST{% endif %} WITH {{col.operator}}{% endfor %}){% if data.fillfactor %}
+ {% endif %}{{ conn|qtIdent(col.column)}} {% if data.amname is defined and data.amname not in ['gist', 'spgist'] %}{% if col.oper_class and col.oper_class != '' %}{{col.oper_class}} {% endif%}{% if col.order %}ASC{% else %}DESC{% endif %} NULLS {% if col.nulls_order %}FIRST{% else %}LAST{% endif %}{% endif %} WITH {{col.operator}}{% endfor %}){% if data.fillfactor %}
WITH (FILLFACTOR={{data.fillfactor}}){% endif %}{% if data.spcname and data.spcname != "pg_default" %}
USING INDEX TABLESPACE {{ conn|qtIdent(data.spcname) }}{% endif %}
@@ -14,4 +14,4 @@ ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }}
IS {{ data.comment|qtLiteral }};
-{% endif %}
\ No newline at end of file
+{% endif %}
view thread (14+ 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], [email protected]
Subject: Re: [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL
In-Reply-To: <CAM5-9D97YhGDXQZfOg+FBf0nDedQvydWH+mAmr2iRi0rOL9PSA@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