public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node
7+ messages / 5 participants
[nested] [flat]

* [pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node
@ 2018-03-29 12:35  Akshay Joshi <[email protected]>
  0 siblings, 2 replies; 7+ messages in thread

From: Akshay Joshi @ 2018-03-29 12:35 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Please find the attached patch to fix RM #3180 Index node is missing from
the tree view of the table node. This is a regression of one of the older
commit.

-- 
*Akshay Joshi*

*Sr. Software Architect *



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


Attachments:

  [application/octet-stream] RM_3180.patch (795B, 3-RM_3180.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py
index edda4a4..96fa1f3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py
@@ -77,7 +77,7 @@ class IndexesModule(CollectionNodeModule):
 
             # In case of partitioned table return false.
             if 'tid' in kwargs and manager.version >= 100000:
-                return backend_supported(self, manager, **kwargs)
+                return not backend_supported(self, manager, **kwargs)
 
             if 'vid' not in kwargs:
                 return True


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node
@ 2018-03-29 13:06  Murtuza Zabuawala <[email protected]>
  parent: Akshay Joshi <[email protected]>
  1 sibling, 1 reply; 7+ messages in thread

From: Murtuza Zabuawala @ 2018-03-29 13:06 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

Hi Akshay,

I have concerns regarding the fix, As you negate the condition, Before the
fix it was not displaying Index node for Tables but after the fix it will
not display it for Partition tables.
But when I read the Postgres docs it say,
*Partitions may themselves be defined as partitioned tables, using what is
called sub-partitioning. Partitions may have their own indexes, constraints
and default values, distinct from those of other partitions. Indexes must
be created separately for each partition. See CREATE TABLE
<https://www.postgresql.org/docs/10/static/sql-createtable.html; for more
details on creating partitioned tables and partitions.*
Ref: https://www.postgresql.org/docs/10/static/ddl-partitioning.html (Sec:
5.10.2)



--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


On Thu, Mar 29, 2018 at 6:05 PM, Akshay Joshi <[email protected]
> wrote:

> Hi Hackers,
>
> Please find the attached patch to fix RM #3180 Index node is missing from
> the tree view of the table node. This is a regression of one of the older
> commit.
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node
@ 2018-03-29 13:10  Dave Page <[email protected]>
  parent: Akshay Joshi <[email protected]>
  1 sibling, 0 replies; 7+ messages in thread

From: Dave Page @ 2018-03-29 13:10 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

Thanks, applied.

On Thu, Mar 29, 2018 at 1:35 PM, Akshay Joshi <[email protected]
> wrote:

> Hi Hackers,
>
> Please find the attached patch to fix RM #3180 Index node is missing from
> the tree view of the table node. This is a regression of one of the older
> commit.
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246
> <+91%2097678%2088246>*
>



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

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


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node
@ 2018-03-29 13:26  Akshay Joshi <[email protected]>
  parent: Murtuza Zabuawala <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Akshay Joshi @ 2018-03-29 13:26 UTC (permalink / raw)
  To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers

Hi Murtuza

On Thu, Mar 29, 2018 at 6:36 PM, Murtuza Zabuawala <
[email protected]> wrote:

> Hi Akshay,
>
> I have concerns regarding the fix, As you negate the condition, Before the
> fix it was not displaying Index node for Tables but after the fix it will
> not display it for Partition tables.
> But when I read the Postgres docs it say,
> *Partitions may themselves be defined as partitioned tables, using what is
> called sub-partitioning. Partitions may have their own indexes, constraints
> and default values, distinct from those of other partitions. Indexes must
> be created separately for each partition. See CREATE TABLE
> <https://www.postgresql.org/docs/10/static/sql-createtable.html; for more
> details on creating partitioned tables and partitions.*
> Ref: https://www.postgresql.org/docs/10/static/ddl-partitioning.html
> (Sec: 5.10.2)
>

    Yes that is correct, but it's about Partitions(child tables), not the
*Partitioned* table. We are showing indexes on Partitions. Please refer
"Index_on_Partitioned_table.png"

>
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Thu, Mar 29, 2018 at 6:05 PM, Akshay Joshi <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch to fix RM #3180 Index node is missing
>> from the tree view of the table node. This is a regression of one of the
>> older commit.
>>
>> --
>> *Akshay Joshi*
>>
>> *Sr. Software Architect *
>>
>>
>>
>> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>>
>
>


-- 
*Akshay Joshi*

*Sr. Software Architect *



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


Attachments:

  [image/png] Index_on_Partitioned_table.png (189.0K, 3-Index_on_Partitioned_table.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node
@ 2018-03-29 15:36  Joao De Almeida Pereira <[email protected]>
  parent: Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Joao De Almeida Pereira @ 2018-03-29 15:36 UTC (permalink / raw)
  To: Murtuza Zabuawala <[email protected]>; +Cc: Akshay Joshi <[email protected]>; pgadmin-hackers

Hi Murtuza,
Lets imagine you have

CREATE TABLE cities (
    city_id         bigserial not null,
    name         text not null,
    population   int
) PARTITION BY LIST (initcap(name));

CREATE TABLE cities_west
    PARTITION OF cities (
    CONSTRAINT city_id_nonzero CHECK (city_id != 0)
) FOR VALUES IN ('Los Angeles', 'San Francisco') PARTITION BY RANGE
(population);

CREATE TABLE cities_west_10000_to_100000
    PARTITION OF cities_west FOR VALUES FROM (10000) TO (100000);

​

You can only create an index in *cities_west_10000_to_100000* because
postgresql assumes that *cities_west* is also a partitioned table. So the
implementation looks correct, despite the fact that there are no tests
around it.

Thanks
Joao

On Thu, Mar 29, 2018 at 9:26 AM Akshay Joshi <[email protected]>
wrote:

> Hi Murtuza
>
> On Thu, Mar 29, 2018 at 6:36 PM, Murtuza Zabuawala <
> [email protected]> wrote:
>
>> Hi Akshay,
>>
>> I have concerns regarding the fix, As you negate the condition, Before
>> the fix it was not displaying Index node for Tables but after the fix it
>> will not display it for Partition tables.
>> But when I read the Postgres docs it say,
>> *Partitions may themselves be defined as partitioned tables, using what
>> is called sub-partitioning. Partitions may have their own indexes,
>> constraints and default values, distinct from those of other partitions.
>> Indexes must be created separately for each partition. See CREATE TABLE
>> <https://www.postgresql.org/docs/10/static/sql-createtable.html; for more
>> details on creating partitioned tables and partitions.*
>> Ref: https://www.postgresql.org/docs/10/static/ddl-partitioning.html
>> (Sec: 5.10.2)
>>
>
>     Yes that is correct, but it's about Partitions(child tables), not the
> *Partitioned* table. We are showing indexes on Partitions. Please refer
> "Index_on_Partitioned_table.png"
>
>>
>>
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Thu, Mar 29, 2018 at 6:05 PM, Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch to fix RM #3180 Index node is missing
>>> from the tree view of the table node. This is a regression of one of the
>>> older commit.
>>>
>>> --
>>> *Akshay Joshi*
>>>
>>> *Sr. Software Architect *
>>>
>>>
>>>
>>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>>> 976-788-8246 <+91%2097678%2088246>*
>>>
>>
>>
>
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246
> <+91%2097678%2088246>*
>


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node
@ 2018-03-29 16:45  Murtuza Zabuawala <[email protected]>
  parent: Joao De Almeida Pereira <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Murtuza Zabuawala @ 2018-03-29 16:45 UTC (permalink / raw)
  To: Joao De Almeida Pereira <[email protected]>; +Cc: Akshay Joshi <[email protected]>; pgadmin-hackers

Thanks Akshay & Joao, got it.

My bad sorry for the noise.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


On Thu, Mar 29, 2018 at 9:06 PM, Joao De Almeida Pereira <
[email protected]> wrote:

> Hi Murtuza,
> Lets imagine you have
>
> CREATE TABLE cities (
>     city_id         bigserial not null,
>     name         text not null,
>     population   int
> ) PARTITION BY LIST (initcap(name));
>
> CREATE TABLE cities_west
>     PARTITION OF cities (
>     CONSTRAINT city_id_nonzero CHECK (city_id != 0)
> ) FOR VALUES IN ('Los Angeles', 'San Francisco') PARTITION BY RANGE (population);
>
> CREATE TABLE cities_west_10000_to_100000
>     PARTITION OF cities_west FOR VALUES FROM (10000) TO (100000);
>
> ​
>
> You can only create an index in *cities_west_10000_to_100000* because
> postgresql assumes that *cities_west* is also a partitioned table. So the
> implementation looks correct, despite the fact that there are no tests
> around it.
>
> Thanks
> Joao
>
> On Thu, Mar 29, 2018 at 9:26 AM Akshay Joshi <
> [email protected]> wrote:
>
>> Hi Murtuza
>>
>> On Thu, Mar 29, 2018 at 6:36 PM, Murtuza Zabuawala <murtuza.zabuawala@
>> enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> I have concerns regarding the fix, As you negate the condition, Before
>>> the fix it was not displaying Index node for Tables but after the fix it
>>> will not display it for Partition tables.
>>> But when I read the Postgres docs it say,
>>> *Partitions may themselves be defined as partitioned tables, using what
>>> is called sub-partitioning. Partitions may have their own indexes,
>>> constraints and default values, distinct from those of other partitions.
>>> Indexes must be created separately for each partition. See CREATE TABLE
>>> <https://www.postgresql.org/docs/10/static/sql-createtable.html; for more
>>> details on creating partitioned tables and partitions.*
>>> Ref: https://www.postgresql.org/docs/10/static/ddl-partitioning.html
>>> (Sec: 5.10.2)
>>>
>>
>>     Yes that is correct, but it's about Partitions(child tables), not the
>> *Partitioned* table. We are showing indexes on Partitions. Please refer
>> "Index_on_Partitioned_table.png"
>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>>> On Thu, Mar 29, 2018 at 6:05 PM, Akshay Joshi <
>>> [email protected]> wrote:
>>>
>>>> Hi Hackers,
>>>>
>>>> Please find the attached patch to fix RM #3180 Index node is missing
>>>> from the tree view of the table node. This is a regression of one of the
>>>> older commit.
>>>>
>>>> --
>>>> *Akshay Joshi*
>>>>
>>>> *Sr. Software Architect *
>>>>
>>>>
>>>>
>>>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>>>> 976-788-8246 <+91%2097678%2088246>*
>>>>
>>>
>>>
>>
>>
>> --
>> *Akshay Joshi*
>>
>> *Sr. Software Architect *
>>
>>
>>
>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246
>> <+91%2097678%2088246>*
>>
>


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node
@ 2018-03-29 17:07  Robert Eckhardt <[email protected]>
  parent: Murtuza Zabuawala <[email protected]>
  0 siblings, 0 replies; 7+ messages in thread

From: Robert Eckhardt @ 2018-03-29 17:07 UTC (permalink / raw)
  To: Murtuza Zabuawala <[email protected]>; +Cc: Joao De Almeida Pereira <[email protected]>; Akshay Joshi <[email protected]>; pgadmin-hackers

On Thu, Mar 29, 2018 at 12:45 PM, Murtuza Zabuawala <
[email protected]> wrote:

> Thanks Akshay & Joao, got it.
>
> My bad sorry for the noise.
>

The question helped me, nothing wrong with questions.

-- Rob


>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Thu, Mar 29, 2018 at 9:06 PM, Joao De Almeida Pereira <
> [email protected]> wrote:
>
>> Hi Murtuza,
>> Lets imagine you have
>>
>> CREATE TABLE cities (
>>     city_id         bigserial not null,
>>     name         text not null,
>>     population   int
>> ) PARTITION BY LIST (initcap(name));
>>
>> CREATE TABLE cities_west
>>     PARTITION OF cities (
>>     CONSTRAINT city_id_nonzero CHECK (city_id != 0)
>> ) FOR VALUES IN ('Los Angeles', 'San Francisco') PARTITION BY RANGE (population);
>>
>> CREATE TABLE cities_west_10000_to_100000
>>     PARTITION OF cities_west FOR VALUES FROM (10000) TO (100000);
>>
>> ​
>>
>> You can only create an index in *cities_west_10000_to_100000* because
>> postgresql assumes that *cities_west* is also a partitioned table. So
>> the implementation looks correct, despite the fact that there are no tests
>> around it.
>>
>> Thanks
>> Joao
>>
>> On Thu, Mar 29, 2018 at 9:26 AM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Hi Murtuza
>>>
>>> On Thu, Mar 29, 2018 at 6:36 PM, Murtuza Zabuawala <
>>> [email protected]> wrote:
>>>
>>>> Hi Akshay,
>>>>
>>>> I have concerns regarding the fix, As you negate the condition, Before
>>>> the fix it was not displaying Index node for Tables but after the fix it
>>>> will not display it for Partition tables.
>>>> But when I read the Postgres docs it say,
>>>> *Partitions may themselves be defined as partitioned tables, using what
>>>> is called sub-partitioning. Partitions may have their own indexes,
>>>> constraints and default values, distinct from those of other partitions.
>>>> Indexes must be created separately for each partition. See CREATE TABLE
>>>> <https://www.postgresql.org/docs/10/static/sql-createtable.html; for more
>>>> details on creating partitioned tables and partitions.*
>>>> Ref: https://www.postgresql.org/docs/10/static/ddl-partitioning.html
>>>> (Sec: 5.10.2)
>>>>
>>>
>>>     Yes that is correct, but it's about Partitions(child tables), not
>>> the *Partitioned* table. We are showing indexes on Partitions. Please refer
>>> "Index_on_Partitioned_table.png"
>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> Murtuza Zabuawala
>>>> EnterpriseDB: http://www.enterprisedb.com
>>>> The Enterprise PostgreSQL Company
>>>>
>>>>
>>>> On Thu, Mar 29, 2018 at 6:05 PM, Akshay Joshi <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Hackers,
>>>>>
>>>>> Please find the attached patch to fix RM #3180 Index node is missing
>>>>> from the tree view of the table node. This is a regression of one of the
>>>>> older commit.
>>>>>
>>>>> --
>>>>> *Akshay Joshi*
>>>>>
>>>>> *Sr. Software Architect *
>>>>>
>>>>>
>>>>>
>>>>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>>>>> 976-788-8246 <+91%2097678%2088246>*
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> *Akshay Joshi*
>>>
>>> *Sr. Software Architect *
>>>
>>>
>>>
>>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>>> 976-788-8246 <+91%2097678%2088246>*
>>>
>>
>


^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2018-03-29 17:07 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 12:35 [pgAdmin4][Patch]: RM #3180 Index node is missing from the tree view of the table node Akshay Joshi <[email protected]>
2018-03-29 13:06 ` Murtuza Zabuawala <[email protected]>
2018-03-29 13:26   ` Akshay Joshi <[email protected]>
2018-03-29 15:36     ` Joao De Almeida Pereira <[email protected]>
2018-03-29 16:45       ` Murtuza Zabuawala <[email protected]>
2018-03-29 17:07         ` Robert Eckhardt <[email protected]>
2018-03-29 13:10 ` Dave Page <[email protected]>

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