Ahhh! Excellent. I didn't think my idea was quite right. Thanks.
On Thu, Nov 15, 2001 at 09:32:38AM -0600, Paul DuBois wrote: > At 10:06 AM -0500 11/15/01, Anthony R. J. Ball wrote: > > MySQL 3.23.41 on Solaris > > > > > > Alright, I have a system where data comes in once... or maybe > >a few times a day. I use this data to recreate a table, and then > >I need to safely and quickly replace the old table. I was thinking > >lock original table, drop it, and then rename the new table, but > >I wasn't sure the lock would stay once the table was dropped. Is > >this the right way to go about it? > > Use RENAME TABLE to rename them both in the same statement, then > drop the old one: > > RENAME TABLE t TO t_old, t_new TO t; > DROP TABLE t_old; > > > RENAME TABLE is available as of MySQL 3.23.23. > > > > >-- > > ___ __ __ __ _ _ ____ _ _ ____ ____ > >/ __)( )( ) /__\( \/ )( ___) ( \( )( ___)(_ _) > >\__ \ )(__)( /(__)\\ / )__) ) ( )__) )( > >(___/(______)(__)(__)\/ (____)()(_)\_)(____) (__) > >Do not follow in the footsteps of men of old; seek what they sought. > -- ___ __ __ __ _ _ ____ _ _ ____ ____ / __)( )( ) /__\( \/ )( ___) ( \( )( ___)(_ _) \__ \ )(__)( /(__)\\ / )__) ) ( )__) )( (___/(______)(__)(__)\/ (____)()(_)\_)(____) (__) "I am not a number! I am a free man!" -- The Prisoner --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php