Re: [SQL] feature request ?

2004-06-25 Thread sad
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)

Re: [SQL] feature request ?

2004-06-25 Thread Richard Huxton
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

Re: [SQL] Normalising an existing table - how?

2004-06-25 Thread Richard Huxton
Graham Leggett wrote: 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

Re: [SQL] feature request ?

2004-06-25 Thread sad
> 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

Re: [SQL] feature request ?

2004-06-25 Thread Radu-Adrian Popescu
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

Re: [SQL] feature request ?

2004-06-25 Thread Richard Huxton
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

Re: [SQL] Normalising an existing table - how?

2004-06-25 Thread Graham Leggett
Richard Huxton wrote: 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 partially normalised database. How can newtable contain data if you don't have any keys for it? Perhaps

Re: [SQL] Normalising an existing table - how?

2004-06-25 Thread Richard Huxton
Graham Leggett wrote: Because the database is partially normalised, the money table already contains rows corresponding to the properly normalised part of the database. New rows need to be added on top of the existing rows, replacing the rest of the columns that need to be normalised. As a resu

[SQL] Join columns

2004-06-25 Thread Przemysław Słupkowski
Hi How can I generate md5 chcecksum for a row in table. I have 47 columns in table and I want to generate chceck sum to check is integrity od data. I want to do something like this   select md5((idTowBK || SKDK || SKDT || SKGR || SKIR || SKKL || SKKR || SKLM || SKNZ || SKOP || SKPR)::varchar

Re: [SQL] Join columns

2004-06-25 Thread Achilleus Mantzios
O kyrios Przemys³aw S³upkowski egrapse stis Jun 25, 2004 : > Hi > How can I generate md5 chcecksum for a row in table. I have 47 columns in table and > I want to generate chceck sum to check is integrity od data. > I want to do something like this > > select md5((idTowBK || SKDK || SKDT || SKGR

Re: [SQL] question about which column(s) are the right foreign key

2004-06-25 Thread Markus Bertheau
Ð ÐÐÐ, 21.06.2004, Ð 06:57, Josh Berkus ÐÐÑÐÑ: > Markus, > > > I have objects in my database, and they have an object id generated with > > a sequence. Then I have object versions. The ids of object versions need > > to be unique only within one object id. But for simplicity they're > > generated

Re: [SQL] question about which column(s) are the right foreign key

2004-06-25 Thread Markus Bertheau
As a follow up, I now have object versions with the combined primary key (object id, date and time of object version creation). Now when I need to refer to an object version in a foreign key, do I let the object id column itself reference the objects table in addition to it being part of the foreig

Re: [SQL] Question about a CIDR based query

2004-06-25 Thread Josh Berkus
Georgos, > select * from tmp where route >>= some_cidr Can you post an EXPLAIN ANALYZE for this? And when's the last time you ran ANALYZE on the table? > The index on route is not used and I get a sequential scan. The index is > used only for the <<= operator. Most likely Postgres thinks tha

Re: [SQL] feature request ?

2004-06-25 Thread Jaime Casanova
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