Skip to main content

Questions tagged [rename]

This tag is for renaming database, DBMS instances and database objects (such as tables, views, columns, etc.)

Filter by
Sorted by
Tagged with
0 votes
1 answer
18 views

How to rename hostname in a Mongodb replica set

I need to know how I can rename my hosts belonging to my replica environment in mongodb, I currently have the following configuration: rs.conf() { "_id" : "myreplicaset01", ...
miguel ramires's user avatar
0 votes
0 answers
46 views

Rename table taking too long on MySql 8

We recently upgraded from MySql 5.7 to 8 and have run into this issue. We have a rename table operation that runs every minute. It used to take a fraction of a second, but now it takes over 6.0 ...
Faheem's user avatar
  • 101
0 votes
0 answers
17 views

Is there a lot of overhead (IO/Storage) for Barman if I rename a database in my postgres instance?

Barman backs up the whole instance, so I would think that renaming one of the databases in an instance is simply an alter script: ALTER DATABASE old_database_name RENAME TO new_database_name; ... ...
André Christoffer Andersen's user avatar
0 votes
0 answers
59 views

How to replace (drop and rename) a table without triggering constraints in postgres

I have a table (A) that I need to reprocess from time to time. Doing that using update or upsert is really slow, so, to make things faster, I decided to create a new table (B), copy all the rows from ...
Sassa's user avatar
  • 135
0 votes
1 answer
118 views

How to rename columns in an SQL-server database

My employer has the habit of giving customer specific tables a name, starting with the name of the customer. This makes it difficult to call the sp_rename stored procedure for renaming column names, ...
Dominique's user avatar
  • 581
0 votes
1 answer
2k views

best and quickest way to rename the primary key of a table

when I need to rename a table and consequently its primary key (and all other constraints) as well I use the following simple example script: if object_id('dbo.Radhe1',N'U') is not null drop table ...
Marcello Miorelli's user avatar
0 votes
4 answers
687 views

How to tell Microsoft SQL Server Management Studio that a DB rename must be done completely

I have an older copy of a database. I retrieved it from customer system by taking a backup and restore it on my local PC. I would like to have a look at a more recent copy of that same database. ...
Dominique's user avatar
  • 581
0 votes
1 answer
1k views

What is the standard SQL way to rename a column?

So far I've seen ALTER TABLE RENAME, ALTER TABLE CHANGE and ALTER TABLE MODIFY. What I'm trying to achieve is something like ALTER TABLE my_table RENAME col_old_name TO col_new_name, which can be a ...
vesperto's user avatar
  • 125
1 vote
2 answers
329 views

Are extra unused columns helpful in future?

Currently, while creating tables, we create 4 to 5 extra columns with temp names like c0, c1, c2 etc. to be used later when needed and are left NULL by default. This way we don't have to create ...
Bhupendra Pandey's user avatar
3 votes
1 answer
836 views

Will renaming a MySQL table to another database result in a full table copy operation on disk?

I understand that renaming a table within the same database will not generally result in a table copy... It's not clear to me if this holds true for renaming across databases. For reference, I want to ...
Dan's user avatar
  • 235
1 vote
2 answers
622 views

How to rename a column name which has been created by a math function in mysql? Using ALTER TABLE is giving ERROR: 1064 (42000)

INPUT: CREATE TABLE dist -> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) -> FROM config; OUTPUT: +------------------------------------------+ | ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) | +-----...
Titiksha 's user avatar
2 votes
1 answer
244 views

Seamless SQLServer Database Name Change

I need to change the name for a few databases, however the databases are used by a lot of applications managed by several different teams. It would take some time for all the applications to finish ...
JieLong's user avatar
  • 167
2 votes
3 answers
725 views

Is it good practice to refer to a table with different names in a database schema? [closed]

We have a database currently running with a table named a certain way (let's say thing for the sake of example), and references to that table named the same way (FK would be named thing_id for ...
Aweb's user avatar
  • 21
5 votes
2 answers
3k views

How can I safely rename a sequence in PostgreSQL, ideally without downtime?

We want to rename some sequences in our production database for certain reasons. Is there a way to do this safely in production without having to first close all connections to the database? It's ...
Henrik N's user avatar
  • 197
0 votes
1 answer
570 views

Renaming multiple databases on a MySQL slave

I have 4 mysql databases that I'm replicating from a master to a slave. In the past, I have renamed one of them because the slave is also a dev server where it has a dev version of that schema with ...
churnd's user avatar
  • 121
0 votes
0 answers
60 views

renaming Windows machine and SQL Server

We've built a new Windows 2016 VM with SQL Server 2016 that we'll migrate a mission critical database currently on SQL Server 2008 R2 to. The original plan was to have users test, test, test and test ...
Joe G's user avatar
  • 1
2 votes
0 answers
1k views

Rename table in Postgres and update its usages in all functions

I need to safely rename a table and be sure, that all usages of this table in functions are also renamed. Example: CREATE TABLE test ( id serial, name varchar(255) ); CREATE FUNCTION public....
AntonAL's user avatar
  • 121
1 vote
1 answer
712 views

SQL Server and TFS - How to rename stored procedures

After a while one may wish to do some light refactoring, such as giving more appropriate names to stored procedures as their functionalities are better established. For the life of me, I simply ...
Elaskanator's user avatar