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
Graham Leggett <[EMAIL PROTECTED]> wrote:
> >>- Select the money column from the table
> >>- Populate the new normalised table with each row containing
> >> the value from the original money column
> >>- Write the primary keys of the new rows in the normalised
> >> table, back to a new column in
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)--
Phil Endecott wrote:
- Select the money column from the table
- Populate the new normalised table with each row containing
the value from the original money column
- Write the primary keys of the new rows in the normalised
table, back to a new column in the original table added for
this purpose.
Frank Bax wrote:
Do all three steps in one command:
create table newtable as (select key1, key2, money from oldtable);
How would I put the primary key of each row in newtable back into
oldtable? Also, newtable already exists and contains data - I need to
add normalised data to an already partiall
At 02:51 PM 6/24/04, Graham Leggett wrote:
I have an existing table containing a column in it containing a money
value. I would like to normalise this column into a separate table, as the
money value is to be expanded to contain a tax value, etc.
I have been trying to find a SQL query that will
Graham Leggett wrote:
> I have an existing table containing a column in it containing
> a money value. I would like to normalise this column into a
> separate table, as the money value is to be expanded to contain
> a tax value, etc.
>
> I have been trying to find a SQL query that will do the
> fo
Hello,
Consider that I have the following table:
Create Table tmp(
route_id int NOT NULL,
route cidr NOT NULL,
Data varchar(100) NOT NULL)
The table contains ~40,000 routes and I have an index on route.
The query I am interested in is
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
Hi all,
I have an existing table containing a column in it containing a money
value. I would like to normalise this column into a separate table, as
the money value is to be expanded to contain a tax value, etc.
I have been trying to find a SQL query that will do the following:
- Select the mone
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
Programming languages, perhaps, but clearly not uncommon in SQL ... Informix certainly
allows a column to be of type boolean but with a value of NULL for given rows (unless
precluded by a not-null constraint). Should we question integers, which can be
positive, negative, or -- gasp ! -- NULL ?
28 matches
Mail list logo