diff --git a/content/posts/2018-09.md b/content/posts/2018-09.md index 202e86d7b..2a0bfe10f 100644 --- a/content/posts/2018-09.md +++ b/content/posts/2018-09.md @@ -459,5 +459,14 @@ Type "help", "copyright", "credits" or "license" for more information. - Or maybe I should just bite the bullet and migrate this to PostgreSQL, as it [supports `UPSERT` since version 9.5](https://wiki.postgresql.org/wiki/UPSERT) and also seems to have my new favorite `LIMIT` and `OFFSET` - I changed the syntax of the SQLite stuff and PostgreSQL is working flawlessly with psycopg2... hmmm. +- For reference, creating a PostgreSQL database for testing this locally (though `indexer.py` will create the table): + +``` +$ createdb -h localhost -U postgres -O dspacestatistics --encoding=UNICODE dspacestatistics +$ createuser -h localhost -U postgres --pwprompt dspacestatistics +$ psql -h localhost -U postgres dspacestatistics +dspacestatistics=> CREATE TABLE IF NOT EXISTS items +dspacestatistics-> (id INT PRIMARY KEY, views INT DEFAULT 0, downloads INT DEFAULT 0) +``` diff --git a/docs/2018-09/index.html b/docs/2018-09/index.html index fc7a741ce..47b8e7c5a 100644 --- a/docs/2018-09/index.html +++ b/docs/2018-09/index.html @@ -18,7 +18,7 @@ I’m testing the new DSpace 5.8 branch in my Ubuntu 18.04 environment and I " /> - +
  • Or maybe I should just bite the bullet and migrate this to PostgreSQL, as it supports UPSERT since version 9.5 and also seems to have my new favorite LIMIT and OFFSET
  • I changed the syntax of the SQLite stuff and PostgreSQL is working flawlessly with psycopg2… hmmm.
  • +
  • For reference, creating a PostgreSQL database for testing this locally (though indexer.py will create the table):
  • +
    $ createdb -h localhost -U postgres -O dspacestatistics --encoding=UNICODE dspacestatistics
    +$ createuser -h localhost -U postgres --pwprompt dspacestatistics
    +$ psql -h localhost -U postgres dspacestatistics
    +dspacestatistics=> CREATE TABLE IF NOT EXISTS items
    +dspacestatistics-> (id INT PRIMARY KEY, views INT DEFAULT 0, downloads INT DEFAULT 0)
    +
    + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 01937f3b0..6b1e66dbd 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -4,7 +4,7 @@ https://alanorth.github.io/cgspace-notes/2018-09/ - 2018-09-24T16:35:43+03:00 + 2018-09-25T02:24:43+03:00 @@ -184,7 +184,7 @@ https://alanorth.github.io/cgspace-notes/ - 2018-09-24T16:35:43+03:00 + 2018-09-25T02:24:43+03:00 0 @@ -195,7 +195,7 @@ https://alanorth.github.io/cgspace-notes/tags/notes/ - 2018-09-24T16:35:43+03:00 + 2018-09-25T02:24:43+03:00 0 @@ -207,13 +207,13 @@ https://alanorth.github.io/cgspace-notes/posts/ - 2018-09-24T16:35:43+03:00 + 2018-09-25T02:24:43+03:00 0 https://alanorth.github.io/cgspace-notes/tags/ - 2018-09-24T16:35:43+03:00 + 2018-09-25T02:24:43+03:00 0