PostgreSQL Primary key disappears from test table
I have a somewhat convoluted scenario where a test table I had created with a primary key won’t return the primary key. pgAdmin III reports there are no constraints. I have the entire PostgreSQL query...
View ArticleHow to implement a distributed database system [closed]
I have been tasked to find out how to implement a distributed database system using the various database management software available like: MS Access 2013, MySQL and PostgreSQL. How would I be able to...
View ArticleHow can I drop and create postgresql views in dependency order?
I found the following http://stackoverflow.com/a/9712051/61249 which is good but still too much manual labor for me. I need to recreate the views in the right order how would I go about doing that?...
View Articleprivilages system table in postgres
Is it possible to know all the tables a user has access to using a single query? I tried with pg_role and pg_user with no luck. Can anyone tell me about a system table which has the data of all the...
View ArticleOptimal way to ignore duplicate inserts?
Background This problem relates to ignoring duplicate inserts using PostgreSQL 9.2 or greater. The reason I ask is because of this code: -- Ignores duplicates. INSERT INTO db_table (tbl_column_1,...
View ArticleAre my queries to Postgresql hot spare actually being handled there?
I have master and minion database servers each running Arch Linux, with the latter acting as a hot spare database with replication. I wrote a service that is supposed to check whether the replication...
View ArticlePostgres Index a query with MAX and groupBy
Is there any way to index the following query? SELECT run_id, MAX ( frame ) , MAX ( time ) FROM run.frames_stat GROUP BY run_id; I’ve tried creating sorted (non-composite) indexes on frame and time,...
View ArticleDropped column still has value when recreated with Postgres table of 150M rows
I need to set the column to NULL. Until now, this has worked, but for some reason, on this table which is much larger than the rest, it doesn’t seem to be working: ALTER TABLE...
View ArticlePgpool II : unable to read message length between two network interfaces
Start log file: 2015-03-06 01:57:56: pid 2760: LOG: Setting up socket for 0.0.0.0:9999 2015-03-06 01:57:56: pid 2760: LOG: Setting up socket for :::9999 2015-03-06 01:57:56: pid 2760: LOG: pgpool-II...
View ArticlePlease help: kerberos authentication setup on postgresql
Requirement: Backend working with RHEL and postgresql and front-end working with windows,.net. please consider how the authentication method must be done. our main idea will be to have the...
View ArticleUpdate Statement in PostGIS ERROR
I am trying to update a column in PostGIS using information from a column in another table where they spatially intersect. I looked up how to do this on the PostgreSQL tutorial and I think that I...
View ArticleUPDATE a value field for area of the geom and convert sq m to acres using...
I’m trying to use the SQL commands in CartoDB to UPDATE a value field that shows total acres of the area of the_geom. My SQL is pretty poor/entry level and has some issues: UPDATE table_name SET...
View ArticlePostgres errors with Metatag module in combination with Drag and Drop File...
After having migrated from a MySQL 5.5 to a Postgres 9.3 Database I encounter some issues in a Drupal OpenOutreach installation. I have a content type with a Drag & Drop Upload field to display...
View ArticleIs there a way to refresh pgAdmin's schema browser via SQL? [on hold]
I use pgAdmin III and every time I launch a SQL query, the database structure doesn’t refresh automatically. For instance: dropping a table doesn’t make the table disappearing from the database tree on...
View ArticleSearch results mismatch after postgresql update
Today we had to update the PostgreSQL version on our database servers. Before update the version was 9.3.4 and the new one is 9.3.6. Despite the small difference in the database version and the...
View ArticleCan I setup database triggers to run on a defined secondary set of servers...
This might sound a bit off, but here’s what I have been thinking for a while now: Use Case You want to build an activity log for each user action on your application using database (postgreSQL)...
View ArticleMaking ordinal synonyms for Postgres full text search
I have a Postgres 9.3 database where users are mostly searching for locations by a combination of name and/or address (or fragments of). An example of an address would be “123 8th st”. I’ve been able...
View Articlepostgresql bdr 0.8.x – adding another downstream server only partially works
I have the following postgresql 9.4 bdr setup: upstream server with db called “bdrdemo” running on 10.1.1.1 downstream server(1) with db called bdrdemo running on 10.2.2.2 (replicates with 10.1.1.1)...
View ArticleStorage snapshots for consistent backup of postgresql – different data and...
We are running many Linux VM’s in a vmware/shared storage environment, each running its own instance of postgreSQL (a mix of 9.0 and 9.3). Currently, the entire VM sits on a single root...
View ArticlePostgres ON DELETE Rule Not Working With WHERE Clause
I’m trying to implement “Soft Deletes” given the following schema: CREATE TABLE categories( id serial not null primary key, num integer, "name" text, deleted_at timestamp default null ); CREATE OR...
View Article