Issue Details (XML | Word | Printable)

Key: CORE-1202
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Jorge Andres Brugger
Votes: 12
Watchers: 8
Operations

If you were logged in you would be able to see more operations.
Firebird Core

"alter domain" supporting collation change

Created: 11/Apr/07 06:36 AM   Updated: 09/Jun/20 05:02 PM
Component/s: Charsets/Collation
Affects Version/s: 2.1 Initial
Fix Version/s: None

Issue Links:
Relate
 


 Description  « Hide
Related to CORE-1058: "ALTER DOMAIN and ALTER TABLE don't allow to change character set and/or collation"

CREATE DOMAIN D_TEST AS
VARCHAR(10) CHARACTER SET ISO8859_1
COLLATE ES_ES

You can do:
alter DOMAIN d_test type
VARCHAR(10) CHARACTER SET iso8859_1

But you can't do:
alter DOMAIN d_test type
VARCHAR(10) CHARACTER SET iso8859_1
COLLATE ES_ES

Adding collate support for alter domain would be useful

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Simonov Denis added a comment - 19/May/14 09:58 AM
As recently direct editing system tables is prohibited, the need for this sql statement became more evident. In particular IBExpert previously allowed to change the collation modifying system tables. Now that opportunity taken away.

Radek Palmowski added a comment - 06/Jul/18 10:45 PM
This is a very serious restriction that inhibits migration to FB3.
We have a database in which we sometimes want to change the domain XXX from WIN1250 PXW_PLK to UTF8 UNICODE.
Because the domain is used in tables(14), views(126), triggers(15) and procedures(59) in parameters and local variables in body, so to do this we must:
- create a new domain XXX_UTF with character set UTF8 and collate UNICODE
- drop all triggers and procedures which uses XXX domain,
- change all fields from the XXX domain to the new one XXX_UTF in all tables
- delete the old domain
- change the name of the new domain from XXX_UTF to XXX
- restore all procedures and triggers

It is possible to change priority of this issue?

Karol Bieniaszewski added a comment - 05/Jun/20 04:02 PM
It is not only limitation it work now wrongly as it alter collation to some default.
e.g.

CREATE DOMAIN XXX Varchar(1000) CHARACTER SET WIN1250 COLLATE PXW_PLK;

now when you alter its e.g. size

ALTER DOMAIN XXX TYPE VARCHAR(2000);

it will be after alter equivalent to

CREATE DOMAIN XXX Varchar(2000) CHARACTER SET WIN1250 COLLATE WIN1250;

as you can see it change PXW_PLK to WIN1250;
And as we cannot specify collation all benefits from domain dissapear here.
As we must now create new domain and assingn it to all fields, stored procedure parameters and variables by hand.