Claus Windeler wrote:
> 
> It's working with "DROP DEFAULT". Thanks!
> 
> Isn't it possible to change a SERIAL ? I created a test table
> 
> CREATE TABLE "TESTUSER"."TEST"
> (
>       "ID"               Integer    NOT NULL    DEFAULT SERIAL (800),
>       "EINGABE"               Varchar (100),
>       PRIMARY KEY ("ID")
> )
> 
> and inserted some data. The serial correctly starts with 800.
> Then I droped the SERIAL
> 
> ALTER TABLE "TESTUSER"."TEST" COLUMN "ID" DROP DEFAULT
> 
> and created a new SERIAL with
> 
> ALTER TABLE "TESTUSER"."TEST" COLUMN "ID" ADD DEFAULT (1000)
> 
> When I now insert new data, the serial continues from the last
position
> (for me
> 805) and not from 1000, the start value of the new SERIAL.
> 
> Is this a correct behaviour ??
> 

No, this is not correct. The bug will be fixed with the next version.
If between dropping of the default and creation of the new (higher)
default the database is set to ADMIN-mode and then back to ONLINE-mode,
the new serial-value should be used. Without this, the cache where it is
stored during online-mode remains unchanged, meaning: it is not handled
correctly when dropping the corresponding serial.
When dropping sequences, it is handled correctly.

Elke
SAP Labs Berlin

> Bye
> 
> Claus
> 
> 
> > Hello Claus,
> >
> > try in the SQL Dialog the statement
> >
> > ALTER TABLE "TESTUSER"."TEST" COLUMN "ID" DROP DEFAULT
> >
> > Regards
> > Wolfgang
> >
> >
> > -----Original Message-----
> > From: Claus Windeler [mailto:[EMAIL PROTECTED]
> > Sent: Dienstag, 8. Februar 2005 11:46
> > To: [email protected]
> > Subject: How to remove "DEFAULT SERIAL (1)" from column with SQL
Studio
> >
> >
> > Hello!
> >
> > I set "DEFAULT SERIAL (1)" on an integer column and now I want to
remove
> > or
> > modify it with "Alter Table" in SQL Studio. But I always get an
error
> > message
> > like
> >
> > General error;-4018 POS(39) Unknown default
> > ALTER TABLE "TESTUSER"."TEST" COLUMN "ID" ALTER DEFAULT NULL
> >
> > General error;-4018 POS(39) Unknown default
> > ALTER TABLE "TESTUSER"."TEST" COLUMN "ID" ALTER DEFAULT SERIAL (100)
> >
> > The SQL command is created by SQL Studio.
> >
> > What do I have to do to remove the "DEFAULT SERIAL (1)" from my
column
> > "ID" ??
> >
> > Bye
> > Claus Windeler
> >
> >
> > -------------------------------------------------
> > This mail sent through IMP: http://horde.org/imp/
> >
> >
> > --
> > MaxDB Discussion Mailing List
> > For list archives: http://lists.mysql.com/maxdb
> > To unsubscribe:
> > http://lists.mysql.com/[EMAIL PROTECTED]
> >
> >
> 
> 
> 
> 
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
> 
> 
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to