Quantcast
Channel: Question and Answer » postgresql
Browsing all 1138 articles
Browse latest View live

Why is PostgreSQL doing a seq scan on column != column?

Why is PostgreSQL doing a table scan on column != column? Isn’t this query guaranteed to return no results? Isn’t anything != anything guaranteed to be always false for any record on a not null column?...

View Article


What options are there for geolocation-aware SQL databses?

I need to implement an SQL database that can make queries using geo-location based logic. e.g. select rows within 500m of coordinate x, y What options are available to do this with sqlite, mySQL,...

View Article


Where to type pgsql2shp command

How to convert post gis database into shapefile, I found that I need to use pgsql2shp command on postgis database query , But how to use it and where to use it. Do I have to use it in the postgre sql...

View Article

PostgreSQL db volume at 100%. Can I create a tablespace on another volume so...

I have run out of space, because I am new to Postgres and I have just not been monitoring it properly. Now I cannot even vacuum the tables: ERROR: could not extend file "base/20851/11787": No space...

View Article

Check whether empty strings are present in character-type columns

I have an application that (as part of its logic) trims strings and replaces empty strings with NULL prior to insertion in the database. I guess one way to ensure that this is enforced would be to...

View Article


Optimizing SELECT queries

I’m not very experienced with database query optimization. I’ve been reading through similar questions here and Postgres tuning articles online, but unfortunately I haven’t had any luck. Here’s what I...

View Article

Insert several gtfs feeds into the same postgis/pgrouting database

I want to import sevaral gtfs feeds into my postgis/pgrouting database so that I can route over all my gtfs feeds. The problem is that the sources / destinations ids of my gtfs are likely to conflict....

View Article

Inside/Outside Local Jurisdictions

Does anyone know of a software or service that can define whether a location is inside or outside of city and county jurisdictions? Our company is getting hit with huge tax audits because we did not...

View Article


What's postgresql connection protocol? [on hold]

I’m newbie in databases and I’d like to ask a question which may seem quite obviously. I need to connect to a postgreSQL server manually (I’m using postgreSQL 9.3). What’s the connection protocol the...

View Article


Diagnosing the error in a Postgresql to Redshift migration through psycopg2

I am running a job class that contains the following: A Postgresql connection that can issue SQL statements A Redshift connection that can do the same an S3 connection to function as an intermediary...

View Article

Postgresql Full Text Search sequence of strings

What I’m trying to do is that i have a bunch of html documents in which I need to search for certain groups of strings. I did build a ts_vector for all htmls but I seem not be able to find out if it...

View Article

Handling exceptions from inside a function

I need to add a trigger after insert or update on a table so that, where some row is updated and a certain condition is met, then some other table needs to be updated. However, that last update...

View Article

Viewing large set of polygons in PostGIS using OpenLayers?

I am prety new to GIS. I have set up a postgis database with al large dataset and a openlayers front-end to display it. But since the dataset is getting prety big I am looking for a way to only load...

View Article


Multiple queries and a report

im fairly new to databases. I have multiple query’s that i normally run individually at the end of loading data to my table doing simple integrity checks like length ,char types and so on (see examples...

View Article

How to understand the PostgreSQL discrepancy between connection pool...

From PostgreSQL docs: Number of Database Connections -> How to Find the Optimal Database Connection Pool Size for optimal throughput the number of active connections should be somewhere near...

View Article


Geoserver ( Java.exe ) cause server to run 100%

Our server runs at 100% CPU when using map services build on geoserver + postgresql I can not find anything in geoserver logs. It is Java.exe takes 100% CPU and because of that server can not do...

View Article

Matching a value with every element of a set of values – Postgresql

I’m new in Postgres and I can’t achieve what I’m trying to do. I have a list of films in a Films table ID_FILM FILM NAME 1 Terminator 2 Forrest Gump 3 Nueve reinas A Country table ID_COUNTRY COUNTRY 1...

View Article


why pg_restore ignores –create ? Error: failed: FATAL: database “new_db” does...

I am trying to run following command: sshpass -p "pass" ssh x@1.2.3.4 "pg_dump -Fc -U foo some_db" | pg_restore --create --dbname=new_db I get: failed: FATAL: database "new_db" does not exist

View Article

script for restore of postgres database localy from dump given on stdin –...

Runing this command: sshpass -p "pass" ssh x@1.2.3.4 "pg_dump -U foo some_db" runs perfectly fine. It returns on stdandard output the dump of db. Then I would like to restore new_db based on dump...

View Article

The number of copies for each table stored in physical storage

I am new to Postgres and the database field. My question is that how many copies of each table are stored in physical storage device (memory, disk and so on)? I assume we need more than one copies for...

View Article
Browsing all 1138 articles
Browse latest View live