Subject Re: [firebird-support] Remove column attribute which overrides domain attribute
Author Jorge Andrés Brugger
Helen Borrie escribió:
>> Then, I need to change again, if needed, each time the domain changes.
>>
>
> "Each time the domain changes." This implies
> that you believe domains are going to change
> regularly. What, then, do you think is the
> purpose of defining domains (she inquired quizzically...) ?
>
I agree. My situation is: I´m migrating a 1.5 DB to 2.x, and use the 2.0
new es_es_ci_ai collation. I have to do this on several databases. Then,
my plan was:

1) Backup 1.5 DB
2) Install 2.x FB
3) Restore DB
4) Change domains collation ... and voilá!

But, I´ve realized that I´ve several cases of field-level-defined
collation (even in domain-based fields), and, if I had a "drop field
attrib", I could make a script to do it, and, if I had "alter DOMAIN"
with collation support, conversion would be a piece of cake :)
>> (FYI, "alter DOMAIN d_test type VARCHAR(10) CHARACTER SET ISO8859_1"
>> works, but you cannot specify collate)
>>
>
> That's quite probable, if there is currently a
> collation applied that produces smaller index
> keys than the one you want to change it to. What
> does it tell you when you try?
>
As you can actually change charsets (FB 2.1), if you want to go from
varchar(10) UTF8 to ISO8859_1, for example, an error is raised: "New
size specified for column D_TEST must be at least 40 characters.", and
is right.

Could alter domain be complete supporting collations, checks could be
the same for charsets :)

> But, again, you're not meant to be changing
> domain definitions on an established
> database. If you need a domain with a different
> set of attributes then just define it and alter
> any column definitions to use that domain instead.
>
> ./heLen
>
>
Regards

--
Jorge Andrés Brugger
Informática
DASU - Obra Social del Personal de la Universidad Nacional de la Patagonia
Comodoro Rivadavia, Chubut, Argentina
Teléfono (0297) 446-4444 int. 103
Correo electrónico: jbrugger@...
Website: www.dasu.com.ar



[Non-text portions of this message have been removed]