Performance of primary key IDs with gaps (but in sequential order)
I know that having non-sequential IDs is bad for index performance. But assuming all my IDs are created in correct order, but with large gaps: i.e: 154300000 283700000 351300000 464200000 …will the...
View ArticleReplicate single table from Postgres 9.3 replica
I have an existing Postgres 9.3 server acting as a read-only replica using the built-in streaming replication. I need to replicate a single table from a database on that server to another physical...
View ArticleHow to setup a SQL trigger in CartoDB
I need to setup 2 SQL triggers in CartoDB that will update my inland and coastal tables each time my obs table is updated. I have never setup a SQL trigger but I have looked at the documentation and it...
View ArticleCan't list users from heroku psql
I have a heroku postgres add-on database with a user table. However, when I attempt to select * from user, all I get is: current_user ---------------- rtsjlhdfptlaqd (1 row) The table name is...
View ArticleRestrict two specific column values from existing at the same time
I have a PostgreSQL example table where at most one row that is not of type ‘c’ should be allowed. I would appreciate any help creating a constraint that will enforce this. CREATE TABLE example (...
View Articlemultiuser testing in web gis
We have build a web based application using aspmap and postgresql database (spatial database) While we were checking our app for multiuser testing, we found that the results are overlapped for the...
View ArticleOpenGeo postgres installation not working from command line but works from...
Problem: I just did a default install of opengeo suite (4.1) on Ubuntu 12.04 and followed instructions exactly. The problem is that I can connect just fine to my postgresql through pgadminIII (1.18.1),...
View ArticleArcGIS 10.2.1 crashes during connection with ArcSDE 10.0 inside PostgreSQL 8.0.1
I’m currently working in an infrastructure built with ArcGIS 10.0 (Desktop and Server) [SP2 build 3200] and because for some functionalities (ArcGIS for Desktop extensions) I need to use a newer...
View ArticleUsing PgBarman for PostgreSQL 9.3 backup
I’m setting up a backup strategy for a PostgreSQL 9.3 db. My job includes: take db backups every day/week/month use a Synology NAS as remote backup device I’m thinking of using Postgres [base_backup +...
View ArticlePostgres database dump and restore on different database
I have two Postgres databases on the same server, which have the same schemas. The goal is to have DB1 as the production and DB2, as the database that will receive all the data that is migrated from a...
View ArticleCould not open file "pg_clog/0000": No such file or directory
My local PostgreSql 9.2 database won’t start anymore this morning. I am on Windows 7. Yesterday, I performed a Windows Update before going to bed. I have checked the log and found: 2014-05-28 10:16:03...
View ArticleWhy does the behavior of array syntax differ from '(?,?)' syntax when...
I’m using PostgreSQL 9.3.5. Suppose I have the following table: CREATE TEMPORARY TABLE point_test ("name" varchar(255), "pt" point); I then insert a row, leaving pt NULL: INSERT INTO point_test (name)...
View ArticleConnect Jira to Postgresql with Pgpool-II
I gotta problem with connecting Jira 6 to Pgpool-II which is responsible for load balancing and replication in Postgresql bases(2 instances). Pgpool is started on port 9999, I just want to connect to...
View ArticleHow connect C# to Postgresql in host j.layershift.co.uk
I have installed postgresql database in http://postgres-project-1241043.j.layershift.co.uk/ host. I want to connect to the database using C#. I use Npgsql with following connection string....
View ArticleDebugging ogr2ogr "AddGeometryColumn failed" and "Terminating translation...
As noted in the title, I’m getting the following error: ERROR 1: AddGeometryColumn failed for layer pretty_polys, layer creation has failed. ERROR 1: Terminating translation prematurely after failed...
View ArticleShould one always VACUUM ANALYZE before REINDEXing in PostgreSQL 8.4?
Early in the morning every day a pgAgent job refreshes the contents of table A from table B on my PostgreSQL 8.4 database. Table A contains around 140k records across 91 columns and has two indexes –...
View ArticleUpdate SQL n:n table with multiple associations
I have done this before, but before I mindlessly repeat something that I consider as a hack, I’m asking here. I have 3 tables (details left out for clarity) : inv_items id bigserial (PK) sku character...
View ArticleDoes PostgreSQL support multi-threaded replication?
Is PostgreSQL replication single-threaded ? Are there any tools to achieve multi-threaded replication ? I’m asking this since Mariadb support this and currently I’m learning both these dbs.
View ArticleBulk update performance
I have a several process that aggregate some statistics on items (how much was shown, clicked … around 30 factors). Once in a 5 minutes i flush the aggregate data to postgres (9.1). I have 250K...
View ArticleExplicitly granting permissions to update the sequence for a serial column...
Recently I did create a table as a superuser including a serial id column, e.g., create table my_table ( id serial primary key, data integer ); As I wanted my non-superuser user to have write access to...
View Article