File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -299,11 +299,30 @@ PostgreSQL notes:
299
299
300
300
You may want to consider lowering the "seq_page_cost" parameter; the query
301
301
planner tends to prefer seq scans instead of index scans for some operations
302
- with the default of 4, which is much slower. I found that 0.5 is a fairly
302
+ with the default of 4, which is much slower. I found that 1.1 is a fairly
303
303
good setting, you can set it in your postgresql.conf file, or just for one
304
304
database with:
305
305
306
- alter database goatcounter set seq_page_cost=.5
306
+ alter database goatcounter set seq_page_cost=1.1
307
+
308
+ Converting from SQLite to PostgreSQL:
309
+
310
+ You can use pgloader (https://pgloader.io) to convert from a SQLite to
311
+ PostgreSQL database; to do this you must first create the PostgreSQL schema
312
+ manually (pgloader doesn't create it properly), remove the data from the
313
+ locations and languages tables as they will conflict.
314
+
315
+ For example:
316
+
317
+ # Create new PostgreSQL database
318
+ $ createdb --owner goatcounter
319
+ $ goatcounter db migrate all -createdb -db postgresql+dbname=goatcounter
320
+
321
+ # Remove data from languages and locations tables
322
+ $ psql goatcounter -c 'delete from locations; delete from languages;'
323
+
324
+ # Convert data with pgloader
325
+ $ pgloader --with 'create no tables' ./db/goatcounter.sqlite3 postgresql:///goatcounter
307
326
`
308
327
309
328
const helpDBCommands = `List of commands:
You can’t perform that action at this time.
0 commit comments