pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David Morgenstern <d.morgenstern@synedra.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Difference between text_pattern_ops and varchar_pattern_ops
Date: Fri, 25 Jun 2021 13:43:05 +0200
Message-ID: <7755cbb6a96ebab699d52f7801f799fb9815cd8a.camel@cybertec.at> (raw)
In-Reply-To: <2EA363D8-E6F2-4EBF-9A74-BECBBF81B76E@synedra.com>
References: <2EA363D8-E6F2-4EBF-9A74-BECBBF81B76E@synedra.com>

On Fri, 2021-06-25 at 12:29 +0200, David Morgenstern wrote:
> The documentation for operator classes (https://www.postgresql.org/docs/current/indexes-opclass.html)
>  seems to indicate that text_pattern_ops should only be used for text columns
>  and varchar_pattern_ops should be used for varchar columns.
>  However today I stumbled upon an index using text_pattern_ops on a varchar column.
>  Everything seems to be working fine. Now I am wondering what the difference
>  between text_pattern_ops and varchar_pattern_ops might be.
> 
> Can somebody explain why text_pattern_ops can be used on varchar columns, considering it
>  can’t be used for bpchar columns? And are there any downsides in doing this
>  (aside from my confusion of course)?

https://www.postgresql.org/message-id/flat/A737B7A37273E048B164557ADEF4A58B17CCE003%40ntex2010i.host...

Yours,
Laurenz Albe
-- 
+43-670-6056265
CYBERTEC PostgreSQL International GmbH
Gröhrmühlgasse 26, A-2700 Wiener Neustadt
Web: https://www.cybertec-postgresql.com






view thread (3+ messages)  latest in thread

Message-ID: <7755cbb6a96ebab699d52f7801f799fb9815cd8a.camel@cybertec.at>
Permalink:  ../7755cbb6a96ebab699d52f7801f799fb9815cd8a.camel@cybertec.at/
Also on:    postgresql.org/message-id/7755cbb6a96ebab699d52f7801f799fb9815cd8a.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, d.morgenstern@synedra.com
  Subject: Re: Difference between text_pattern_ops and varchar_pattern_ops
  In-Reply-To: <7755cbb6a96ebab699d52f7801f799fb9815cd8a.camel@cybertec.at>
  References: <2EA363D8-E6F2-4EBF-9A74-BECBBF81B76E@synedra.com> <7755cbb6a96ebab699d52f7801f799fb9815cd8a.camel@cybertec.at>

* 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