pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kip Cole <kipcole9@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Casting a collation in an ORDER BY ... COLLATE
Date: Sun, 22 May 2022 07:38:45 +0800
Message-ID: <DAAAF3FE-890E-44C7-AD59-04C16AC859B7@gmail.com> (raw)

I’m trying to cast a string value to a collation name without success. My suspicion is this isn’t possible
based upon the error message. But perhaps wiser heads than mine have a suggestion on how to do
this?

cldr_sql=# select * from models order by name collate 'en-x-icu'::regcollation;
ERROR: syntax error at or near "'en-x-icu'"
LINE 1: select * from models order by name collate 'en-x-icu'::regco…

Utilmately the objective is to interpolate the collation value into a prepared query so
this is just the first step to validate that casting a COLLATE name  is possible or not.

Suggestions and ideas most welcome.








view thread (3+ messages)  latest in thread

Message-ID: <DAAAF3FE-890E-44C7-AD59-04C16AC859B7@gmail.com>
Permalink:  ../DAAAF3FE-890E-44C7-AD59-04C16AC859B7@gmail.com/
Also on:    postgresql.org/message-id/DAAAF3FE-890E-44C7-AD59-04C16AC859B7@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: kipcole9@gmail.com
  Subject: Re: Casting a collation in an ORDER BY ... COLLATE
  In-Reply-To: <DAAAF3FE-890E-44C7-AD59-04C16AC859B7@gmail.com>
  References: <DAAAF3FE-890E-44C7-AD59-04C16AC859B7@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox