how to apply case insensitive collation setting to multiple columns for a non empty Redshift table - amazon-redshift

here in the doc it says Redshift supports collation for CREATE table statements https://aws.amazon.com/about-aws/whats-new/2021/06/amazon-redshift-now-supports-case-insensitive-collation-with-column-level-overrides/
but i want to apply the settings for the existing table.

Related

How to get SQL used to create a constraint in PostgreSQL?

I can use the pg_indexes view to get the SQL used to create an index (as in the sql in this question: How to get indexes, primary keys, and all constraints for a schema in PostgreSQL using standard sql).
Is there a way to get the SQL for constraints in PostgreSQL? I'm not seeing a pg_constraints table and the information I'm finding on line isn't pointing me to a solution, for example, these are some of the hits coming up when I Google the terms (postgresql get sql for constraint).
https://dba.stackexchange.com/questions/206562/postgres-read-constraints-definition
Postgres Check Constraint definition
https://www.geeksforgeeks.org/sql-query-to-display-all-the-existing-constraints-on-a-table/

How to stop creation of multiple indexes on same column of same table in Postgres

In Oracle, if we try to create two indexes on same column of same table then it gives ORA-01408: such column list already indexed.
create index tmp_idx1 on student(roll_no);
create index tmp_idx2 on student(roll_no);
ORA-01408: such column list already indexed.
But, same if we try to create in Postgres, it allows.
How can we stop this in postgres and make behavior like in Oracle?

Is it possible to have a table without any clustered index on DB2 version 9.7?

I've checked index type in one of my table and found that all indexes are of type REG (non clustered). As per DB2 documentation, DB2 by default use the first index created as clustered index if not explicitly specified. Why DB2 is showing all of my indexes as REGULAR?
Reference: http://www-01.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/com.ibm.db2z10.doc.intro/src/tpc/db2z_clusteringindexes.dita
"When a table has a clustering index, an INSERT statement causes DB2 to insert the records as nearly as possible in the order of their index values. The first index that you define on the table serves implicitly as the clustering index unless you explicitly specify CLUSTER when you create or alter another index. For example, if you first define a unique index on the EMPNO column of the EMP table, DB2 inserts rows into the EMP table in the order of the employee identification number unless you explicitly define another index to be the clustering index"
Here is my understanding of your question - You read on the IBM documentation website that
DB2 by default use the first index created as clustered index if not explicitly specified
and your question is that you saw your DB2 9.7 LUW database and saw only REG indexes.
#mustaccio is correct. DB2 LUW never creates clustered indexes by default.
As per DB2 9.7 LUW documentation here, it says
clustering indexes cannot be specified as part of the table definition
used with the CREATE TABLE statement. Instead, clustering indexes are
only created by executing the CREATE INDEX statement with the CLUSTER
option specified. Then the ALTER TABLE statement should be used to add
a primary key that corresponds to the clustering index created to the
table. This clustering index will then be used as the table's primary
key index.
And #Ian Bjorhovde is also correct, you are reading DB2 for z/OS documentation. There are many differences between DB2 LUW and DB2 for z/OS

postgresql: alter multiple columns

My database has severals table with some column type 'money'. I would like to alter all these columns (in different tables) in a single statement rather than change type column by column, to avoid omissions.
You'll have to repeat the altering query for every column.
You might want to create a program code to do that for you. You know, with loops.
In order for the database to alter all the tables atomically you should enclose all the altering queries in a transaction (PostgreSQL supports transactional DDL).

firebird set case insensitive collation

How can I set case insensitive collation for the whole database?
Do I have to recreate the tables and data?
Database is firebird 2.5
Quote from the release notes:
The character set and collation of existing columns are not affected by ALTER CHARACTER SET changes.
So yes, it seems that the best way would be to recreate the database with desired default character set and collation (and / or with explicit definitions in domains).