From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Lumby <johnlumby@hotmail.com>
Cc: pgsql bugs <pgsql-bugs@postgresql.org>
Subject: Re: LIKE predicate and ERROR: 42P22: could not determine which collation to use for string comparison - HINT: Use the COLLATE clause ...
Date: Tue, 13 Dec 2011 10:18:15 -0500
Message-ID: <27650.1323789495@sss.pgh.pa.us> (raw)
In-Reply-To: <COL116-W382B6B5747B0DD0466CFA8A3BD0@phx.gbl>
References: <COL116-W333FEC5259FA21D7EF20F3A3B90@phx.gbl>
<20915.1323505573@sss.pgh.pa.us>
<COL116-W49ABA55B2BABBC2237E19DA3BC0@phx.gbl>
<12191.1323725933@sss.pgh.pa.us>
<COL116-W382B6B5747B0DD0466CFA8A3BD0@phx.gbl>
John Lumby <johnlumby@hotmail.com> writes:
> Is your output different? Do you think you could post the output you get?
Mine looks like yours, except no error. [ looks closer... ] Are you
sure you're running a 9.1.2 server? The large difference in
datlastsysoid seems like it could not have happened if you had
production 9.1.x system catalog contents. Now I'm suspicious there's
something wrong with your catalog entries, not the code itself.
DROP DATABASE
CREATE TABLE
Tue Dec 13 09:59:18 EST 2011
rc= 0 inserted 10000 entities Tue Dec 13 10:00:30 EST 2011
ANALYZE
datname | datdba | encoding | datcollate | datctype | datistemplate | datallowconn | datconnlimit | datlastsysoid | datfrozenxid | dattablespace
------------+--------+----------+------------+----------+---------------+--------------+--------------+---------------+--------------+---------------
LIKE_42P22 | 10 | 6 | C | C | f | t | -1 | 12772 | 1795 | 1663
(1 row)
nspname | relname | attrelid | attname | atttypid | typname | collname
---------+---------+----------+---------------+----------+---------+----------
public | entity | 41366 | discriminator | 1043 | varchar | default
(1 row)
QUERY PLAN
-------------------------------------------------------------------
Aggregate (cost=190.26..190.27 rows=1 width=0)
-> Seq Scan on entity e1 (cost=0.00..189.00 rows=505 width=0)
Filter: ((discriminator)::text ~~ 'DEPLOY%'::text)
(3 rows)
count
-------
500
(1 row)
CREATE INDEX
ANALYZE
QUERY PLAN
--------------------------------------------------------------------------------------------------------------
Aggregate (cost=23.71..23.72 rows=1 width=0)
-> Index Scan using entity_discriminator on entity e1 (cost=0.00..22.45 rows=505 width=0)
Index Cond: (((discriminator)::text >= 'DEPLOY'::text) AND ((discriminator)::text < 'DEPLOZ'::text))
Filter: ((discriminator)::text ~~ 'DEPLOY%'::text)
(4 rows)
count
-------
500
(1 row)
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, johnlumby@hotmail.com
Subject: Re: LIKE predicate and ERROR: 42P22: could not determine which collation to use for string comparison - HINT: Use the COLLATE clause ...
In-Reply-To: <27650.1323789495@sss.pgh.pa.us>
References: <COL116-W333FEC5259FA21D7EF20F3A3B90@phx.gbl> <20915.1323505573@sss.pgh.pa.us> <COL116-W49ABA55B2BABBC2237E19DA3BC0@phx.gbl> <12191.1323725933@sss.pgh.pa.us> <COL116-W382B6B5747B0DD0466CFA8A3BD0@phx.gbl> <27650.1323789495@sss.pgh.pa.us>
* 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