Howto disable Postgres listening on TCP?
Simply to avoid many problems in the first place I do not want my postgres server program to accept/listen to anything from any network (i.e. TCP/IP 4/6) connections. My setup is a Postgres 9.1 on an...
View ArticleUnable to push table from pgadmin to heroku
I have tried https://devcenter.heroku.com/articles/heroku-postgresql#local-setup but heroku pg:psql keeps returning “not found” heroku pg:psql app::databaseName returns The local psql command could not...
View ArticleNullable One To Many w/Join Table – Indexing
I have a question regarding database design, I am working with PostgreSQL using Hibernate for ORM, the design I inherited includes the following tables users user_id (pk) user_name user_dob … sessions...
View ArticleSchema for analytics table in Postgres
We use Postgres for analytics (star schema). Every few seconds we get reports on ~500 metrics types. The simplest schema would be: timestamp metric_type value 78930890 FOO 80.9 78930890 ZOO 20 Our DBA...
View ArticlePostgresql Trigger to insert records in my table from another one
I spent few days trying to resolve this question but it was impossible. I have two tables: Table1. CREATE TABLE point ( id_point integer NOT NULL DEFAULT, layer text, elevation numeric, geom...
View ArticleCopy few rows from one database to another
I have two PostgreSQL databases on two different machines and the network connection is slow. I would like to copy few selected rows from the first instance to the second. Unfortunately, the full dump...
View ArticleCan not install Nominatim. How do I fix it? [Solved] [closed]
I download OSM map into postgresql. It is all correct. Today I install Nominatim. http://wiki.openstreetmap.org/wiki/Nominatim/Installation I stop on the step: ./utils/setup.php –osm-file –all...
View Articleformatting SQL expressions in arcpy
I’m trying to use SelectLayerByAttribute to find the last point added to a FC. I figured I could use the objectid field because it’s serial. I wrote the following:...
View ArticleHow can you have a combined primary key for one table?
I have exactly the same question as posted here. But in my case I do not use MySQL but Postgres. Can this be done with Postgres? All things indicate I can not use a combined index in Postgres, so...
View ArticlePostgres: What happens if your slave DB went down temporarily?
I have a master DB that is replicated to a slave DB through binary replication. What happens if this slave DB were to go offline for a period of time? Would it eventually catch up with the master as...
View ArticleWhy aren't unsigned integer types available in the top database platforms?
Databases are usually very customizable with varying data types and custom lengths. It surprises me, as I try to look for the syntax to use unsigned int types that they are not available from neither...
View ArticleStored procedure deadlocking itself
I have a strange situation, seen from the log: Process 37278 waits for ExclusiveLock on advisory lock [16421,999999,12864385,2]; blocked by process 53807. Process 53807 waits for ExclusiveLock on...
View ArticleIs Postgres ignoring my function cost annotation?
Why does this: create or replace function dummy() returns double precision as $$ SELECT random() $$ LANGUAGE SQL COST 777; explain select dummy(); return this: Result (cost=0.00..0.01 rows=1 width=0)...
View ArticleSimple PostgreSQL lookup table is inexplicably slow
I’m trying PostgreSQL 8.4.14 for storing triples, pieces of data of the form (String, String, String). For speed, I’m not repeatedly storing strings but rather using two tables: main table triples...
View Articleosm2pgsql: Import data in custom projection
I have osm-file and I want to import it to the postgresql via osm2pgsql with custom projection EPSG:20022. I look to the help and found out any keys like -E EPSG: but when I try to do with it I get the...
View ArticlePostgres sequence usage
I have an Postgres database with two users: dev and junit. Junit and dev objects are dropped and created regularly. They both have the same objects unshared for tables, however, sequences are shared,...
View ArticleCalling another function inside a postgres function
I have a function A and function B. Function A Name is f_a() and the code is: Select id,address from A; Function B Name is f_b() code is: Select C.address,B.name From (Select id,name from B, (Select *...
View ArticleImport of OSM data into PostgreSQL using osm2pgsql: which formats are supported?
I followed a tutorial to install a PostgreSQL server on my Mac OS X Mavericks, and to import some OSM data with the osm2pgsql converter...
View ArticleMissing libintl.8.dylib in shp2pgsql [closed]
I asked this on SO but since this is a GIS question I figured I should ask here too… I’m trying to run shp2pgsql which I was able to do successfully in osx snow leopard 10.6.8 before I upgraded to osx...
View ArticleHow to export figure like Post In Action demonstrate?
I am reading the book “PostGIS In Action” and now I follow the listing 2.4 here SELECT AddGeometryColumn ('public','my_geometries', 'my_circular_strings',-1,'CIRCULARSTRING',2); INSERT INTO...
View Article