PostGIS ST within does not exist
I’m quite new to postgresql and postgis so this error will probably due to some rookie mistake. I want to run the spatial query ST_within. When I describe the query like this SELECT nw.entity_id AS...
View ArticlePostgreSQL queries slower than before?
I am using PostgreSQL 9.3 server on my production server. Everything had been working fine for the past couple of months. But since the past week or so, PostgreSQL seems to have becomes very slow with...
View ArticleIs making joins between different table spaces slower?
In MySQL and PostgreSQL, is making joins between different tablespaces inherently slower, compared to joining tables in the same tablespace?
View Article(How) does table inheritance interfere with locking in postgres?
I have a table inheritance setup that might be simplified like this: CREATE TABLE p ( id BIGSERIAL PRIMARY KEY, type_id BIGINT, approved BOOLEAN ); CREATE INDEX ON p(approved); CREATE TABLE a ( a_field...
View ArticleCannot drop a Postgres table
I want to drop a few tables in my postgresql database. I am able to drop a few tables but there are 3 tables which I am unable to drop. I need to drop a few tables in my Postgres DB. I tried the...
View ArticleFinding lines of similar attribute with respect to nodes connected to its...
I have line networks with node generated for Start and End Point . how to check if a line has correct attribute with respect to point created at its End. for instance FuID_Line = ABC_BDQ and Start...
View ArticlePgbouncer is running, but cannot connect
pgbouncer started using “pgbouncer -d -v pgbouncer.ini” pgbouncer.log file: 2015-01-19 11:37:46.415 24708 DEBUG parse_ini_file: [databases] 2015-01-19 11:37:46.415 24708 DEBUG parse_ini_file:...
View ArticleWhy is Postgres on RDS maxing out on CPU every few hours?
Using Amazon RDS, we are running ETL scripts to migrate our data. However, every few hours there is a huge CPU spike. Here are the ETL specs (per ETL): 50 records inserted / second pool of 1000...
View ArticleQuerying sums of grouped consecutive rows in PostgreSQL 9
I have data about people traveling in different countries like this: country | begintimestamp | distance Germany | 2015-01-01 00:00:00 | 100 Germany | 2015-01-01 01:12:13 | 30 France | 2015-01-01...
View ArticleDoes someone have a cannonical example of setting up PostgreSQL with PLV8?
I’m hoping that someone can either post or point me to a guide for setting up PostgreSQL (9.4) and PLV8. I’m not an expert at PostgreSQL by any means and have been reading about and wanting to play...
View Articlepg_restore certain tables only
I’m looking for a way to use pg_restore to restore a newly-created database from a dump file, but only certain tables from that file. (There are a lot of extra tables in the database that are slow to...
View ArticlePostgreSQL Date Check Costraint
How could I add a Check-costraint for Date type in PostgreSQL? For example, CHECK 'DateXYZ>01/02/98' A typecast is needed?
View ArticleWhat are the side-effects of disabling nested loops in postgres?
A query of multiple joins spends a lot of time on nested loops. I disabled the nested loops and the query ran much faster. However, I have been told that nested loops might give me wrong results by...
View ArticleRemoving a FAILED node from repmgr cluster
How do I remove failed node from a PostgreSQL cluster? postgres@db-prod-ms47ox-10-3-104-92:~$ repmgr -f /etc/repmgr/repmgr.conf cluster show Role | Connection String * master |...
View ArticleIssues installing GDAL with PostgreSQL
I’m trying to install gdal-1.11.0 on CentOS 6 machine. Following the instructions, this is my config ./configure --prefix /usr/local --with-fgdb=/usr/local/FileGDB_API...
View ArticleQGIS 2.6 how to prevent user to drop a postgis table
Does anyone know how to prevent user to drop a postgis table? I have a vector layer imported from a postgis2.0 database, and one of my users drop it accidently. Fortunate I had a backup, but i don’t...
View ArticleWAL files are not copied
I’m using postgres 9.3 on Ubuntu 14.04 and I’m currently setting up a WAL backup. These are my changes to the postgresql.conf: [as described here:...
View ArticlePostgres: plpgsql combine ST_Overlaps and ST_Intersects
I have a question regarding creating a trigger function in postgres with 2 conditions: when creating a linestring in QGIS their must either overlap nor intersect. So i wrote 2 function, each working...
View ArticlePostgreSQL joining using JSONB
I have this SQL: CREATE TABLE test(id SERIAL PRIMARY KEY, data JSONB); INSERT INTO test(data) VALUES('{"parent":null,"children":[2,3]}'); INSERT INTO test(data) VALUES('{"parent":1,"children":[4,5]}');...
View Articlepsql: how to turn off context messages at raise notice
If I use raise notice, I get context messages at each execution. Can I turn them off and just get the NOTICE? NOTICE: d = [2,1] ,tn: (1,2,"{NULL,NULL}","{{-1,4},{-1,-1}}",1) CONTEXT: SQL statement...
View Article