pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
failed to find conversion function from "unknown" to text
3+ messages / 3 participants
[nested] [flat]

* failed to find conversion function from "unknown" to text
@ 2005-01-12 16:52 Szűcs Gábor <surrano@gmail.com>
  2005-01-12 17:20 ` Re: failed to find conversion function from "unknown" to text Tom Lane <tgl@sss.pgh.pa.us>
  2005-01-12 17:23 ` Re: failed to find conversion function from "unknown" to text Andrew Sullivan <ajs@crankycanuck.ca>
  0 siblings, 2 replies; 3+ messages in thread

From: Szűcs Gábor @ 2005-01-12 16:52 UTC (permalink / raw)
  To: pgsql-sql

Dear Gurus,

Version: 8.0.0rc4

The scene below might look funny but it's essential for our project:

   [local]:tir=# select 'a' as asdf;
    asdf
   ------
    a
   (1 row)

   [local]:tir=# select case 'a' when 'a' then 1 else 2 end as asdf;
   ERROR:  failed to find conversion function from "unknown" to text

This worked up to v7.4.6, and couldn't see it in the "Migration" part of the 
HISTORY file.

Question: is there a way to tell the server to convert unknown to something 
(text or varchar, don't really care), or to write such a "conversion function"?

A similar conversion for name to varchar conversion would also be highly 
desirable for easier migration. Right now I'm writing wrapper functions for 
all our functions where params might be names.

If it's written in the doc, could you please tell me the page?

TIA,
-- 
G.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: failed to find conversion function from "unknown" to text
  2005-01-12 16:52 failed to find conversion function from "unknown" to text Szűcs Gábor <surrano@gmail.com>
@ 2005-01-12 17:20 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2005-01-12 17:20 UTC (permalink / raw)
  To: Szűcs Gábor <surrano@gmail.com>; +Cc: pgsql-sql

=?ISO-8859-2?Q?Sz=FBcs_G=E1bor?= <surrano@gmail.com> writes:
>    [local]:tir=# select case 'a' when 'a' then 1 else 2 end as asdf;
>    ERROR:  failed to find conversion function from "unknown" to text

> This worked up to v7.4.6, and couldn't see it in the "Migration" part of the 
> HISTORY file.

This is an unintended side effect of the change to evaluate CASE
constructs more efficiently.  I'll fix it.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: failed to find conversion function from "unknown" to text
  2005-01-12 16:52 failed to find conversion function from "unknown" to text Szűcs Gábor <surrano@gmail.com>
@ 2005-01-12 17:23 ` Andrew Sullivan <ajs@crankycanuck.ca>
  1 sibling, 0 replies; 3+ messages in thread

From: Andrew Sullivan @ 2005-01-12 17:23 UTC (permalink / raw)
  To: Sz?cs Gábor <surrano@gmail.com>; +Cc: pgsql-sql

On Wed, Jan 12, 2005 at 05:52:42PM +0100, Sz?cs Gábor wrote:
> Question: is there a way to tell the server to convert unknown to something 
> (text or varchar, don't really care), or to write such a "conversion 
> function"?

You ought to be able to cast (e.g. "SELECT case 'a'::text. . .)

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Information security isn't a technological problem.  It's an economics
problem.
		--Bruce Schneier



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-01-12 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12 16:52 failed to find conversion function from "unknown" to text Szűcs Gábor <surrano@gmail.com>
2005-01-12 17:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-01-12 17:23 ` Andrew Sullivan <ajs@crankycanuck.ca>

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