Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAFrR-00034r-2O for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Nov 2017 13:48:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eAFrQ-00047l-LF for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Nov 2017 13:48:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eAFrQ-00047c-C3 for pgsql-bugs@postgresql.org; Thu, 02 Nov 2017 13:48:44 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eAFrM-0000sg-0i for pgsql-bugs@postgresql.org; Thu, 02 Nov 2017 13:48:43 +0000 Received: by mail-wm0-x22e.google.com with SMTP id b9so11590890wmh.0 for ; Thu, 02 Nov 2017 06:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=8yoOpCt8JTS60lWA0xPEVetmHEnw/EPwDL1E9S6adX8=; b=ufHjRlff38w3tdruuGlCWXLcrr2mkQCYD4beYb6m5CspM7VVaRVphybMy7O/iO2umA z2vaHw8mAkgp9aM7wX6SRwHRcOl40ICDxLAVtUBQ/UX24GD/A51j+mRNIqupY7dj+cRS KgSwpWRX5Dhh5pVYEhSCKDm7b+as8st+i/RCZgk7IDCovutI4cO2a2eQRDvnJNZihZKf 4ZRVEsc+Q/ueNxEFJ+hGC5BD8+Gf8eRB/Sk5N3oqbYdWkZwI4Y3fFjrZYiBjaXsAUdEp DVKg2fNGE3NP2yCg9P+lkZxRkk8JJ7D8dxfs5MoVvExhMzCAQhNa0alL4JIg9Gnhj230 AxZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8yoOpCt8JTS60lWA0xPEVetmHEnw/EPwDL1E9S6adX8=; b=muXhZdUVtxqVP4gSh0/QJ1T/AT4Xxhuw2oTt1Bm+j6fMEdx6dRRXw+RQVg6XwEGdBf uV5IJ9BYf/hCKmVBTBarvCj4hSG6Dvs5Cc8mAWSvBJyRtl1Wmm3cAaTmc/un3qTicYpb QBRd75n8J5H8EKpnEpS02avSRkAGdUfagQlN8G4fevrSD3RIg6Ql2ckKHNezYKm0LE6u u3yC59WQn7ZZKl0fJMmdAw9vPmGLU3Z5ZQTcRScXv37lJ6l6Sny2QLv0wsKgwAn2/Ybp FfY5l6/gIcKDgKFbxeJOf73ot/WtCN3T5iUXLVQWv+1CxfwVjUxMhQPr1j+3W2fetUbe y9Rw== X-Gm-Message-State: AMCzsaVR9S7uKVPI5/mmGd06ulKgsduPao/nELSyyJBMcyUpQmZ83ArT gGtBYBEMIKa7af1SHgP2q8T7S5dSiyy3WxxBsmYBchFrNwt9mIiST8F/opJA6UW2fIts/Ek/mmm /afy8ZaBhRft5xavhstgnSOkPHNDvoO2MaEp9/GljA0tMj33n8JLBt3DlgUg+93yu8ea3OMBJkn 2Ac5ONzSk= X-Google-Smtp-Source: ABhQp+TH5K5lHNVnm04QYzxUDZOwhCnIdIrzlV60FHH5PgQ7TnSpg6MoD8K5TfroMyxXTuoVtgrfSA== X-Received: by 10.80.141.79 with SMTP id t15mr4451182edt.70.1509630518065; Thu, 02 Nov 2017 06:48:38 -0700 (PDT) Received: from [10.137.2.17] ([212.24.157.174]) by smtp.gmail.com with ESMTPSA id d12sm3586271eda.27.2017.11.02.06.48.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Nov 2017 06:48:37 -0700 (PDT) Subject: Re: BUG #14885: mistake in sorting win1251 chars To: pgsql-bugs@postgresql.org References: <20171102095719.17188.59150@wrigleys.postgresql.org> From: Tomas Vondra Message-ID: Date: Thu, 2 Nov 2017 14:48:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171102095719.17188.59150@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 11/02/2017 10:57 AM, k.daskalov.911@gmail.com wrote: > The following bug has been logged on the website: > > Bug reference: 14885 > Logged by: Kalin Daskalov > Email address: k.daskalov.911@gmail.com > PostgreSQL version: 9.4.4 > Operating system: windows 7 64 bit > Description: > > I'm using ORDER BY containing win-1251 symbols. > No matter whether the encoding is WIN1251 or UTF8. > I try it on different versions of PostgreSQL - the result is the same. > There is a mistake in sorted values for symbols "и" (и) and "й" > (й) - capital letters too. > Here is a small example: > "АЙГЕР" > "АИКО" > "АЙКОН" > Encoding only defines how different characters are encoded, it has nothing to do with ordering - that's what collations are for. What lc_collate value are you using? See https://www.postgresql.org/docs/9.4/static/collation.html cheers -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs