Hi all,
I ask: "why not to disallow nulls in boolean fields?". It was a question not a proposal.
The explanation was clear to me. Nulls are not values but the absence of a known value.
It is comparable to the state of a c (or almost any other programming language) variable that had not been in
sad wrote:
sad wrote:
On Friday 25 June 2004 09:37, Rosser Schwarz wrote:
On Fri, 25 Jun 2004 08:16:47 +0400, sad <[EMAIL PROTECTED]> wrote:
Very simply, a boolean may have to values: true or false. It's also
possible that it's not been set to anything (NULL).
really ?
what about (13 < NULL)::BO
sad wrote:
You can think of values in plpgsql as wrapper objects that carry a value
and have a "is_null" flag; I have no idea how they're implemented in
PostgreSQL or in any RDMBS in general but this should do it, at least for a
naive implementation.
Why should i think on simple object MUCH more c
> sad wrote:
> > On Friday 25 June 2004 09:37, Rosser Schwarz wrote:
> >>On Fri, 25 Jun 2004 08:16:47 +0400, sad <[EMAIL PROTECTED]> wrote:
> Very simply, a boolean may have to values: true or false. It's also
> possible that it's not been set to anything (NULL).
> >>>
> >>>really ?
> >>>w
sad wrote:
On Friday 25 June 2004 09:37, Rosser Schwarz wrote:
On Fri, 25 Jun 2004 08:16:47 +0400, sad <[EMAIL PROTECTED]> wrote:
Very simply, a boolean may have to values: true or false. It's also
possible that it's not been set to anything (NULL).
really ?
what about (13 < NULL)::BOOL
Per the
On Friday 25 June 2004 09:37, Rosser Schwarz wrote:
> On Fri, 25 Jun 2004 08:16:47 +0400, sad <[EMAIL PROTECTED]> wrote:
> > > Very simply, a boolean may have to values: true or false. It's also
> > > possible that it's not been set to anything (NULL).
> >
> > really ?
> > what about (13 < NULL)
On Fri, 25 Jun 2004 08:16:47 +0400, sad <[EMAIL PROTECTED]> wrote:
> > Very simply, a boolean may have to values: true or false. It's also
> > possible that it's not been set to anything (NULL).
> really ?
> what about (13 < NULL)::BOOL
Per the semantics of NULL, 13 is neither greater than no
> Very simply, a boolean may have to values: true or false. It's also
> possible that it's not been set to anything (NULL).
really ?
what about (13 < NULL)::BOOL
---(end of broadcast)---
TIP 7: don't forget to increase your free space map sett
Very simply, a boolean may have to values: true or false. It's also
possible that it's not been set to anything (NULL).
--
Until later, Geoffrey Registered Linux User #108567
Building secure systems in spite of Microsoft
---(end of broadcast)--
On Thu, Jun 24, 2004 at 12:32:59PM -0500, Jaime Casanova wrote:
>
> Why not disallow the ability of boolean fields to be null?
Why not do it yourself? That's what the NOT NULL constraint is for.
A
--
Andrew Sullivan | [EMAIL PROTECTED]
I remember when computers were frustrating because they
On Thu, 24 Jun 2004, Bruno Wolff III wrote:
> On Thu, Jun 24, 2004 at 07:34:18 -0700,
> Stephan Szabo <[EMAIL PROTECTED]> wrote:
> >
> > I was thinking that something like Cs switch might work. There's still a
> > question of the keywords because I don't like reusing case, but maybe
> > somethi
Bruno Wolff III wrote:
There already is a syntax like this. You can do:
CASE boolean_expression
WHEN TRUE THEN whatever
WHEN FALSE THEN whatever
ELSE whatever
END
Besides, sad, there's no such thing as a tri-valued boolean.
You either have a boolean(with a true/false value) or a NULL, which i
On Thu, Jun 24, 2004 at 07:34:18 -0700,
Stephan Szabo <[EMAIL PROTECTED]> wrote:
>
> I was thinking that something like Cs switch might work. There's still a
> question of the keywords because I don't like reusing case, but maybe
> something of the general form:
> case foo
> is true
> is fa
Hi all,
Tri-valued boolean?? that's not against boolean concept?? i'm not saying that SQL is wrong nor Postgresql has to go beyond standard, i'm just trying to understand this stuff.
Why not disallow the ability of boolean fields to be null?
thanx in advance,
Jaime CasanovaMichael Glaesema
On Jun 24, 2004, at 6:39 PM, sad wrote:
...IF ELSEIF ELSE
it's all clear
but what about unequality of BOOL type possible value set and IF
alternatives
set
In my opinion the short answer is NULL is here because of the SQL
standard. The SQL standard does not specify any kind of "IF
alternative" fo
On Thu, 24 Jun 2004, sad wrote:
> > then lots of currently perfectly correct
> > programs break. If they're the same, then ELSE has different meanings
> > depending on whether NULL is specified, and that's generally bad from an
> > understanding the language standpoint.
>
> i've already thougth
> then lots of currently perfectly correct
> programs break. If they're the same, then ELSE has different meanings
> depending on whether NULL is specified, and that's generally bad from an
> understanding the language standpoint.
i've already thougth on this
new control structure needed
but the
On Thu, 24 Jun 2004, sad wrote:
> > If you were to add a NULL block you'd have to deal with things
> > like, if you only have a then and else, do you run the else on NULL or do
> > you do nothing? If you do nothing, what if you want the null and else to
> > be the same, do you add another way to
> If you were to add a NULL block you'd have to deal with things
> like, if you only have a then and else, do you run the else on NULL or do
> you do nothing? If you do nothing, what if you want the null and else to
> be the same, do you add another way to specify that? If you do the else,
> the
On Thu, 24 Jun 2004, sad wrote:
> > I don't see what your point is. That SQL is wrong ? Or that SQL is not "C"
> > ? Or that SQL is not a "programming language" ?
>
> Who said wrong ? who said SQL ?
>
> I thougth _WHY_
> the IF control structure has exactly two alternate blocks ?
> a BOOLEAN expre
On Thursday 24 June 2004 14:32, Alexander M. Pravking wrote:
> On Thu, Jun 24, 2004 at 11:04:15AM +0400, sad wrote:
> > Now you treat NULLs as false.
>
> Nope. NULL is neither true, nor false. It's "unknown", or "undefined".
>
> fduch=# SELECT 1 WHERE NULL::boolean;
> ?column?
> --
> (0 ro
On Thu, Jun 24, 2004 at 11:04:15AM +0400, sad wrote:
> Now you treat NULLs as false.
Nope. NULL is neither true, nor false. It's "unknown", or "undefined".
fduch=# SELECT 1 WHERE NULL::boolean;
?column?
--
(0 rows)
fduch=# SELECT 1 WHERE NOT NULL::boolean;
?column?
--
(0 rows)
...IF ELSEIF ELSE
it's all clear
but what about unequality of BOOL type possible value set and IF alternatives
set
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
> > IF foo IS NULL
> > THEN ...
> > ELSIF foo
> > THEN ...
> > ELSE ...
> > END IF;
>
> here the foo expression woll be executed twice
if you can use an immutable or stable function then the overhead would be
minimal as the system knows that it doesn't need to re-evaluate it.
regards
Iain
On Jun 24, 2004, at 1:49 PM, sad wrote:
On Thursday 24 June 2004 09:32, Michael Glaesemann wrote:
Creating a new control structure to do handle this seems odd. However,
one could easily have the same effect using a nested if. Using the
pl/pgsql ELSIF construct, it's pretty straightforward.
IF foo I
> I don't see what your point is. That SQL is wrong ? Or that SQL is not "C"
> ? Or that SQL is not a "programming language" ?
Who said wrong ? who said SQL ?
I thougth _WHY_
the IF control structure has exactly two alternate blocks ?
a BOOLEAN expression has exactly two possible values, that's
rom: sad [mailto:[EMAIL PROTECTED]
Sent: Wed 6/23/2004 10:01 PM
To: [EMAIL PROTECTED]
Cc:
Subject:Re: [SQL] feature request ?
On Wednesday 23 June 2004 21:12, you wrote:
> Sad,
>
> > since BOOL expression has three possible values: TRUE,FALSE,NULL
> > plpgsql IF
On Wednesday 23 June 2004 21:12, you wrote:
> Sad,
>
> > since BOOL expression has three possible values: TRUE,FALSE,NULL
> > plpgsql IF control structure should have three alternate blocks:
> > THEN,ELSE,NULL
> >
> > shouldn't it ?
>
> No, why?
>
> How would you construct a tri-valued IF/THEN?
On Thursday 24 June 2004 09:32, Michael Glaesemann wrote:
> On Jun 24, 2004, at 2:12 AM, Josh Berkus wrote:
> > Sad,
> >
> >> since BOOL expression has three possible values: TRUE,FALSE,NULL
> >> plpgsql IF control structure should have three alternate blocks:
> >> THEN,ELSE,NULL
> >>
> >> shouldn'
On Jun 24, 2004, at 2:12 AM, Josh Berkus wrote:
Sad,
since BOOL expression has three possible values: TRUE,FALSE,NULL
plpgsql IF control structure should have three alternate blocks:
THEN,ELSE,NULL
shouldn't it ?
No, why?
How would you construct a tri-valued IF/THEN? Doesn't seem too
likely to
Sad,
> since BOOL expression has three possible values: TRUE,FALSE,NULL
> plpgsql IF control structure should have three alternate blocks:
> THEN,ELSE,NULL
>
> shouldn't it ?
No, why?
How would you construct a tri-valued IF/THEN? Doesn't seem too likely to
me, as well as being different fro
Hello
since BOOL expression has three possible values: TRUE,FALSE,NULL
plpgsql IF control structure should have three alternate blocks:
THEN,ELSE,NULL
shouldn't it ?
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
hello
it might be stupid...
sometimes i am starving UPDATE OR INSERT command
thnx
---(end of broadcast)---
TIP 8: explain analyze is your friend
33 matches
Mail list logo