Обсуждение: Creating types

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

Creating types

От
Dave Page
Дата:
A short while ago I noticed that there are a couple of issues when
creating new datatypes which essentially mean the disalogue is useless
for creating 'external' types (as opposed to enums or composite types.

The basic problem is that the input, output, send and receive functions
are have the type itself as either the return datatype or one of the
parameters. Postgres handles this chicken-and-egg situation by allowing
you to create a 'shell' type to then use to create the functions, which
then gets replaced with the real type.

On way we could handle this would be to allow the user to create the new
functions as part of the type definition process, but this seems like a
lot of work given that we've never had any bug reports about this (which
indicates noone is creating real types in pgAdmin anyway.

I'm currently thinking the way forward is to do the following:

- Allow the user to create shell types. This would be another option
alongside Composite, Enumeration and External.

- Populate the combo boxes for the aforementioned functions when the
user changes to the tab they're on, using the type name entered on the
first tab to select the appropriate functions.

Thoughts/better ideas?

/D

Re: Creating types

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> [...]
> I'm currently thinking the way forward is to do the following:
>
> - Allow the user to create shell types. This would be another option
> alongside Composite, Enumeration and External.
>
> - Populate the combo boxes for the aforementioned functions when the
> user changes to the tab they're on, using the type name entered on the
> first tab to select the appropriate functions.
>

Your first idea seems much more simple to code than the second one but
it's more work for the user... but, as you say, no one sent report on
this issue, so I'm all for the first idea.

Regards.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Creating types

От
Dave Page
Дата:
Guillaume Lelarge wrote:
> Dave Page a écrit :
>> [...]
>> I'm currently thinking the way forward is to do the following:
>>
>> - Allow the user to create shell types. This would be another option
>> alongside Composite, Enumeration and External.
>>
>> - Populate the combo boxes for the aforementioned functions when the
>> user changes to the tab they're on, using the type name entered on the
>> first tab to select the appropriate functions.
>>
>
> Your first idea seems much more simple to code than the second one but
> it's more work for the user... but, as you say, no one sent report on
> this issue, so I'm all for the first idea.

Those two are individual parts of the same idea. We'd need to do both :-(

Idea number one is the more complex one in which the user can create the
required functions as part of the process of creating the type - ie. we
spawn sub-dialogues in which the functions can be defined as required.

/D

Re: Creating types

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> Guillaume Lelarge wrote:
>> Dave Page a écrit :
>>> [...]
>>> I'm currently thinking the way forward is to do the following:
>>>
>>> - Allow the user to create shell types. This would be another option
>>> alongside Composite, Enumeration and External.
>>>
>>> - Populate the combo boxes for the aforementioned functions when the
>>> user changes to the tab they're on, using the type name entered on the
>>> first tab to select the appropriate functions.
>>>
>> Your first idea seems much more simple to code than the second one but
>> it's more work for the user... but, as you say, no one sent report on
>> this issue, so I'm all for the first idea.
>
> Those two are individual parts of the same idea. We'd need to do both :-(
>

Oops. I didn't understand this. This probably means I should go to bed
earlier :)

> Idea number one is the more complex one in which the user can create the
> required functions as part of the process of creating the type - ie. we
> spawn sub-dialogues in which the functions can be defined as required.
>

I need to take a better look at this. I know the contents of second tab
depend on which kind of type we want to create, but I thought it was
easy to do.

Sorry about this...


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com