Re: error tryiing to insert with collate

From: Thom Brown <thom(at)linux(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: error tryiing to insert with collate
Date: 2012-01-04 00:18:32
Message-ID: CAA-aLv5rB6shJ37QQLHu72L6fmBELamz6pEQGED2LwQqL9wL4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 2 January 2012 18:07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Jean-Yves F. Barbier" <12ukwn(at)gmail(dot)com> writes:
>> I'm trying to insert as:
>> INSERT INTO tst1m VALUES ( default,
>>       'źŠÿǚŦÍÏÔJŽććżûŘäpèăîÍŢŃDµŴŻĊĜÿG' COLLATE "hu_HU.utf8",
>>       'úĽčŏṻŗĿÁťħĵŇğŚáÛĨæħŽīhĴÝUĶďeźİīŇč' COLLATE "hu_HU.utf8" );
>
>> and get: ERROR:  unsupported node type: 325
>
> Hmm, that's a bug, which I will go fix --- thanks for the report!
> However, the reason that nobody noticed the bug before now is that it's
> entirely useless to attach a COLLATE clause to an INSERT value.
> COLLATE is only interesting when attached to an argument of an operator
> or function that pays attention to collation, such as the "<" operator.
> Here, your values are going to go directly into the table without any
> comparisons or anything else happening to them, and once they're in
> the table it'll be the table column's declared collation that controls
> how they're compared.

For reference, Tom committed the fix for this in both master and 9.1
branch: http://archives.postgresql.org/pgsql-committers/2012-01/msg00019.php

--
Thom

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Birchall, Austen 2012-01-04 12:00:56 Removal of WAL logs
Previous Message Sergio Sinuco 2012-01-03 23:30:13 Partitioning: avoid insert in master table