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

From: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
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-13 06:50:46
Message-ID: CAM5-9D-+uETwn4_LqHOGAwk46Wg6U-udSV_WrAy=FHnKwffhFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

Please find updated patch following changes:
1) Keep field 'opclass' combo box enabled.
2) Keep ASC/DESC and NULLs FIRST/LAST options disable for access methods
other than 'btree'.
3) Add validation for name field.

On Fri, Nov 25, 2016 at 5:16 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:

> On Thu, Nov 24, 2016 at 12:13 PM, Surinder Kumar
> <surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
> > Hi
> >
> > Please find updated patch with change.
> >
> > On Fri, Oct 21, 2016 at 9:16 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> >>
> >> On Fri, Oct 21, 2016 at 4:42 PM, Surinder Kumar
> >> <surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
> >> > On Fri, Oct 21, 2016 at 8:52 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> >> >>
> >> >> Hi
> >> >>
> >> >> On Fri, Oct 21, 2016 at 4:16 PM, Surinder Kumar
> >> >> <surinder(dot)kumar(at)enterprisedb(dot)com> 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'
>
> Hi,
>
> This still doesn't seem right to me. For example, if I choose an
> access method that doesn't have a default operator class for the
> selected data type, Postgres asks me to explicitly choose one, which I
> now can't because the combo box is disabled. Conversely, whilst the
> opclass should probably not be disabled, the ASC/DESC and NULLs
> FIRST/LAST options probably should be disabled (right now, they're
> just ignored).
>
> Thoughts?
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

Attachment Content-Type Size
RM1840_V1.patch application/octet-stream 9.4 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Surinder Kumar 2017-01-13 09:24:51 Re: [pgAdmin4][Patch]: Fix RM1790 - [Web] Support setting a field's value to "null"
Previous Message Khushboo Vashi 2017-01-13 06:41:32 [pgAdmin4][Patch]: RM 2069 - Wrong tablespace displayed in table properties