Re: convert_numeric_to_scalar: unsupported type 354210 - Mailing list pgsql-sql

From Rod Taylor
Subject Re: convert_numeric_to_scalar: unsupported type 354210
Date
Msg-id 1056376831.63013.15.camel@jester
Whole thread Raw
In response to convert_numeric_to_scalar: unsupported type 354210  (AgentM <agentm@cmu.edu>)
List pgsql-sql
> select id from data where dec < 2.0;
> ERROR:  convert_numeric_to_scalar: unsupported type 354210

Domains exposed (and introduced) a number of interesting issues in
regards to type switching for these things.

Cast the 2.0 value to the domain:CAST(2.0 AS physreal)

or quote it and let the system figure it out:dec < '2.0'


Simply put, without quotes the parser assumes that 2.0 is a numeric,
which doesn't have a direct < operator for use with the domain.

Another alternative would be to create a new < operator, but thats more
work than it's worth.

This has been fixed for 7.4 (the system implicitly coerces the domain to
numeric for the index comparison).
--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

pgsql-sql by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: CREATE table1 FROM table2
Next
From: Markus Bertheau
Date:
Subject: multi-table unique index