Unanswered: Convert query from MySQL to PostgreSQL
I'm in a process of expanding my app to work with other databases and for that I need to convert the MySQL statements to
DB2, InterBase, Oracle, ODBC, PostgreSQL, SQLite2 and SQLite3.
It should be an easy task because there are only four statements I have to convert:
SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_KEY, COLUMN_DEFAULT, EXTRA FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='<schema_name>' AND TABLE_NAME='<table_name>'
SELECT REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME, TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA='<schema_name>' ORDER BY REFERENCED_TABLE_NAME, TABLE_NAME, REFERENCED_COLUMN_NAME, COLUMN_NAME
SELECT name, param_list FROM mysql.proc WHERE db='<schema_name>' AND type='PROCEDURE'
Would you be so kind to tell me I it is possible to convert those statements to PostgreSQL compatible ones, and if so what is their PostgreSQL equivalent.
Postgresql supports the information schema, so the middle two queries should be straightforward. The first and last should also be supported with the information schema...
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert