pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG REPORT: Unable to cast boolean::smallint
Date: Wed, 5 Nov 2014 08:31:02 -0800 (PST)
Message-ID: <1415205062021-5825784.post@n5.nabble.com> (raw)
In-Reply-To: <2537.1415200422@sss.pgh.pa.us>
References: <545A3454.80701@travelaudience.com>
	<2537.1415200422@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Tom Lane-2 wrote
> James Pittman &lt;

> j.pittman@

> &gt; writes:
>> It does not seem possible to be able to cast a boolean to a smallint.
> 
> Well, there are also not direct casts provided from boolean to bigint,
> numeric, real, or double precision ;-).  I'm not terribly excited about
> this.

So why is there one for Boolean to int?

To the OP, why do you think you want one?

While I haven't used it much converting Boolean to zero/one for use in a
math formula is a known use case though likely one where the difference
between int and smallint would probably be marginalized.

David J.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-REPORT-Unable-to-cast-boolean-smallint-tp5825768p5825784...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)  latest in thread

Message-ID: <1415205062021-5825784.post@n5.nabble.com>
Permalink:  ../1415205062021-5825784.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1415205062021-5825784.post@n5.nabble.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: BUG REPORT: Unable to cast boolean::smallint
  In-Reply-To: <1415205062021-5825784.post@n5.nabble.com>
  References: <545A3454.80701@travelaudience.com> <2537.1415200422@sss.pgh.pa.us> <1415205062021-5825784.post@n5.nabble.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