Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Martijn van Oosterhout
On Tue, Jan 06, 2009 at 11:13:59PM +0530, Gurjeet Singh wrote: > If we consider the second branch of UNION ALL of both the queries above, if > "select '' " yields a text column, then so should a "select * from (select > '')". The problem is ofcourse that "select ''" doesn't produce a text column i

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Gurjeet Singh
On Tue, Jan 6, 2009 at 7:18 PM, Tom Lane wrote: > "Gurjeet Singh" writes: > >> This is a horrendously bad idea; it will bite your *ss sooner or later, > >> probably sooner. > > > Can you please let us know how this would be problematic? > > The point is that it's going to have unknown, untested

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Tom Lane
"Gurjeet Singh" writes: >> This is a horrendously bad idea; it will bite your *ss sooner or later, >> probably sooner. > Can you please let us know how this would be problematic? The point is that it's going to have unknown, untested effects on the default coercion rules, possibly leading to sil

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Gurjeet Singh
On Tue, Jan 6, 2009 at 6:31 PM, Tom Lane wrote: > "Gurjeet Singh" writes: > > create cast (unknown as text) with function unknown2text( unknown ) as > > implicit; > > This is a horrendously bad idea; it will bite your *ss sooner or later, > probably sooner. > >regards, to

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Tom Lane
"Gurjeet Singh" writes: > create cast (unknown as text) with function unknown2text( unknown ) as > implicit; This is a horrendously bad idea; it will bite your *ss sooner or later, probably sooner. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Scott Marlowe
On Tue, Jan 6, 2009 at 2:24 AM, Gurjeet Singh wrote: > On Tue, Jan 6, 2009 at 2:43 PM, Scott Marlowe > wrote: >> >> On Tue, Jan 6, 2009 at 2:04 AM, Gurjeet Singh >> wrote: >> > I took your cue, and have formulated this solution for 8.3.1 : >> >> Is there a good reason you're running against a db

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Gurjeet Singh
On Tue, Jan 6, 2009 at 2:43 PM, Scott Marlowe wrote: > On Tue, Jan 6, 2009 at 2:04 AM, Gurjeet Singh > wrote: > > I took your cue, and have formulated this solution for 8.3.1 : > > Is there a good reason you're running against a db version with known > bugs instead of 8.3.5? Seriously, it's an e

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Scott Marlowe
On Tue, Jan 6, 2009 at 2:04 AM, Gurjeet Singh wrote: > I took your cue, and have formulated this solution for 8.3.1 : Is there a good reason you're running against a db version with known bugs instead of 8.3.5? Seriously, it's an easy upgrade and running a version missing over a year of updates

Re: [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Gurjeet Singh
I took your cue, and have formulated this solution for 8.3.1 : create or replace function unknown2text(unknown) returns text as $$ begin return text($1::char); end $$ language plpgsql; drop cast (unknown as text); create cast (unknown as text) with function unknown2text( unknown ) as implicit;

Re: [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-05 Thread Pavel Stehule
2009/1/6 Gurjeet Singh : > As I mentioned, we cannot change the query, so adding casts to the query is > not an option. I was looking for something external to the query, like a > CREATE CAST command that'd resolve the issue. I am sorry, I blind - I tested casting on 8.3.0 and it doesn't work (but

Re: [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-05 Thread Gurjeet Singh
As I mentioned, we cannot change the query, so adding casts to the query is not an option. I was looking for something external to the query, like a CREATE CAST command that'd resolve the issue. Best regards, On Tue, Jan 6, 2009 at 12:00 PM, Pavel Stehule wrote: > Hello > > 2009/1/6 Gurjeet Sing

Re: [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-05 Thread Pavel Stehule
Hello 2009/1/6 Gurjeet Singh : > Q1: select '' union all select '' > Q2: select '' union all select * from (select '' ) as s > > version: PostgreSQL 8.3.1, compiled by Visual C++ build 1400 > > Hi All, > > Q1 works just fine, but Q2 fails with: > > ERROR: failed to find conversion function fr

[HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-05 Thread Gurjeet Singh
Q1: select '' union all select '' Q2: select '' union all select * from (select '' ) as s version: PostgreSQL 8.3.1, compiled by Visual C++ build 1400 Hi All, Q1 works just fine, but Q2 fails with: ERROR: failed to find conversion function from "unknown" to text Q2 is a generalization