Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j1vIN-0000ij-A7 for pgsql-general@arkaria.postgresql.org; Wed, 12 Feb 2020 16:55:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j1vIM-0006f2-2H for pgsql-general@arkaria.postgresql.org; Wed, 12 Feb 2020 16:55:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j1vIL-0006ac-HI for pgsql-general@lists.postgresql.org; Wed, 12 Feb 2020 16:55:25 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j1vII-0001Ol-In for pgsql-general@lists.postgresql.org; Wed, 12 Feb 2020 16:55:24 +0000 Received: by mail-wr1-x442.google.com with SMTP id t3so3253723wru.7 for ; Wed, 12 Feb 2020 08:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=T3Ek1PSLk17ejLxaSAxo01bdC1AQiYoSXwCh41wux9A=; b=lJvQuVa05ARqX+QQ241JT4DquegO6YvTEfWPHVVQjj3XwJKfxNt9kqaKkbKJHj2/EE VshmF/kfL08Td8FAObHMo3MsqxmZzHe4i5ARalwJHD/jRkHtBCL025YwTzHSEa88XbEP VEZGpH37r1fTmPvukxN9UlLCkulxnI66226jpX1dyNOyLFCV2skKQ/epW7CscWcSA2oF WVhGzKgPNDTV21iW3JsA2Zv5fkw8DvyLVHnThUZspwLb+m8VR8gw1C7TdTwyqtcCoYt8 97Xkoo4XV3ppXogQscCslYlbw018guJRWooa+bAtdV+udp76PnetI22YBEyWriaGnXvz 8a+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=T3Ek1PSLk17ejLxaSAxo01bdC1AQiYoSXwCh41wux9A=; b=pgAF7dO2/jjWFh/R8zRZSxnt+DS8XDT9R5X0cMCXOpgkShIEyjfFE737EKvmkb85J1 rBkLgLwzjyer1baYuPeNvtjfrTZG99bCp1ftuDYmZT7EQTHSRF4jINFqxRtLBEC1PYmG ibZAvuSYApvM8jwyZxXLY7eVmkcDgG5A6C0LXwO6RBvZnH914ylzzqkVhGyxubKpLf4l nkJYoTB614QCm6J5y9G5rMfXZojJQen/y1YO1QH19WNNFNX1kXzV4egguCqx3yJHQ8n4 zUsrIyR0k/Lr0JmO+TiRn08Tg54ef/8237JI5Z1XwavA+JsxQ6Yi03CdgRBO7kcGMDvk BBaA== X-Gm-Message-State: APjAAAUPUMdQf3qhPCeuNpsmxWBkC02l+/PemAm5h/LfH1fIBRTyoOri OsElw+3D9Ubaqc2p9ffXDXK9Cw== X-Google-Smtp-Source: APXvYqyxKzxT6WTgOke46Vzlm6C7A8OdVJuz2GuVZo6rrNcuQLpYLlfuy28NbSMZci0OC0q6sg5dLQ== X-Received: by 2002:a5d:614b:: with SMTP id y11mr15325308wrt.47.1581526520034; Wed, 12 Feb 2020 08:55:20 -0800 (PST) Received: from localhost.localdomain ([213.208.157.37]) by smtp.gmail.com with ESMTPSA id g2sm1215837wrw.76.2020.02.12.08.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:55:19 -0800 (PST) Message-ID: Subject: Re: Natural sort order extension. From: Laurenz Albe To: Dmitry Igrishin , pgsql-general@lists.postgresql.org Date: Wed, 12 Feb 2020 17:55:17 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2020-02-12 at 18:45 +0300, Dmitry Igrishin wrote: > I've implemented a PostgreSQL extension for natural sort order. I.e. > strings like "z20", "z0004", "z11", "z2" sorted in ascending order as > "z2", "z0004", "z11", "z20". > > Currently it implements the type textnso which is binary-coercible > to/from the text type. It's possible to declare table columns of type > textnso and create indexes on them. > > Details are here https://github.com/dmitigr/pgnso > > Any feedback are welcome! I don't want to detract from this, but from PostgreSQL v10 on you can use ICU collations with the "kn-true" variant to have natural sort order. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com