Search Postgresql Archives

Re: Converting MySQL tinyint to PostgreSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 12, 2005 at 01:16:07AM -0400, Joe wrote:
> I have a MySQL database that I'm converting to PostgreSQL which has 10 
> columns with TINYINT type, i.e., a one-byte integer.  Only one of them 
> qualifies as a true BOOLEAN.  Two are entity identifiers (for limited range 
> "classes" or "categories") and three others are "type"/code values.  The 
> last four are month numbers or day of month numbers (not implemented as 
> date types because the year is separate and is part of the primary key).

Just to broaden your choices, there is also a "char" datatype (quotes
included!  If you omit them, it's a different thing, more overhead),
which you can use to store a single byte.  Could be used as a poor man's
ENUM.  Add appropiate CHECK constraints and it could be good enough for
some purposes.  Not useful for months, but maybe for your categories or
classes.

There are some usages of this in the system catalogs (e.g.
pg_class.relkind)

-- 
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
www.google.com: interfaz de línea de comando para la web.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux