[Info-Ingres] change default value of a column in a table
johny_x at hotmail.com
johny_x at hotmail.com
Fri Apr 27 11:33:26 CDT 2007
On 26 apr, 14:17, Karl & Betty Schendel <schen... at kbcomputer.com>
wrote:
> At 12:55 PM +0200 4/26/07, Aarts Johny wrote:
>
> >Is it possible to update te defvalue in the table iidefault as $ingres user.
> >For example to change the default value for a column in a table.
>
> It's not a good idea, because there's one iidefault entry for all
> columns using that value. You can kinda-sorta get away with it,
> if the default you are changing is unique to one particular column.
> You'll have to flush RDF or restart the DBMS server after you
> do any such thing, to ensure that your change shows up.
>
> I guess some sort of alter column default statement would be
> useful.
>
> Karl
Yes I know it, in the past I did it like this.
copy the table out,
recreate the table with te defaults
copy the table in.
Then restore structure, indexes, grants, views, rules, primairy keys,
and all the references from the other tables to this table.
Then I get the error 'you can not create contraints on a table that is
not journaled and the database is journaled'.
After taking a checkpoint I can create te constraints and references.
But with a database with more then 10GB data and several tables with
millions of rows this job take a whole weekendday because i can do
this only when users are offline.
With a update as $ingres user in the table iiattibute, column
attdefid1 to the correspondending defid1 in the iidefault table this
job is fixed in 5 minutes.
Regards
Johny Aarts
More information about the Info-Ingres
mailing list