[
https://issues.apache.org/jira/browse/MADLIB-1281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16664918#comment-16664918
]
Orhan Kislal commented on MADLIB-1281:
--------------------------------------
I have considered adding checks for UDCs as well but I haven't found a way to
create a dependency to test the process. It seems Postgresql just replaces the
cast with the function even in the views.
{code:sql}
madlib=# \dC+ madlib.*
List of casts
Source type | Target type | Function | Implicit? |
Description
--------------------+--------------------+---------------------+-----------+-------------
bigint | madlib.svec | svec_cast_int8 | no |
double precision | madlib.svec | svec_cast_float8 | no |
double precision[] | madlib.svec | svec_cast_float8arr | no |
integer | madlib.svec | svec_cast_int4 | no |
madlib.svec | double precision[] | svec_return_array | no |
numeric | madlib.svec | svec_cast_numeric | no |
real | madlib.svec | svec_cast_float4 | no |
smallint | madlib.svec | svec_cast_int2 | no |
(8 rows)
madlib=# create view v6 as select '{1}:{1}'::madlib.svec::double precision[];
CREATE VIEW
madlib=# drop cast if exists(madlib.svec as double precision[]);
DROP CAST
madlib=# drop function madlib.svec_return_array(madlib.svec);
ERROR: cannot drop function madlib.svec_return_array(madlib.svec) because
other objects depend on it
DETAIL: view v6 depends on function madlib.svec_return_array(madlib.svec)
HINT: Use DROP ... CASCADE to drop the dependent objects too.
{code}
Unless we find a way to impose dependency on a cast, we should update the
upgrade_util.py file to NOT remove drop/create statements for casts. If a new
version changes the function of a cast, it will not be reflected in the
database.
> Create SQL scripts to get lists of changed UDOs and UDOCs
> ---------------------------------------------------------
>
> Key: MADLIB-1281
> URL: https://issues.apache.org/jira/browse/MADLIB-1281
> Project: Apache MADlib
> Issue Type: Improvement
> Components: Madpack
> Reporter: Orhan Kislal
> Priority: Minor
> Fix For: v1.16
>
>
> Currently while upgrading, we use custom scripts to get the list of changed
> UDFs, UDAs and UDTs (diff_udf.sql and diff_udt.sql). We need to create sql
> files that will give us the list of changed UDOs and UDOCs in the same output
> format as UDFs, UDAs and UDTs.
> We should also integrate these scripts into our create_changelist.py tool and
> make sure the upgrade tools work correctly with changed UDOs and UDOCs.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)