Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8B74EB5DBE0 for ; Mon, 17 Oct 2011 12:11:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 85072-07 for ; Mon, 17 Oct 2011 15:11:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail.cybertec.at (mail.cybertec.at [87.118.110.48]) by mail.postgresql.org (Postfix) with ESMTP id 90B81B5DBC7 for ; Mon, 17 Oct 2011 12:11:48 -0300 (ADT) Received: from [192.168.0.13] (home [84.115.25.80]) by mail.cybertec.at (Postfix) with ESMTP id 773A65FC362; Mon, 17 Oct 2011 16:50:24 +0200 (CEST) Subject: Re: char(0) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=iso-8859-1 From: =?iso-8859-1?Q?PostgreSQL_-_Hans-J=FCrgen_Sch=F6nig?= In-Reply-To: <4E9C3E94.3020509@pse-consulting.de> Date: Mon, 17 Oct 2011 17:11:47 +0200 Cc: Thomas Kellerer , pgsql-bugs@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <4E9BD9E2.2010305@2ndQuadrant.com> <4E9C3E94.3020509@pse-consulting.de> To: Andreas Pflug X-Mailer: Apple Mail (2.1244.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/141 X-Sequence-Number: 31411 On Oct 17, 2011, at 4:41 PM, Andreas Pflug wrote: > Am 17.10.11 10:53, schrieb Thomas Kellerer: >> Susanne Ebrecht, 17.10.2011 09:31: >>> Hello, >>>=20 >>> I couldn't find that somebody already mentioned it. >>>=20 >>> PostgreSQL isn't supporting CHAR(0). >>>=20 >>> An empty string has a length of 0. >>>=20 >>> CHAR(0) can have two values: NULL and empty string. >>>=20 >>> In MySQL it is very common to simulate not null boolean >>> by using CHAR(0). >>>=20 >>> This is a little bit annoying on migration topics. >>=20 >> While not move on to a cleaner approach during the migration and use = a >> "boolean not null"? >=20 > Sounds much too straight forward, not mysql-ish artistic enough... >=20 > Regards, > Andreas yes, if you do proper migration you should try to get rid of stupid = design like this.. it is possible to stand on your head actually ... it just makes no sense = if you are waiting for the bus. the fact that mysql has something does not implicitly mean that it makes = sense to have it as well. a way to get around it would be ... CREATE TYPE my_intentionally_broken_type ... ;). but, i would not see that as recommendation actually :). regards, hans -- Cybertec Sch=F6nig & Sch=F6nig GmbH Gr=F6hrm=FChlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de