vallismortis
  • Member for 6 years, 7 months
  • Last seen more than a month ago
Restore PostgreSQL database with same locale settings as source database
5 votes

These are the exact steps I take to import a copy of a PostgreSQL 9.5 database (exported on Linux using en_US.UTF-8 encoding) into PostgreSQL 9.3 on Windows 7 or PostgreSQL 9.5 on Windows 8.1. You ...

View answer
PostgreSQL command history on Windows
3 votes

On Windows, there isn't an exact equivalent to a .bash_history because cmd.exe is an intrinsically different type of shell. I think you're referring more to the .psql_history (see related question). ...

View answer
Poor query performance over timestamp range by week in PostgreSQL 9.3
Accepted answer
2 votes

Thanks to those who contributed in the comments, I have reduced the query time from ~8000 ms to ~1650 ms by: Adding an index on the timestamp column only (~2000 ms improvement). Removing the extra ...

View answer
Create 2D truth table from "cross product" of two tables via PostgreSQL view or function
1 votes

Here is a function for generating the value of any cell (I'm using text instead of int to avoid type conflicts when I merge in the headers later): CREATE OR REPLACE FUNCTION is_group_member(mname ...

View answer
Slow query in PostgreSQL selecting a single row from between a range defined in two columns
1 votes

Thanks to a comment, I have a solution that reduced the query time to 0.073ms by using a gist spatial index and adjusting the query accordingly: account=> DROP INDEX ip_to_db11_idx; account=> ...

View answer
Counting and grouping over multiple OUTER JOINs
Accepted answer
0 votes

I was able to find a solution while I was composing the question, but I've decided to post both the question and answer in case it helps someone else in the future. Alternatively, if anyone has a ...

View answer