Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0DAF1632A22 for ; Tue, 7 Jul 2009 06:05:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 95805-04 for ; Tue, 7 Jul 2009 06:05:21 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f210.google.com (mail-gx0-f210.google.com [209.85.217.210]) by mail.postgresql.org (Postfix) with ESMTP id 2FC2F6328EB for ; Tue, 7 Jul 2009 06:05:18 -0300 (ADT) Received: by gxk6 with SMTP id 6so5120914gxk.19 for ; Tue, 07 Jul 2009 02:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=apOTcOPnGAHNsem+z7hS1NpRgWfUUamj2xb3g5oEtT0=; b=loZiV7ZiZPYRgFGuiigf7ZiaK5vxbI1hvJc4DSRuYUmBIz3pL0PFQKDdhz0tu3Y22u CuKom+Y8kW8JqNCvkOyxmYPstPSYrIZB7WnxnzBPOAfTawjn9fGkyFonvHT+TNanSDrJ dPcZwTMz3np7KoHnFomGmoMq70AiEUh3KXxxM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=JuoGuQn+xrPZwg5BPrfn4u5byRAgcfuMruRSgWU0ZidFF3TIixVE8hjMMqasgP8G7W ttmjyeyi5NJhTPHEc4oLFnoW2DwDBKB64I9Pw8U/FFcDVEiQ9A2uAPw98SDzOJ5Dad8i 9FeyKyALesDm7fURbcx5luKHj3RmlhTQ99oHA= MIME-Version: 1.0 Received: by 10.100.47.10 with SMTP id u10mr10284154anu.17.1246957516996; Tue, 07 Jul 2009 02:05:16 -0700 (PDT) In-Reply-To: References: <71F491F5DA99604A80DE49424BF3D02B0C089039@exchange8.actuate.com> Date: Tue, 7 Jul 2009 02:05:15 -0700 Message-ID: <5d0f60990907070205u3189bd01vff17950e63159455@mail.gmail.com> Subject: Re: Best way to simulate Booleans From: Dirk Jagdmann To: Scott Marlowe Cc: Peter Headland , pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/27 X-Sequence-Number: 32768 > The most transportable method would be to use either a char(1) or an > int with a check constraint. > > mybool char(1) check (mybool in ('t','f')) > mybool int check (mybool >=0 and <=1) I would decide depending on the application requirement. If my Oracle should look similar to PostgreSQL use the char(1). If you have lots of application code the int is probably better, since you can just use the created programming language variable (presumably an integer as well) in your programming language expressions (if, while). -- ---> Dirk Jagdmann ----> http://cubic.org/~doj -----> http://llg.cubic.org