In between I finished an importable safedump.sql, but there is code to change in many .php files, too.
Needed changes
- all int(x) were converted to int
(all int datatypes are 4 Byte Integer, often used as int4 or integer. They differ when returning results, int(3) in mysql
returns 1 as 001 and int(5) as 00001. This is mysql-only. Do not get confused by number(X) or varchar(X))
- tinyint is not defined in sql or postgres, replacing it by smallint
- auto increment is not known by postgres, replaced data type by serial or bigserial. may be propriatary postgres
- blobs are not known by postgres, replaced it with bytea (byte array), may be propriatary postgres
- user is a reserved keyword of sql, it must not be used as table column. (for importing it I changed it, but it has to be renamed everywhere)
- `table` is propiatary mysql, just remove the `.
- "string" is illegal, use 'string' instead
- # is no sql comment, replace it by --
- password(string) is a mysql function for internal use only, it should not be used anywhere else. (Mysql 5.1 documentation) I replaced it by md5(string),
but this should be changed into using of salted hash, like md5(md5(string) || salt) where || means string concatenation, not OR.
- create new indixes, key is no postgres-keyword. (this step may be leaved out for testing. Just remove the keys.)
- drop if exist is not known by postgres, drop is allowed only, if table exists. I commented them out.
- timestamp: there is a timespace function within postgres, there is no need to use unix like timestamp.
There are some perl scripts to port sql from mysql to postgres, but I didn't used them. I hope I forgot not too much.
Testing on Saaviks and mine server should be possible, but this is just a standard pgsql installation, too, and not the latest version.
At the moment, I have some problems with the filter methods within main.php. As soon I understand what they should do and what they do here, I continue working on the conversation.
Last edit by Kazzenkatt on Feb 6, 2007, 9:49 am