How can I import a .sql file into my Heroku postgres database?

This is how you do it: heroku pg:psql –app YOUR_APP_NAME_HERE < updates.sql And if you want to restore your production into staging (assuming both are heroku postgres DBs): heroku pgbackups:restore YOUR_STAGING_DATABASE_NAME `heroku pgbackups:url –app YOUR_PRODUCTION_APP_NAME` –app YOUR_STAGING_APP_NAME –confirm YOUR_STAGING_APP_NAME Make sure to preserve the special single quotes around heroku pgbackups:url –app YOUR_PRODUCTION_APP_NAME. HEROKU TOOLBELT UPDATE … Read more

Android Room Persistence library and Kotlin

Usually in project build.gradle I define the dependencies versions: ext { buildToolsVersion = ‘25.0.2’ supportLibVersion = ‘25.3.1’ espressoVersion = ‘2.2.2’ archRoomVersion = ‘1.0.0-alpha1’ } so in app build.gradle the dependencies look like: dependencies { compile fileTree(dir: ‘libs’, include: [‘*.jar’]) compile “org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version” compile “com.android.support:appcompat-v7:${rootProject.supportLibVersion}” compile “android.arch.persistence.room:runtime:${rootProject.archRoomVersion}” annotationProcessor “android.arch.persistence.room:compiler:${rootProject.archRoomVersion}” kapt “android.arch.persistence.room:compiler:${rootProject.archRoomVersion}” androidTestCompile(“com.android.support.test.espresso:espresso-core:${rootProject.espressoVersion}”, { exclude group: ‘com.android.support’, module: … Read more

“Cannot drop database because it is currently in use”. How to fix?

The problem is that your application probably still holds some connection to the database (or another application holds connection as well). Database cannot be deleted where there is any other opened connection. The first problem can be probably solved by turning connection pooling off (add Pooling=false to your connection string) or clear the pool before … Read more

Should OLAP databases be denormalized for read performance? [closed]

Mythology I always thought that databases should be denormalized for reading, as it is done for OLAP database design, and not exaggerated much further 3NF for OLTP design. There’s a myth to that effect. In the Relational Database context, I have re-implemented six very large so-called “de-normalised” “databases”; and executed over eighty assignments correcting problems … Read more

Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!)

Assuming by full dump you also mean the VIEWs and the EVENTs, you would need: GRANT USAGE ON *.* TO ‘dump’@’%’ IDENTIFIED BY …; GRANT SELECT, LOCK TABLES ON `mysql`.* TO ‘dump’@’%’; GRANT SELECT, LOCK TABLES, SHOW VIEW, EVENT, TRIGGER ON `myschema`.* TO ‘dump’@’%’; and if you have VIEWs that execute a function, then unfortunately … Read more