firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Allow ALTER DOMAIN to change length of CHAR/VARCHAR fields.

Open TommiPrami opened this issue 8 months ago • 4 comments

Hello,

If later on of the DB development, you find out that you need to make certain fields ("by domain") larger, or maybe smaller and none of the fields are longer than the new lenght, would be super nice and easy top just use ALTER DOMAIN for it.

For sure there might me some corner cases when this could not be possible, and for sure if miss used, could be dangerous. But making the change other way(s) is most likely massive and tedious task.

Making domain smaller, there could be something like ALLOW TRUNCATE, if user is willing or can loose some of the existing data.

Whaty do you think, is this doable? I think someone told that oracle supports this.

As separate issue would be maybe nice to have possibility to chan ge number of decimals etc in floating point fields etc also.

-Tee-

Currently (in Fb 4.0.x) it seems to fail with:

Image

TommiPrami avatar Apr 09 '25 07:04 TommiPrami

Everything is doable in the soft world. It is a matter of rationale and investments. You can eve try to do it yourself.

PS: I see no support for data type changes in Oracle.

aafemt avatar Apr 09 '25 07:04 aafemt

Everything is doable in the soft world. It is a matter of rationale and investments. You can eve try to do it yourself.

Don't speak C/C++ at all, so most likely not. Would be enormous task to learn the language and the code base of the Firebird.

What I meant by doable, that would it be easy enough to someone do with reasobnable effort, I have no idea how large or hard task it would be. Could be hour of coding or could be monts worth of work from Firebird coding Guru. Dunno.

With or without compensation, that is separate discussion.

-Tee-

TommiPrami avatar Apr 09 '25 07:04 TommiPrami

It was already discussed among developers (I failed to find the URL immediately, will search better a bit later) and I had a draft implementation done for some customer. So I believe this is feasible and even desirable.

dyemanov avatar Apr 09 '25 08:04 dyemanov

Sweet

TommiPrami avatar Apr 09 '25 08:04 TommiPrami