Re: [pgAdmin4][Patch]: RM 2069 - Wrong tablespace displayed in table properties

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: RM 2069 - Wrong tablespace displayed in table properties
Date: 2017-01-20 12:01:26
Message-ID: CA+OCxowgSxEL__C5ygC+nyP5tPKkyDaROYrLTP1D9JNr=ib5=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Fri, Jan 13, 2017 at 6:41 AM, Khushboo Vashi
<khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:
> Hi,
>
> Please find the attached patch to fix the RM 2069 - Wrong tablespace
> displayed in table properties.
>
> When the table is created without a tablespace, the "pg_default" tablespace
> gets selected rather than the default tablespace (the current database
> tablespace).
> So, this issue has been fixed.

Unfortunately more work is required. I started hacking on it (see
attached), but there is more effort needed and I'm out of time.
Specifically:

- We need to remove 'pg_default' as the default tablespace when
creating objects. Let's have no default, and let PG automatically pick
the right tablespace, unless the user specifically overrides it. My
updated patch removes that default, and fixes some of the SQL to
handle it.

- Matviews don't list the correct tablespace in their properties list.

- Unique constraints ignore the tablespace option if the user selects
pg_default, even if the database's default is something different.

So I think to complete this we need to review all objects that use
tablespaces (databases, tables, matviews, indexes, index-backed
constraints) and ensure:

- No default tablespace is selected when creating an object.

- If the user selects a tablespace, the CREATE SQL must handle it
properly. Similarly, if they leave it to the default.

- The Properties views must display the actual tablespace in use,
whether it is specific to the object, or the database default.

Thanks.

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

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

Attachment Content-Type Size
RM_2069-Dave.patch application/octet-stream 14.8 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Murtuza Zabuawala 2017-01-20 12:35:42 Re: Re: PATCH: RM# 1679 - Background process for "restore" not reporting status back to pgAdmin
Previous Message Surinder Kumar 2017-01-20 07:29:52 Re: [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL