Re: [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL
Date: 2017-01-25 13:21:49
Message-ID: CA+OCxoyRKYCXg6BPUHSP+0OzecNmP-DxDa84xiDh+whS2rF95Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks, patch applied.

On Fri, Jan 20, 2017 at 7:29 AM, Surinder Kumar
<surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
> Hi Dave,
>
> The last patch was for exclusion constraint only. The same issue issue is
> reported RM2061 for index.
> So, this patch takes care of both issues.
>
> Added a flag 'is_sort_nulls_applicable' which is set to true for access
> method 'btree'.
> If its is true, the values for options 'ASC/DESC' and 'NULLS' are included
> in 'create' sql for exclusion and index otherwise not.
>
> Please find updated patch and review.
>
> On Tue, Jan 17, 2017 at 3:43 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>
>> Hi
>>
>> On Tue, Jan 17, 2017 at 9:52 AM, Surinder Kumar
>> <surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>> > Hi
>> > On Tue, Jan 17, 2017 at 3:08 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>> >>
>> >> Hi
>> >>
>> >> On Fri, Jan 13, 2017 at 6:50 AM, Surinder Kumar
>> >> <surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>> >> > Hi
>> >> >
>> >> > Please find updated patch following changes:
>> >> > 1) Keep field 'opclass' combo box enabled.
>> >>
>> >> That doesn't seem to be working.
>
> It is now fixed in the updated patch.
>>
>> >
>> > Is the field 'opclass' is not enabled for you?.
>>
>> No.
>>
>> > Can you please tell in which scenario it doesn't gets enabled? so that I
>> > can
>> > fix it.
>>
>> PostgreSQL 9.4, table:
>>
>> CREATE TABLE public.foo
>> (
>> id text COLLATE pg_catalog."default" NOT NULL,
>> data1 text COLLATE pg_catalog."default",
>> CONSTRAINT foo_pkey1 PRIMARY KEY (id),
>> CONSTRAINT gerp1 UNIQUE (id, data1)
>> )
>>
>> 1) Right-click, Create index
>>
>> 2) Name: xxxx
>>
>> 3) Access method: gist
>>
>> 4) Add column. Select id (note the opclass field is not enabled)
>>
>> 5) Add column. Select data1 (note the opclass field is not enabled).
>>
>> 6) Click save, and behold the following error in all it's glory :-)
>>
>> ERROR: data type text has no default operator class for access method
>> "gist"
>> HINT: You must specify an operator class for the index or define a
>> default operator class for the data type.
>
> Thanks for steps.
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Jan Alexander Steffens 2017-01-25 13:43:28 Re: [pgAdmin4] [PATCH] Simplify Server's python setup
Previous Message Dave Page 2017-01-25 13:21:42 pgAdmin 4 commit: Enable/disable NULLs and ASC/DESC options for index c