postgresql replace table without losing dependancies
i want to replace an existing table with a new one, without losing foreign keys or inheritance relations. But I feel lazy to alter it to make it look like the new one. Is there a way to replace the...
View ArticleInserting coordinates from Google Maps into a Database
My question is pretty basic. I am using Android Google Maps to take the coordinates off a location on the map and I want to insert it into a PostgreSQL database. I know I have to use PostGIS but how...
View Articlepg_basebackup could not get WAL end position from server
I’m trying to pg_basebackup my database. I followed instructions in PG Mauals and set it up properly (check on other server and database), but my backup isn’t ending – on end of progress it’s...
View Articleusing string concatenation to reference a table
For a database systems project which tracks entities histories, I stumbled acros the following problem. Assume we have the table “entity” CREATE TABLE entity ( eID SERIAL PRIMARY KEY, eName...
View ArticleTransactions within a Transaction
What behaviour would PostgreSQL display if for example the script below were called BEGIN; SELECT * FROM foo; INSERT INTO foo(name) VALUES ('bar'); BEGIN; <- The point of interest END; Would...
View ArticleDatabase Security – Prevent column writing?
I am using a Postgres db. I am concerned if someone gets in my DB, they could change the price of my products to $0 and download my products. Am I able to prevent writing / editing of that column...
View ArticleGeoServer 2.6 + PostgreSQL 9.3.5, GeoServer becoming unresponsive
We’re displaying point vector data on a web client using an OpenLayers (2.12) WMS layer… rendered via a GeoServer SQL View reading from data in PostgreSQL. The particular layer has a viewParam on it...
View ArticleHow to change the mount point for a column in postgresql table?
This is my scenario I have a table t with following columns id int link varchar(500) name varchar(20) sal text In the link column we will store the location for the pdf files(mount point) Ex: link...
View Articlepgbench-tools failed authentication
I’m trying to configure pgbench-tools and went to run it per the README and got this error -bash-4.2$ ./newset 'Initial Config' psql: FATAL: Ident authentication failed for user "postgres" psql: FATAL:...
View Article'Prioritize' one column over another
I’m working with subscription table currently and I’m creating a cron job that will take records based on some condition from the subscription table. I want to select all subscription records that have...
View ArticleSlow querys on billions-rows-table // index used
Since I’m a young developer and not realy skiled in using databases (PostgreSQL 9.3) i ran into some problems with a project, where i realy need help with. My project is about collecting data of...
View ArticleCapturing points slightly out at sea
I have two tables one containing points (points) and the other polygons (polygons). I want to generate a two-columns table identifying for each point of the first table the polygon containing it. So...
View ArticleHow long to learn PostgreSQL?
I want to learn PostgreSQL and How to make the learning process efficient, but really don’t know how long it would take even after googling my question. I used MySQL before and knew relational...
View ArticlePostGIS doesn't use index for spatial query
I can’t get PostGIS 2.1 running on PostgreSQL 9.3.5 to use a spatial index even for the simplest queries. The whole dataset is 8 million points (population count grid from here...
View Articleimporting shapefiles to postGIS on QGIS1.8
I am trying to import a shapefile into postgis from within QGIS 1.8. The QGIS is based on a server that is not managed by myself. I have requested an upgrade to QGIS 2.0 …but this may take sometime so...
View ArticleQGIS formatting problem using POSTGIS (datetime)
I want to use the time manager plugin using data from a PostreSQL-db. In there the time stamp is set up as follows: “[...]to_timestamp(’2014-10-21 00:00:00′, ‘YYYY-MM-DD HH24:MI:SS’)::timestamp without...
View Article'Prioritize' one column over another
I’m working with subscription table currently and I’m creating a cron job that will take records based on some condition from the subscription table. I want to select all subscription records that have...
View ArticleHow to remove object from json array?
My table: CREATE TABLE items ( id BIGINT PRIMARY KEY NOT NULL, name VARCHAR, images json ); images format: [ { "id": "owner", "full": "<url>", "thumb": "<url>" }, { "id": "note_0", "full":...
View ArticleGet closest (source or target) of an edge from a point in postgres
I have a Postgres custom function that uses pgr_dijkstra to generate a route working. It works be passing the lat/lon of the start and destination points. I then find the closest segment vertice to...
View ArticleQuery Processing at backend (I/O on disk)
I have a table with 100k rows created on PostgreSQL 9.3 create table demo_bbb ( id numeric NOT NULL, code_bbb character varying, column_02 character varying, column_03 character varying, column_04...
View Article