[imp] tinyint, why not smallint or int2?

Martín Marqués martin@bugs.unl.edu.ar
Thu, 15 Nov 2001 10:44:41 -0300


On Jue 15 Nov 2001 03:28, you wrote:
> Quoting Martín Marqués <martin@bugs.unl.edu.ar>:
> > I'm looking at the category.sql, and I see that there are tinyint data
> > types, which I can guess that are MySQL's equivalent to INT2 or SMALLINT.
> > Can't this be compatible to all databases? I think that MySQL supports
> > SMALLINT, as well as PostgreSQL an Informix (those are the ones I know).
>
> I have mysql in one dev environment and MS SQL Server in my other, and they
> tend to be pretty different, but they both have tinyint. Postgres doesn't?

No, and I could dig a little in some SQL book to see which would be the 
standard. SMALLINT works (AFAIK) in PostgreSQL, MySQL and Informix. Don't 
know about MSSQL.

> > I also see that there is an ALTER TABLE to add an index, when it should
> > only be a CREATE INDEX statment.
>
> I hadn't sorted out making these portable at all yet. Is CREATE INDEX a
> portable statement?

CREATE INDEX is the correct statmente for the creation of INDEXES.

If you want, I can send you my version of the categories.sql file as a 
contrib.

Saludos... :-)

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------