alter Questions

5

Solved

I'm trying to run a query to update the user password using. alter user dell-sys with password 'Pass@133'; But because of - it's giving me error like, ERROR: syntax error at or near "-" ...
Sergiosergipe asked 6/9, 2013 at 11:18

5

Solved

I want to add an index to a table by using the ALTER syntax, but first check if it already exists on the table, and only add the index if it does not exist. ALTER TABLE tableName ADD INDEX IX_Ta...
Safeguard asked 15/5, 2015 at 12:9

3

Solved

What happens if you kill a long-running alter query? Will the alter query simply revert? How long could that take (as a proportion of the time it has already been running)? What if that query is b...
Kneehole asked 28/4, 2010 at 17:47

7

I am trying to add new type value to my existing types in PostgreSQL. But I get the following error error: ALTER TYPE ... ADD cannot run inside a transaction block The query I used to add a ne...
Himyarite asked 5/11, 2018 at 6:39

12

Solved

In postgres, how do I change an existing user to be a superuser? I don't want to delete the existing user, for various reasons. # alter user myuser ...?
Wellbeing asked 25/5, 2012 at 15:43

4

Solved

I am new to SQL, I was trying to change column name in my database's table. I am using 'xampp' with 'maria DB' (OS - Ubuntu 18.04) I tried all of the followings: ALTER TABLE subject RENAME COLU...
Chasechaser asked 12/12, 2018 at 2:40

18

Solved

I am trying to rename a column in MySQL community server 5.5.27 using this SQL expression: ALTER TABLE table_name RENAME COLUMN old_col_name TO new_col_name; I also tried ALTER TABLE table_name RE...
Renshaw asked 17/5, 2015 at 18:59

2

When I do- <modifyDataType tableName="EMCostUnit" columnName="GUID" newDataType="VARCHAR(50)"/> In liquibase, it always resets the nullable constraints. I...
Brainchild asked 8/3, 2016 at 10:27

6

I was just trying to add a column called "location" to a table (main_table) in a database. The command I run was ALTER TABLE main_table ADD COLUMN location varchar (256); The main_table contains...
Goff asked 29/9, 2011 at 15:16

6

Solved

Currently I am having the following MySQL table: Employees (empID, empName, department); I want to change the table to the following: Employees (empID, department, empName); How can this be done ...
Campestral asked 24/7, 2011 at 7:5

6

Solved

My database is not in UTF8, and I'd like to convert all the tables to UTF8, how can I do this?
Humanize asked 27/1, 2010 at 21:8

4

Solved

Initially, the table "MyTable" has been defined in the following way: CREATE TABLE IF NOT EXISTS `MyTable` ( `Col1` smallint(6) NOT NULL AUTO_INCREMENT, `Col2` smallint(6) DEFAULT NULL, `Col3` ...
Hillard asked 15/5, 2012 at 9:37

12

Solved

I want to remove constraints from my table. My query is: ALTER TABLE `tbl_magazine_issue` DROP CONSTRAINT `FK_tbl_magazine_issue_mst_users` But I got an error: #1064 - You have an error in y...
Masked asked 2/1, 2013 at 12:27

5

Solved

I am busy studying MySQL and I understand that update is used to update a record or row in a table. So what does alter do that is so different? Seems like they are the same. Thanks, any help will ...
Instep asked 2/7, 2012 at 11:47

9

Solved

I am trying to add a new column to my MYSQL table using PHP. I am unsure how to alter my table so that the new column is created. In my assessment table I have: assessmentid | q1 | q2 | q3 | q4 | q...
Ranique asked 19/4, 2013 at 21:12

1

Solved

I have a table in Clickhouse, table1, with columns A and B. I want to alter this table to have a new column C. For the purpose of default values (future data will have a different approach) I want ...
Apgar asked 15/9, 2021 at 15:46

4

Solved

I have a UNIQUE, NON CLUSTERED index on a table that is currently using 4 columns for the index. I want to create an alter script that can merely add another column to this index. The new column ty...
Amalea asked 19/3, 2012 at 7:53

4

Solved

I want to change the datatype of some primary-key columns in my database from INT to BIGINT. The following definition is a toy-example to illustrate the problem: CREATE TABLE IF NOT EXISTS `owner`...
Sabina asked 26/1, 2012 at 12:45

4

Solved

I am trying to rename a columnName in Hive. Is there a way to rename column name in Hive . tableA (column1 ,_c1,_c2) to tableA(column1,column2,column3) ??
Goles asked 26/2, 2014 at 12:25

4

I have created a view that is based on another view and a table. I want to add new column of type varchar. I did like below, But getting syntax error? I am new to SQL, So,could not understand ALTE...
Taegu asked 16/9, 2016 at 15:34

3

Solved

I need to execute in python a SQL query that adds a new column, in sqlite3. The problem is that sometimes it already exists. So previous to executing the query I need to check if the column alrea...
Malva asked 1/3, 2010 at 8:59

1

Suppose the next table: sch_test.test_cascade a b c ----------- 6 10 1 6 10 1 6 10 2 6 10 2 a, b and c are integers and the table is partitioned by c. When I add a column in Hive with CAS...
Tso asked 13/12, 2017 at 16:50

12

Solved

I would like to write a single SQL command to drop multiple columns from a single table in one ALTER TABLE statement. From MSDN's ALTER TABLE documentation... DROP { [CONSTRAINT] constraint_name...
Suctorial asked 14/6, 2011 at 15:32

0

MySQL 8.0 - As stated in MySQL Official Doc and MySQL Server Team, Alter table with Algorithm=INSTANT adds the column instantly without taking any lock. But, It worked out different. Test Setup - T...
Pinhead asked 18/8, 2020 at 7:13

4

I have a child table. and foreign key there with ON DELETE CASCADE while creating the table. There are no records either in child or parent table. I want the primary key, foreign key to be as the...
Dyanna asked 28/10, 2014 at 9:28

© 2022 - 2025 — McMap. All rights reserved.