How to Return a List of Available Collations in PostgreSQL

In PostgreSQL, we can use the pg_collation catalog to get a list of the available collations. Another way to do it is to use the \dOS command.

Using the first method, we can run the following statement to return a list of available collations in PostgreSQL:

SELECT * 
FROM pg_collation;

These collations are mappings from an SQL name to operating system locale categories.

Continue reading

What is Collation in Databases?

In database systems, Collation specifies how data is sorted and compared in a database. Collation provides the sorting rules, case, and accent sensitivity properties for the data in the database.

For example, when you run a query using the ORDER BY clause, collation determines whether or not uppercase letters and lowercase letters are treated the same.

Collation is also used to determine how accents are treated, as well as character width and Japanese kana characters. Collation can also be used to distinguish between various ideographic variation selectors in certain collations (such as the Japanese_Bushu_Kakusu_140 and Japanese_XJIS_140 collations that were introduced in SQL Server 2017).

Different database management systems will provide different collation options. Depending on the DBMS, collation can be specified at the server level, the database level, the table level, and the column level. Collations can also be specified at the expression level (so you can specify which collation to use when you run a query), and at the identifier level.
Continue reading

New Features in SQL Server 2017 (Database Engine)

Below is a list of new features added in the SQL Server 2017 database engine.

Support for Linux and Mac

For the first time since SQL Server was introduced back in 1989, SQL Server is available on Linux (Red Hat, SUSE, Ubuntu) and Docker.  This means you can also install SQL Server 2017 on a Mac (by using a Linux image in a Docker container).

The initial release of SQL Server 2017 for Linux doesn’t include the full set of features available in the Windows release, but it’s a good start.  Microsoft has stated that it is working on including more features in future releases.

For now, here’s a list of the main features available in SQL Server 2017 for Linux (as of its initial release).
Continue reading

SQL Server 2017: Available Features on Linux

SQL Server 2017 is available on Linux and Docker (which means that it’s also available on Mac). This is the first time SQL Server has been available on a non-Windows platform.

However, not all SQL Server features are available on Linux (at least, not in the initial release).

The following table outlines the main features available in the initial release of SQL Server 2017 on Linux. These are the same features available if you are running SQL Server on a Mac (given the Mac runs SQL Server 2017 via a Linux Docker container).
Continue reading

How to Change the Collation of a SQL Server Database using T-SQL

This is a quick article to demonstrate how to use Transact-SQL to change the collation of a database in SQL Server.

Here’s the basic code:

USE master;  
GO
 
ALTER DATABASE Solutions  
COLLATE French_CI_AS ;  
GO 

This first changes to the master database, then we use the ALTER DATABASE statement to change the collation of the Solutions database to French_CI_AS collation.
Continue reading