Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TXDOZ-00063H-0H for pgsql-bugs@postgresql.org; Sat, 10 Nov 2012 15:54:55 +0000 Received: from mail-ee0-f46.google.com ([74.125.83.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TXDOR-0003wp-RS for pgsql-bugs@postgresql.org; Sat, 10 Nov 2012 15:54:54 +0000 Received: by mail-ee0-f46.google.com with SMTP id b15so2670075eek.19 for ; Sat, 10 Nov 2012 07:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:user-agent:subject :mime-version:content-type:content-transfer-encoding; bh=hxMdVVCwe0Ku4BK+VNObqJ1qqZmAFbsunXnb/7tnXUk=; b=xAV03U7rAqTTeOrYaQd4rAlVVyoi4eA/97v0MfkpVj6WOXl/PFcVJ4SjLjdFijQ/d8 Y2qeNB548uqGen1cycvKvrzsD6NxmPk4GhmhE8f73hdIEHjSLZiWgMlxo5FciHRrcMqu PnyJxxZWLWAuZ1Y5ECvy/QGmzBQ88ZsdwzV44Z9xe5Fyy9PkdQW2mbl9TY4UrM6cZsDN 1O658jM6Jsawknx3EYmV6xWW4cY5tfqnevMo0XPaHvN7Knb1W2WIPpPHILaNQmxvdmc0 KzpU5XXvWU17UyeHDfDmTkGIo85GcDk2OuSTfrNU9e7wfNoozdrsOnNZhBABHU9FjYj7 f42g== Received: by 10.14.182.9 with SMTP id n9mr47021930eem.24.1352562886324; Sat, 10 Nov 2012 07:54:46 -0800 (PST) Received: from [46.75.86.99] (046075086099.atmpu0011.highway.a1.net. [46.75.86.99]) by mx.google.com with ESMTPS id g5sm4202810eem.4.2012.11.10.07.54.44 (version=SSLv3 cipher=OTHER); Sat, 10 Nov 2012 07:54:45 -0800 (PST) From: "Bernhard Reutner-Fischer" To: Tom Lane CC: Date: Sat, 10 Nov 2012 16:56:02 +0100 Message-ID: <13aeb08ee8b.3848.2760.rep.dot.nop@gmail.com> In-Reply-To: <8891.1352560824@sss.pgh.pa.us> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 AquaMail/1.2.0.3 (build: 2100127) Subject: Re: BUG #7644: Missing implicit types of Result and failing type-conversion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201211/50 X-Sequence-Number: 34608 On 10 November 2012 16:20:24 Tom Lane wrote: > rep.dot.nop@gmail.com writes: > > select distinct on (bug) bug > > from ( > > select * from (select 'string one' AS bug from generate_series(0,1)) > > s1 > > UNION > > select * from (select 'string two' bug from generate_series(0,0)) > > s2 > > ) x > > ; > > ERROR: could not determine which collation to use for string comparison > > HINT: Use the COLLATE clause to set the collation explicitly. > > > What am i missing or doing wrong? > > Leaving out the cast. An undecorated string literal is not a constant > of type text --- it is a constant of unknown type, and the parser will > throw an error if the type can't be resolved from fairly-local context. > (The same applies to NULL, btw.) Fair enough but what about the failure for the case with the Result that fails to merge? There I do have a cast but it fails on the Result as opposed to a genera e_series(0,0): select distinct on (bug) bug from ( select * from (select 'string one'::text AS bug from generate_series(0,1)) s1 UNION select * from (select 'string two' bug ) s2 ) x ; Sent with AquaMail for Android http://www.aqua-mail.com