pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
datatype matrix (was: Re: Sorry..)
3+ messages / 3 participants
[nested] [flat]

* datatype matrix (was: Re: Sorry..)
@ 2002-07-16 17:37  Kevin Brannen <kevinb@nurseamerica.net>
  0 siblings, 2 replies; 3+ messages in thread

From: Kevin Brannen @ 2002-07-16 17:37 UTC (permalink / raw)
  To: pgsql-sql

Josh Berkus wrote:
> Christopher,
> 
> 
>>In the bad old days when we couldn't distinguish explicit from implicit
>>cast functions, I was wary of adding new cast pathways.  Too many
>>implicit casts and you have no type system at all.  But in 7.3 there
>>should be no reason to object to an explicit-only cast from numeric
>>to text or vice versa.
> 
> 
> I'd suggest making the explicit cast of numeric to text be the exact 
> equivalent of:
> 
> SELECT btrim(to_char(numeric, '999,999,999,999.9999999999'))
> or similar.
> 


In this vain, is there someplace in the docs that has a type conversion 
table (matrix) that shows what datatype can be cast into what other 
datatype (both implicitly and explicitly)?  I haven't seen one and it 
would be helpful for us newbies.

Thanks!
Kevin




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

* Re: datatype matrix (was: Re: Sorry..)
@ 2002-07-16 22:34  Josh Berkus <josh@agliodbs.com>
  parent: Kevin Brannen <kevinb@nurseamerica.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Josh Berkus @ 2002-07-16 22:34 UTC (permalink / raw)
  To: Kevin Brannen <kevinb@nurseamerica.net>; pgsql-sql


Kevin,

> In this vain, is there someplace in the docs that has a type conversion 
> table (matrix) that shows what datatype can be cast into what other 
> datatype (both implicitly and explicitly)?  I haven't seen one and it 
> would be helpful for us newbies.

I don't think it exists.   Hey, how about a volunteer to write one?

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




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

* Re: datatype matrix (was: Re: Sorry..)
@ 2002-07-17 08:27  Karel Zak <zakkr@zf.jcu.cz>
  parent: Kevin Brannen <kevinb@nurseamerica.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Karel Zak @ 2002-07-17 08:27 UTC (permalink / raw)
  To: Kevin Brannen <kevinb@nurseamerica.net>; +Cc: pgsql-sql

On Tue, Jul 16, 2002 at 12:37:04PM -0500, Kevin Brannen wrote:
> Josh Berkus wrote:
> > Christopher,
> > 
> > 
> >>In the bad old days when we couldn't distinguish explicit from implicit
> >>cast functions, I was wary of adding new cast pathways.  Too many
> >>implicit casts and you have no type system at all.  But in 7.3 there
> >>should be no reason to object to an explicit-only cast from numeric
> >>to text or vice versa.
> > 
> > 
> > I'd suggest making the explicit cast of numeric to text be the exact 
> > equivalent of:
> > 
> > SELECT btrim(to_char(numeric, '999,999,999,999.9999999999'))
> > or similar.

 Note: the btrim() call is needless. You can use Fill-Mode:

 SELECT to_char(numeric, 'FM999,999,999,999.9999999999');
                          ^^^
 It's in docs :-)

    Karel

-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz



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


end of thread, other threads:[~2002-07-17 08:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-07-16 17:37 datatype matrix (was: Re: Sorry..) Kevin Brannen <kevinb@nurseamerica.net>
2002-07-16 22:34 ` Josh Berkus <josh@agliodbs.com>
2002-07-17 08:27 ` Karel Zak <zakkr@zf.jcu.cz>

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