This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# first stop force reload by launchctl | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[db makeFunctionNamed:@"UTTypeConformsTo" maximumArguments:2 withBlock:^(sqlite3_context *context, int argc, sqlite3_value **argv) { | |
if (sqlite3_value_type(argv[0]) == SQLITE_TEXT) { | |
const unsigned char *a = sqlite3_value_text(argv[0]); | |
const unsigned char *b = sqlite3_value_text(argv[1]); | |
CFStringRef as = CFStringCreateWithCString(nil, (const char*)a, kCFStringEncodingUTF8); | |
CFStringRef bs = CFStringCreateWithCString(nil, (const char*)b, kCFStringEncodingUTF8); | |
sqlite3_result_int(context, UTTypeConformsTo(as, bs)); |