Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: Autocast sc...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 15466 of 17602
Post > Topic >>

Re: Autocast script of peter e in PostgreSQL 8.3

by Daniel Schuchardt <daniel_schuchardt@[EMAIL PROTECTED] > May 6, 2008 at 03:37 PM

Martijn van Oosterhout schrieb:
> On Tue, May 06, 2008 at 02:09:30PM +0200, Daniel Schuchardt wrote:
>   
>> *SCDS=# SELECT 1||'~'||1;
>> ERROR:  operator is not unique: integer || unknown at character 9
>> HINT:  Could not choose a best candidate operator. You might need to
add 
>> explicit type casts.
>> LINE 1: SELECT 1||'~'||1;
>>     
>
> Check the archives. I think Tom pointed out that while it readds all
> the casts, some other changes were made for the '||' operator and you
> need to delete those. IIRC you need to manipuate the catalog tables
> directly for that.
>
> Have a nice day,
>   

Hey Matijn,

it simply does not work.  Every created CAST will crash with the '||' 
operator.

Thnx for your comments,

Daniel.



DEMO1=# SELECT 1||'~'||1;
 ?column?
----------
 1~1
(1 row)
DEMO1=# CREATE FUNCTION pg_catalog.text(integer) RETURNS text STRICT 
IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int4out($1));';
CREATE FUNCTION
DEMO1=# CREATE CAST (integer AS text) WITH FUNCTION 
pg_catalog.text(integer) ASIMPLICIT;
CREATE CAST
DEMO1=# SELECT 1||'~'||1;
ERROR:  operator is not unique: integer || unknown at character 9
HINT:  Could not choose a best candidate operator. You might need to add 
explicit type casts.
LINE 1: SELECT 1||'~'||1;

DEMO1=# SELECT 1.1||'~'||1.1;
 ?column?
----------
 1.1~1.1
(1 row)
DEMO1=# CREATE FUNCTION pg_catalog.text(numeric) RETURNS text STRICT 
IMMUTABLE LANGUAGE SQL AS 'SELECT textin(numeric_out($1));';
CREATE FUNCTION
DEMO1=# CREATE CAST (numeric AS text) WITH FUNCTION 
pg_catalog.text(numeric) AS IMPLICIT;
CREATE CAST
DEMO1=# SELECT 1.1||'~'||1.1;
ERROR:  operator is not unique: numeric || unknown at character 11
HINT:  Could not choose a best candidate operator. You might need to add 
explicit type casts.
LINE 1: SELECT 1.1||'~'||1.1;

DEMO1=# SELECT current_date||'~'||current_date;
       ?column?
-----------------------
 2008-05-06~2008-05-06
(1 row)
DEMO1=# CREATE FUNCTION pg_catalog.text(date) RETURNS text STRICT 
IMMUTABLE LANG
UAGE SQL AS 'SELECT textin(date_out($1));';
CREATE FUNCTION
DEMO1=# CREATE CAST (date AS text) WITH FUNCTION pg_catalog.text(date) 
AS IMPLICIT;
CREATE CAST
DEMO1=# SELECT current_date||'~'||current_date;
ERROR:  operator is not unique: date || unknown at character 20
HINT:  Could not choose a best candidate operator. You might need to add 
explicit type casts.
LINE 1: SELECT current_date||'~'||current_date;
                           ^
 




 5 Posts in Topic:
Autocast script of peter e in PostgreSQL 8.3
Daniel Schuchardt <dan  2008-05-06 14:09:30 
Re: Autocast script of peter e in PostgreSQL 8.3
kleptog@[EMAIL PROTECTED]  2008-05-06 14:39:05 
Re: Autocast script of peter e in PostgreSQL 8.3
Daniel Schuchardt <dan  2008-05-06 15:37:57 
Re: Autocast script of peter e in PostgreSQL 8.3
kleptog@[EMAIL PROTECTED]  2008-05-06 16:59:58 
Re: Autocast script of peter e in PostgreSQL 8.3
Daniel Schuchardt <dan  2008-05-06 20:07:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:55:15 CST 2008.