Mac

June 29, 2007

SQL Rosetta Stone

Filed under: Uncategorized — mac @ 12:24 am

aka how to translate commands between MySQL and PostgreSQL

Meta information

MySQL PostgreSQL
show databases; \dn
show tables; \dt
show columns from t1; \d t1
show indexes fom t1; \di

Time information

MySQL PostgreSQL
UNIX_TIMESTAMP() SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-08');
FROM_UNIXTIME() select 1063147331.843::int4::abstime;
NOW() NOW()

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google]

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Powered by WordPress