---------- Original Message -----------
From: sqlsvr <sql...@yahoo.com>
To: firebird-net-provider@lists.sourceforge.net
Sent: Sat, 12 Jun 2010 21:28:25 -0700 (PDT)
Subject: [Firebird-net-provider] Rename a table

> How do you rename a table? Every other DBMS supports renaming a table. 
> During development, table names can AND DO change and firebird does 
> not support this. I see that there is already an old request in the 
> firebird tracker that the "firebird developers arrogance" has chosen 
> to ignore...a real shame....if this is the case, I assume that 
> "firebird developers" never worked in a production/development 
> environment....I'm switching back to Oracle.
> -- 
------- End of Original Message -------

Do you need that table name for anything else? If not, you could use the 
following as a stop-gap measure to rename Y to X:

create view x (...) as select ... from y;

Single-table views in Firebird are automatically (and transparently) 
updateable, 
so you shouldn't even need to put a trigger on 'x' to pass-through to 'y'. You 
also shouldn't have to worry about the optimizer, it'll know how to use the 
indices on 'y' when you only work with 'x'. The only thing you can't do is 
create 
new FK's pointing to the view, they'll need to point to the underlying table. 
But 
if you're renaming a terabyte table, that's the least of your problems.

As others have pointed out, any table-name change is a problem, in any RDBMS, 
and 
others don't do your work for you either. There's not only the internal 
references to fix, but any SQL in client apps, too. What kind of downtype is 
acceptable? I've found that even on commodity hardware, it only takes a very 
few 
minutes to do full backup/restore on gigs of data; when you get a chance, maybe 
you should experiment with transferring data from one table to the other, it 
might not be as bad as you think.

-Philip

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to