Re: troubles with postgresql - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: troubles with postgresql
Date
Msg-id 20030223151657.GA4937@wolff.to
Whole thread Raw
In response to Re: troubles with postgresql  ("erwan ancel" <erwan.ancel@free.fr>)
List pgsql-general
On Sun, Feb 23, 2003 at 15:38:30 +0100,
  erwan ancel <erwan.ancel@free.fr> wrote:
> Thanks everyone.
> For the char(n): I did not know this was defined by the SQL standard. So ok,
> and I will use the varchar type.

For Postgres you are probably better off using text instead of varchar(n)
unless there is something in your model that limits the length of the
string. If mysql doesn't have text, then you may still want to use varchar
anyway for portability.

> For the unsigned values. Well, I would like to make portable applications
> between PostgreSQL and MySQL. This means that if unsigned values do not have
> the same range for the 2 versions, this can be a problem. And again, I do
> not understand why PostgreSQL doesn't deal with unsigned. It should be so
> simple... Is it planned for one of the next releases ?

The simplest option is probably to use a large enough integer type that
you can hold the biggest integer you need in either database.

In 7.4 check constraints will work with domains. Then you will be able to
define something that looks like an unsigned integer type and the postgres
specific stuff will be in just one place. However the maximum value probably
still won't match mysql because the underlying type will still be signed
and you will lose one bit for the sign.

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: troubles with postgresql
Next
From: Carlos Moreno
Date:
Subject: Re: Strange error (Socket command option unknown)