Re: Is it possible (postgresql/mysql)

From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: "louis gonzales" <gonzales(at)linuxlouis(dot)net>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is it possible (postgresql/mysql)
Date: 2006-08-16 13:03:43
Message-ID: 7be3f35d0608160603g64d7475g380348cbb68e294@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Louis,

indizes are simply created outside the create table

CREATE INDEX someTable_Date_create
ON someTable
USING btree
(date_create);

As you are working on transferring, maybe you like to drop those varchar(xx)
and replace them with text. Saves a lot of hassle lateron.

Harald

On 8/16/06, louis gonzales <gonzales(at)linuxlouis(dot)net> wrote:
>
> Hello List,
> PostgreSQL 8.0.1 (on Solaris 9)
> There is a PERL program that a friend purchased which is used to create
> tables on a MySQL database, and of course ;) I want to run this on a
> PostgreSQL database server instead. The below is the code:
> $sth=runSQL("CREATE TABLE someTable (
> date_create bigint NOT NULL,
> date_end bigint NOT NULL,
> username VARCHAR(20) NOT NULL,
> $cat_definition
> id serial PRIMARY KEY,
> status VARCHAR(20) NOT NULL,
> $adfields
> visibility TEXT NOT NULL,
> priority TEXT NOT NULL,
> template TEXT NOT NULL,
> view bigint DEFAULT 0 NOT NULL,
> reply bigint DEFAULT 0 NOT NULL,
> save bigint DEFAULT 0 NOT NULL,
> updated bigint,
> photo VARCHAR(1) NOT NULL DEFAULT '0',
> INDEX(username),
> $cat_index
> INDEX(date_create) );");
>
> What my question is, the "INDEX(...)" function calls, which work this
> way on MySQL, don't work in PostgreSQL. Does anybody know what a
> synonymous way to modify the above code, for compatibility with
> PostgreSQL?
>
> FYI: yourVariable INT UNSIGNED AUTO_INCREMENT(MySQL)
> can be replaced by
> yourVariable serial
>
> Thanks group!
>
> --
> Email: louis(dot)gonzales(at)linuxlouis(dot)net
> WebSite: http://www.linuxlouis.net
> "Open the pod bay doors HAL!" -2001: A Space Odyssey
> "Good morning starshine, the Earth says hello." -Willy Wonka
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Let's set so double the killer delete select all.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message louis gonzales 2006-08-16 13:31:43 Re: Is it possible (postgresql/mysql)
Previous Message louis gonzales 2006-08-16 12:57:57 Is it possible (postgresql/mysql)