<tt>Hi,</tt><tt></tt><p><tt>I'm trying to create a varchar(float8) to cast float to varchar but I can't create
it.</tt><br/><tt>I can create bpchar(foat8) and text(float8) and it works well but
varchar(float8).</tt><tt></tt><p><tt>EXAPLE:</tt><tt></tt><p><tt>createtable test(f float, n name);</tt><br
/><tt>CREATE</tt><br/><tt>insert into test values(1.23, current_user);</tt><br /><tt>INSERT 192042 1</tt><br
/><tt>selectcast(f as text) from test;</tt><br /><tt>text</tt><br /><tt>-------------------------</tt><br
/><tt>2000-01-0101:00:01.23+01 <----this is wrong then I create text(float8)</tt><br /><tt>(1
row)</tt><tt></tt><p><tt>selectcast(f as char) from test;</tt><br /><tt>ERROR: No such function 'bpchar' with the
specifiedattributes</tt><br /><tt>select cast(f as varchar) from test;</tt><br /><tt>ERROR: No such function 'varchar'
withthe specified attributes</tt><br /><tt>create function text(float8) returns text as</tt><br /><tt>'begin</tt><br
/><tt> return $1;</tt><br /><tt>end;' language 'plpgsql';</tt><br /><tt>CREATE</tt><br /><tt>create function
bpchar(float8)returns bpchar as</tt><br /><tt>'begin</tt><br /><tt> return $1;</tt><br /><tt>end;' language
'plpgsql';</tt><br/><tt>CREATE</tt><br /><tt>create function varchar(float8) returns varchar as</tt><br
/><tt>'begin</tt><br/><tt> return $1;</tt><br /><tt>end;' language 'plpgsql';</tt><br /><tt>ERROR: parser:
parseerror at or near "varchar" <---there's a parser error.</tt><br /><tt>select cast(f as text) from test;</tt><br
/><tt>text</tt><br/><tt>----</tt><br /><tt>1.23 <------and now it works</tt><br /><tt>(1
row)</tt><tt></tt><p><tt>selectcast(f as char) from test;</tt><br /><tt>bpchar</tt><br /><tt>------</tt><br /><tt>
1.23</tt><br/><tt>(1 row)</tt><tt></tt><p><tt>----I see there are some varchar built-in functions but I can't use them
also...</tt><tt></tt><p><tt>\dfvarchar</tt><br /><tt>result |function |arguments |description</tt><br
/><tt>-------+---------------+--------------+---------------------</tt><br/><tt>bool |varchareq |varchar
varcha|equal</tt><br/><tt>bool |varcharge |varchar varcha|greater-than-or-equal</tt><br /><tt>bool
|varchargt |varchar varcha|greater-than</tt><br /><tt>bool |varcharle |varchar
varcha|less-than-or-equal</tt><br/><tt>bool |varcharlt |varchar varcha|less-than</tt><br /><tt>bool
|varcharne |varchar varcha|not equal</tt><br /><tt>int4 |varcharcmp |varchar
varcha|less-equal-greater</tt><br/><tt>int4 |varcharlen |varchar |character length</tt><br /><tt>int4
|varcharoctetlen|varchar |octet length</tt><br /><tt>varchar|varchar |name |convert</tt><br
/><tt>varchar|varchar |varchar int4 |</tt><br /><tt>(11 rows)</tt><tt></tt><p><tt>select varchar(n) from
test;</tt><br/><tt>ERROR: parser: parse error at or near "n"</tt><br /><tt></tt> <tt></tt><p><tt>--Any ideas
?</tt><tt></tt><p><tt>-Jose'-</tt><br/><tt></tt>