mysql2pgsql :給 MySQL 用戶遷移至 PostgreSQL 的轉換程序稿本
更新:2007-03-06
專案及下載網址:
http://pgfoundry.org/projects/mysql2pgsql/
目前版本:1.2 (2007.03.04 更新)
內容:
這是個很成熟的 PgFoundry 的子專案,
perl 稿本程序用來轉換 mysqlDump.sql 文件檔成 postgresDump.sql 文件檔。
然後您再裝入到 psql 。所有 datatypes 都能被處理並且有著 7 個指令旗標可被利用。
下載後只要有 perl 的執行環境就可利用
在 Linux 下的話先變更執行權限
#chmod a+x mysql2pgsql.perl
下面能輸出詳細使用說明
#perl mysql2pgsql.perl --help
==========================================
Usage:
perl ./mysql2pgsql.perl {--help --debug --preserve_case --char2varchar -- nodrop --schema --sepfile --enc_in --enc_out } mysql.sql pg.sql
* OPTIONS WITHOUT ARGS
--help: prints this message
--debug: output the mysql line above the postgres line
--preserve_case: prevents automatic case-lowering of column and table na mes
If you want to preserve case, you must set this flag. For exampl e,
If your client application quotes table and column-names and the y have cases in them, set this flag
--char2varchar: converts all char fields to varchar
--nodrop: strips out DROP TABLE statements
warnings are printed by psql for DROP TABLE statements if the ta ble does not exist
* OPTIONS WITH ARGS
--schema: outputs a line into the postgres sql file setting search_path
--sepfile: output foreign key constraints and indexes to a separate file so that it can be
imported after large data set is inserted from another dump file
--enc_in: encoding of mysql in file (default utf8)
--enc_out: encoding of postgres out file (default utf8)
* REQUIRED ARGUMENTS
mysql.sql (undefined)
pg.sql (undefined)
#
沒有留言:
張貼留言