collation

PostgreSQL utf8 character comparison

我怕爱的太早我们不能终老 提交于 2019-12-13 06:32:37
问题 I am changing from MySQL to PostgreSQL but can't find equivalent to MySQL's collation utf8_general_ci . What I'm trying to achieve here is to be able to compare strings using general language rules rather then binary comparison, i.e. í = i, š = s, ḩ = h, etc... Is there a way how to make PostgreSQL search for strings using general language rules? Many thanks! 回答1: This is, basically, what most modern postgresql installations will do for you by default. But you may also be interested in initdb

Change collation of ALL tables of ALL databases at the same time

99封情书 提交于 2019-12-13 05:16:27
问题 Is it possible to change collation of ALL tables of ALL databases of the server at the same time? I find lots of scripts but only for ONE database at time. We have 100+ databases and I need to use a unique collation to all of them. Can we list using some kind of script? Thanks. (Sorry for the bad english ) Obs1: If possible, I need to change columns collation too. we need ONE collation for everything ! Thanks friends. EDITED: Here i have a script that lists "all" tables of a database, and it

How can I figure out the default charset/collation in my MySQL [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-12-13 03:48:38
问题 This question already has answers here : How do I see what character set a MySQL database / table / column is? (13 answers) Closed 4 months ago . I use MySQL and MySQL Workbench 8.0+ on Ubuntu 18.04. When I create a column with a string type, I leave the charset/collation to default. In MySQL workbench, it just show me that is it Default Charset . What is the default charset used by my current MySQL and Workbench? How can I figure this out? 回答1: Use SHOW CREATE TABLE . For example: CREATE

Sql collation issues when deploying live

霸气de小男生 提交于 2019-12-13 03:10:26
问题 History: I had a deployment the other night which involved executing a script that creates a stored procedure. However when running the script, an error occurred about the collation of the DB. The Problem: With the help of our friend Google, I managed to find out that the problem I was having was because on our live environment's db has one collation and the temporary DB's collation is different, and I was getting an error when trying to insert into a variable table. The Question: What is the

Set column collate in NHibernate mapping

荒凉一梦 提交于 2019-12-13 02:23:24
问题 I'm looking into NHibernate mapping and we are in a situation where we require to specify the collate on a specific column. Preferably during the mapping. The idea is that after NHibernate creates the schema, it will look something like this: CREATE TABLE [dbo].[Foo] ( [Bar] NVARCHAR (128) NULL **collate sql_latin1_general_cp1_cs_as**, [BarTwo] NVARCHAR (max) ); I'm currently using Fluent but an xml solution would be fine as well. 回答1: I found out that I can add the collate to the

MySql 5.7 Function UUID() default collation - Illegal mix of collations

谁都会走 提交于 2019-12-13 00:41:36
问题 Problem: MySQL's uuid() default collation does not compare to configured connnection collation. I have a database + tables + fields created with charset: utf-8 and collation utf8_polish_ci. The my.cnf is as follows: init_connect='SET NAMES utf8 COLLATE utf8_polish_ci' character-set-server=utf8 collation-server=utf8_polish_ci character sets: mysql> show variables like "char%"; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+------

give parameters in sql expression in NHibernate

只谈情不闲聊 提交于 2019-12-12 23:18:35
问题 I want to use collation in a query in NHibernate and apparently the only way to do that (at least from what I found) is through adding an sql expression (Can I customize collation of query results in nHibernate?) So I have something like c.Add(Expression.Sql("Title COLLATE Divehi_90_BIN2 LIKE ?", title, NHibernateUtil.String)) However this matches the exact string and I want to use % on both sides. Title COLLATE Divehi_90_BIN2 LIKE %?% gives me an error, but padding it on the title: "%" +

How to script non-default collation and skip explicit scripting for default collation?

馋奶兔 提交于 2019-12-12 21:09:43
问题 In SSMS 2008 R2, I created a table: aTest(Albnian varchar(10), Dflt varchar(10)) In SSMS table designer, both columns have the collation: "<database default>" (under "Column Properties" → "Table Designer") I changed the collation of the column "Albnian" to a non-default, for example, Albanian_CI_AS. If I script the table in SSMS (right click on "aTest" → "Script Tables as" → "CREATE To" → "New Query Editor Window", I get [1] with no explicit collations scripted at all. Bad. Obviously, one

Java Collator with similar characteristic as MySQLs utf8_general_ci collation

断了今生、忘了曾经 提交于 2019-12-12 18:14:04
问题 Is there any Collator implementation which has the same characteristics as MySQL's utf8_general_ci? I need a collator which is case insensitive and does not distinguish german umlauts like ä with the vowel a . Background: We recently encountered a bug which was caused by a wrong collation in our table. The used collation was utf8_general_ci where utf8_bin would be the correct one. The particular column had a unique index. The utf8_general_ci collation does not distinguish between words like

Strange collation with postgresql

断了今生、忘了曾经 提交于 2019-12-12 17:25:41
问题 I noticed a strange collation issue with postgresql-9.5 as it was giving different output to a Python script. As I understand it, normally characters are compared one at a time from left to right when sorting: select 'ab' < 'ac'; t select 'abX' < 'ac'; t So it's irrelevant if you add the 'X' to the left hand string above. So I was surprised when this does not hold for comparison between a space and a dash: select 'a ' < 'a-'; t select 'a X' < 'a-'; f Is it a bug or is there any way around