pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: sad <sad@bankir.ru>
Cc: Michael Glaesemann <grzm@myrealbox.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: casting BOOL to somthng
Date: Wed, 1 Sep 2004 07:33:29 -0700 (PDT)
Message-ID: <20040901072051.N70341@megazone.bigpanda.com> (raw)
In-Reply-To: <6204.1094048394@sss.pgh.pa.us>
References: <200408311306.25545.sad@bankir.ru>
	<8AF2CE57-FBE1-11D8-A2A0-000A95C88220@myrealbox.com>
	<200409010955.45834.sad@bankir.ru>
	<200409010859.08037.peter_e@gmx.net>
	<6204.1094048394@sss.pgh.pa.us>


On Wed, 1 Sep 2004, Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > The cast to text, however, is part of the data model, and it has to be
> > both natural and universal.  I think you agree that there is no
> > universal, obvious correspondence between character strings and boolean
> > values, at least not nearly as universal and obvious as the well-known
> > correspondence between character strings and numbers.  We could pick
> > one arbitrary correspondence and implement it, and if we did we would
> > probably pick one that is consistent with the mapping used by libpq and
> > other frontends.  But doing that gains no functionality, so why bother?
>
> Actually it does gain functionality, because there are plenty of times
> when you need to manipulate a textual representation of a data value.

I don't think that doing so apart from trying to do output representation
is really a good idea in general (and for that I'd think something like
to_char would be more appropriate). For example, if people are casting
macaddrs to text in order to substring them or some such, that implies
to me that there are additional operations on macaddr we should have.



view thread (19+ messages)

Message-ID: <20040901072051.N70341@megazone.bigpanda.com>
Permalink:  ../20040901072051.N70341@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20040901072051.N70341@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, tgl@sss.pgh.pa.us, peter_e@gmx.net, sad@bankir.ru, grzm@myrealbox.com
  Subject: Re: casting BOOL to somthng
  In-Reply-To: <20040901072051.N70341@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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