Re: [pgadmin-hackers] Declarative partitioning in pgAdmin4 - Mailing list pgadmin-hackers
From | Dave Page |
---|---|
Subject | Re: [pgadmin-hackers] Declarative partitioning in pgAdmin4 |
Date | |
Msg-id | CA+OCxowtH1WJpXA1MKSLrzx_qbKAA36GTEk1t5=3VAS8fegBiA@mail.gmail.com Whole thread Raw |
In response to | Re: [pgadmin-hackers] Declarative partitioning in pgAdmin4 (Akshay Joshi <akshay.joshi@enterprisedb.com>) |
Responses |
Re: [pgadmin-hackers] Declarative partitioning in pgAdmin4
Re: [pgadmin-hackers] Declarative partitioning in pgAdmin4 |
List | pgadmin-hackers |
On Thu, May 11, 2017 at 11:35 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
HiOn Thu, May 4, 2017 at 4:00 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Thu, May 4, 2017 at 10:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AllOn Wed, May 3, 2017 at 5:35 PM, Dave Page <dpage@pgadmin.org> wrote:Great, thanks.I think it's clear that we need to display the child partitions in the treeview. I don't see any other sensible way of enabling those operations without an extremely contrived dialogue design.Please now document how those features will be implemented; e.g, for each one:- View table data: Parent and partition context menu.- Attach/detach partitions: Parent properties dialogue...That will then give us a list of places we'll need to (re)design dialogues and menus etc. for.As per my knowledge on Partitioning, I think we will have to implement following things in parent and child:Parent:Child:
- View Table data : No need to change any logic, it's working.
- Correct jinja template to show correct SQL in SQL pane.
- Create partitioned table -
- Add one switch control ("Partitioned Table?") in General tab of Table dialog.
- Add new tab "Partitions".
- Add one select2 control (Partition Type :Range/List) in "Partitions" tab.
- Create one subnode control to specify number of key columns with expressions. For List partition only one row will be there + button will be disabled, and for Range partition + button will be enabled. Here is the syntax as per documentation [ PARTITION BY { RANGE | LIST } ( { column_name | ( expression ) } [ COLLATE collation ] [ opclass ] [, ... ] ) ]. Design discussion required here for how user will specify expression, collate and opclass.
- Create N number of partitions:
- Design one control (subnode control) so that user will add N number of partitions. Here is the syntax as per documentation CREATE TABLE table_name PARTITION OF parent_table [ ( { column_name [ WITH OPTIONS ] [ column_constraint [ ... ] ] | table_constraint } [, ... ] ) ] FOR VALUES partition_bound_spec
partition
is:_bound_spec { IN ( { bound_literal | NULL } [, ...] ) | FROM ( { bound_literal | UNBOUNDED } [, ...] ) TO ( { bound_literal | UNBOUNDED } [, ...] ) }- Design discussion required here for how user will specify all the above combinations.
- Properties dialog "Partitions" Tab:
- Partition Type control must be disabled.
- User will be able to create/modify existing partitions. User won't be able to delete partitions as there are two modes Detach/Drop and we will have separate menu for it.
- Drop/ Drop cascade, Truncate: No need to change any logic, it's working.
- Attach Partitions: Create context menu on partitioned table. When user clicks, open one dialog with some controls to provide table(to be attach) and partition_bound_spec
. Design d
iscussion required here. - Not able to create constraints excluding check constraint: We will have to disable context menu, remove child nodes from browser tree for constraints and disable controls from the dialog.
Apart from above it may be possible that I miss something, so we need to cover that too.
- View Table Data: Add context menu.
- Detach partition: Create context menu, when user click popped up confirmation message box.
- View partition scheme in SQL pane: Changes required in jinja template.
- Create primary/foreign/.. key constraint: No need to change any logic on GUI, but may need to change queries to fetch the partitioned tables.
- Drop/ Drop cascade, Truncate: No need to change any logic.
OK, good. So now, let's break that down into a list of tasks, that we can prioritise with Shirley. The initial list should be prioritised based on your understanding I think, given the following criteria:- Changes that prevent pgAdmin breaking- Changes that prevent pgAdmin showing incorrect data/info- Changes that enable pgAdmin to show correct info- Changes that add functionality for creating/dropping partitioned tables as one unit- Changes that add functionality for modifying individual partitions independentlyPlease document the requirements and initial plan on the pgAdmin Redmine Wiki.I have updated Redmine Wiki page regarding what needs to be implemented for partitioning. Can we discuss prioritisation of the task based on above criteria in the our meeting. Meanwhile I have started working on showing correct SQL for partitioned table.
Which meeting?
Dave Page
VP, Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
VP, Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
pgadmin-hackers by date: