[ 
https://issues.apache.org/jira/browse/DERBY-6340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13788025#comment-13788025
 ] 

Dyre Tjeldvoll commented on DERBY-6340:
---------------------------------------

Hi Rick, thank you for your comments. 

I agree that the std does not mention comparison of distinct types to their 
STs, so that a cast is required in this case. I have updated the fs 
accordingly. I have also added a description of the the default identifiers for 
the casting functions. 

When it comes to the namespace of distinct UDT, I wondered if you could clear 
up a few things:

My understanding of Part 2, section 11.51 (user-defined type definition), 
general rule 2.b, is that the casting functions are created in the explicit or 
implied schema of the UDT. "CREATE FUNCTION SN.FNUDT ( ... where: SN is the 
explicit or implicit <schema name> of UDTN". Is DERBY-5901 the reason why the 
name must not conflict with a builtin function or aggregate?

A couple of observations:

* Without the ability to specify <cast to source> you can create at most one 
alias for each builtin type in the same schema?
* Due to DERBY-5901, we must either always specify <cast to source> or let the 
default identifier be non-standard as the default names mandated by the 
standard are already used by existing builtin functions in Derby?

Do you agree?


> Add support for CREATE TYPE AS <existing type> (synonym types)
> --------------------------------------------------------------
>
>                 Key: DERBY-6340
>                 URL: https://issues.apache.org/jira/browse/DERBY-6340
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Dyre Tjeldvoll
>            Assignee: Dyre Tjeldvoll
>         Attachments: CreateTypeAs_fs_draft_2.html, CreateTypeAs_fs_draft.html
>
>
> The SQL standard (2003) chapter 11.41 <user-defined type definition> allows 
> the creation of synonyms or aliases for an existing type: CREATE TYPE AS 
> <predefined type>. By allowing this in Derby we would simplify migration 
> from, and interoperation with, other databases.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to