Обсуждение: PATCH: 'serial' like types were missing while creating table/column (pgAdmin4)

Поиск
Список
Период
Сортировка

PATCH: 'serial' like types were missing while creating table/column (pgAdmin4)

От
Murtuza Zabuawala
Дата:
Hi,

PFA patch to fix the issue where 'serial' like types were not listed under type combobox while creating new table/column.
RM#1393


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

Вложения

Re: PATCH: 'serial' like types were missing while creating table/column (pgAdmin4)

От
Dave Page
Дата:
Hi

On Tue, Jun 28, 2016 at 12:30 PM, Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
> Hi,
>
> PFA patch to fix the issue where 'serial' like types were not listed under
> type combobox while creating new table/column.
> RM#1393

This changes the display text of all integer columns with a dependency
to the respective serial type, e.g.

create table test(id integer primary key);

gets reverse engineered into:

CREATE TABLE public.test
(
    id serial NOT NULL,
    CONSTRAINT test_pkey PRIMARY KEY (id)
)

I would strongly suggest that we only add "serial" and friends to the
list of available types for creating/adding a column. Once created, we
display the base type, with the default value clause etc.

pgAdmin 3 does what you're trying to do here, but the logic is very
complex, likely broken in some edge cases, and I don't think it really
adds much. See pgColumn::GetDefinition() in
https://git.postgresql.org/gitweb/?p=pgadmin3.git;a=blob;f=pgadmin/schema/pgColumn.cpp

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

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


Re: PATCH: 'serial' like types were missing while creating table/column (pgAdmin4)

От
Murtuza Zabuawala
Дата:
Hi Dave, 

As suggested please find updated patch.

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


On Wed, Jun 29, 2016 at 3:37 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Tue, Jun 28, 2016 at 12:30 PM, Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
> Hi,
>
> PFA patch to fix the issue where 'serial' like types were not listed under
> type combobox while creating new table/column.
> RM#1393

This changes the display text of all integer columns with a dependency
to the respective serial type, e.g.

create table test(id integer primary key);

gets reverse engineered into:

CREATE TABLE public.test
(
    id serial NOT NULL,
    CONSTRAINT test_pkey PRIMARY KEY (id)
)

I would strongly suggest that we only add "serial" and friends to the
list of available types for creating/adding a column. Once created, we
display the base type, with the default value clause etc.

pgAdmin 3 does what you're trying to do here, but the logic is very
complex, likely broken in some edge cases, and I don't think it really
adds much. See pgColumn::GetDefinition() in
https://git.postgresql.org/gitweb/?p=pgadmin3.git;a=blob;f=pgadmin/schema/pgColumn.cpp

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

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

Вложения

Re: PATCH: 'serial' like types were missing while creating table/column (pgAdmin4)

От
Dave Page
Дата:
That's the same patch!

On Wed, Jun 29, 2016 at 11:54 AM, Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
> Hi Dave,
>
> As suggested please find updated patch.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Wed, Jun 29, 2016 at 3:37 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Tue, Jun 28, 2016 at 12:30 PM, Murtuza Zabuawala
>> <murtuza.zabuawala@enterprisedb.com> wrote:
>> > Hi,
>> >
>> > PFA patch to fix the issue where 'serial' like types were not listed
>> > under
>> > type combobox while creating new table/column.
>> > RM#1393
>>
>> This changes the display text of all integer columns with a dependency
>> to the respective serial type, e.g.
>>
>> create table test(id integer primary key);
>>
>> gets reverse engineered into:
>>
>> CREATE TABLE public.test
>> (
>>     id serial NOT NULL,
>>     CONSTRAINT test_pkey PRIMARY KEY (id)
>> )
>>
>> I would strongly suggest that we only add "serial" and friends to the
>> list of available types for creating/adding a column. Once created, we
>> display the base type, with the default value clause etc.
>>
>> pgAdmin 3 does what you're trying to do here, but the logic is very
>> complex, likely broken in some edge cases, and I don't think it really
>> adds much. See pgColumn::GetDefinition() in
>>
>> https://git.postgresql.org/gitweb/?p=pgadmin3.git;a=blob;f=pgadmin/schema/pgColumn.cpp
>>
>> --
>> 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


Re: PATCH: 'serial' like types were missing while creating table/column (pgAdmin4)

От
Murtuza Zabuawala
Дата:
Apologies, 

Please find updated patch.

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


On Wed, Jun 29, 2016 at 4:49 PM, Dave Page <dpage@pgadmin.org> wrote:
That's the same patch!

On Wed, Jun 29, 2016 at 11:54 AM, Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
> Hi Dave,
>
> As suggested please find updated patch.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Wed, Jun 29, 2016 at 3:37 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Tue, Jun 28, 2016 at 12:30 PM, Murtuza Zabuawala
>> <murtuza.zabuawala@enterprisedb.com> wrote:
>> > Hi,
>> >
>> > PFA patch to fix the issue where 'serial' like types were not listed
>> > under
>> > type combobox while creating new table/column.
>> > RM#1393
>>
>> This changes the display text of all integer columns with a dependency
>> to the respective serial type, e.g.
>>
>> create table test(id integer primary key);
>>
>> gets reverse engineered into:
>>
>> CREATE TABLE public.test
>> (
>>     id serial NOT NULL,
>>     CONSTRAINT test_pkey PRIMARY KEY (id)
>> )
>>
>> I would strongly suggest that we only add "serial" and friends to the
>> list of available types for creating/adding a column. Once created, we
>> display the base type, with the default value clause etc.
>>
>> pgAdmin 3 does what you're trying to do here, but the logic is very
>> complex, likely broken in some edge cases, and I don't think it really
>> adds much. See pgColumn::GetDefinition() in
>>
>> https://git.postgresql.org/gitweb/?p=pgadmin3.git;a=blob;f=pgadmin/schema/pgColumn.cpp
>>
>> --
>> 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

Вложения

Re: PATCH: 'serial' like types were missing while creating table/column (pgAdmin4)

От
Dave Page
Дата:
Thanks! Patch applied.

On Wed, Jun 29, 2016 at 12:23 PM, Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
> Apologies,
>
> Please find updated patch.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Wed, Jun 29, 2016 at 4:49 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> That's the same patch!
>>
>> On Wed, Jun 29, 2016 at 11:54 AM, Murtuza Zabuawala
>> <murtuza.zabuawala@enterprisedb.com> wrote:
>> > Hi Dave,
>> >
>> > As suggested please find updated patch.
>> >
>> > --
>> > Regards,
>> > Murtuza Zabuawala
>> > EnterpriseDB: http://www.enterprisedb.com
>> > The Enterprise PostgreSQL Company
>> >
>> > On Wed, Jun 29, 2016 at 3:37 PM, Dave Page <dpage@pgadmin.org> wrote:
>> >>
>> >> Hi
>> >>
>> >> On Tue, Jun 28, 2016 at 12:30 PM, Murtuza Zabuawala
>> >> <murtuza.zabuawala@enterprisedb.com> wrote:
>> >> > Hi,
>> >> >
>> >> > PFA patch to fix the issue where 'serial' like types were not listed
>> >> > under
>> >> > type combobox while creating new table/column.
>> >> > RM#1393
>> >>
>> >> This changes the display text of all integer columns with a dependency
>> >> to the respective serial type, e.g.
>> >>
>> >> create table test(id integer primary key);
>> >>
>> >> gets reverse engineered into:
>> >>
>> >> CREATE TABLE public.test
>> >> (
>> >>     id serial NOT NULL,
>> >>     CONSTRAINT test_pkey PRIMARY KEY (id)
>> >> )
>> >>
>> >> I would strongly suggest that we only add "serial" and friends to the
>> >> list of available types for creating/adding a column. Once created, we
>> >> display the base type, with the default value clause etc.
>> >>
>> >> pgAdmin 3 does what you're trying to do here, but the logic is very
>> >> complex, likely broken in some edge cases, and I don't think it really
>> >> adds much. See pgColumn::GetDefinition() in
>> >>
>> >>
>> >> https://git.postgresql.org/gitweb/?p=pgadmin3.git;a=blob;f=pgadmin/schema/pgColumn.cpp
>> >>
>> >> --
>> >> 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
>
>



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

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