PostgreSQL create table if not exists

This feature has been implemented in Postgres 9.1: For older versions, here is a function to work around it: Call: Notes The columns schemaname and tablename in pg_tables are case-sensitive. If you double-quote identifiers in the CREATE TABLE statement, you need to use the exact same spelling. If you don’t, you need to use lower-case strings. See: Are PostgreSQL column names case-sensitive? pg_tables only contains actual tables. The … Read more

MySQL > Table doesn’t exist. But it does (or it should)

Just in case anyone still cares: I had the same issue after copying a database directory directly using command If you do this with a database that uses InnoDB tables, you will get this crazy ‘table does not exist’ error mentioned above. The issue is that you need the ib* files in the root of the MySQL datadir (e.g. ibdata1, ib_logfile0 and ib_logfile1). … Read more