Does changing a Postgresql table's tablespace compact it like “vacuum full”...
I need to reclaim disk space in a table in a Postgresql 9.3.2 database to be used for other tables. The standard suggestions to accomplish this are: “VACUUM FULL” or “CLUSTER” or copy the contents into...
View ArticleWhat are the problems of loading overlapping (or the same) tifs into postgis?
I am still early on the Postgis learning curve. I have an existing table in Postgres – it looks like this: create table "public"."mytable" ( "rid" serial primary key, "rast" raster, "filename" text); I...
View ArticleHow can I avoid breaking Postgres sync replication when building a large index?
We have pairs of Postgres 9.2 servers using synchronous replication. Sometimes rebuilding an index on a large table will break replication due to WAL segments not being kept around long enough. We are...
View ArticleHow to create a temporary table using VALUES in PostgreSQL
I am learning PostgreSQL and trying to figure out how to create a temporary table or a WITH declaration that can be used in place of regular table, for debugging purposes. I looked at the documentation...
View ArticlePossible to get log file with only statements sent to Postgres from my app...
I’m using an ORM in my app and would like to see all statements sent to Postgres so that I can figure out exactly what the ORM is doing. In the Postgres config file I added log_statement = 'all' to get...
View ArticleWhat should be the ideal network configuration for a Postgresql Streanming...
I have the following configuration using Pgpool, Postgresql with streaming replication. Pgpool is used for load balancing and automatic failover. .-----. .--------. | | W | DB | | PGP...
View ArticleDoes Postgres shutdown gracefully when I restart my Mac?
When I restart my Mac OS X computer, I assume the daemon controlling Postgres (the “Postmaster” as I recall) is notified by the OS and performs a graceful shutdown of any running databases with buffers...
View ArticlePostgreSQL roles versus users, grant permissions
I’m currently learning the differences between PostgreSQL and MySQL as I’ve got a new project and I also intend to migrate my existing software from MySQL to PostgreSQL. I’ve actually started creating...
View ArticleQGIS isn't displaying dates in the attribute table
I have a QGIS project that links to data in a Postgres database. For some reason, QGIS is not displaying any data in date fields. The date fields appear to be fine in Postgres and I have performed...
View ArticleST_MakePoint or ST_PointFromText to generate points
I’m new to postGIS and am having trouble finding an answer to this question. I have loaded UK postcode data (OSGB36, SRID 27700 with eastings and northings fields) into a postGIS database. I now want...
View ArticleMoving Local PostgreSQL 8.4.20 Database to Amazon EC2 or RDS
I’m running PostgresSQL 8.4.20 on a local server and plan to migrate the data to either Amazon EC2 or RDS. I have working knowledge of databases and need advice from experts. I’ve been researching this...
View ArticleGetting PAM-compatible password hashes from pgcrypto
I want to keep user records in Postgres database and faced one issue which block me. It is password encryption. For example, this is correcetly encrypted password 12345 via default Ubuntu crypt...
View ArticleRestoring a database using Postgres data files instead of .sql files
I backed up my Ubuntu 14.04 system using rsync to a USB stick, but apparently it wasn’t formatted for booting. The original disk has been erased and I put a fresh install of Ubuntu on it. In migrating...
View Article“Wrong affix file formate for flag” while loading dictionaries from...
Trying to get good TEXT SEARCH results out of PostgreSQL in English, German and Dutch made that I downloaded proofing tools of LibreOffice (tried of version 4.3 and 3.3) and iSpell. I placed the files...
View ArticleOptimizing query – understanding explain
I’ve got a query (partly generated by django orm, but can be modified). For some reason, It’s very slow (between 1.5 -3 seconds, without having lots of data on the system) . I’ve got an “explain” from...
View ArticleIs it possible to create materialized view based on another materialized view...
I have a very large table and I summarize it in a materialized view. I then create an even smaller materialized view based on the earlier mview. The second mv is always showing zero rows. Is there a...
View ArticleIs it safe to use set-returning sql functions instead of security-barrier views?
Since 9.2, it’s been possible to use the security_barrier attribute to guard against maliciously-chosen functions and operators accessing data ‘hidden’ behind filters in views (full info in the...
View ArticleNodeJS, Sequelize and a local PostgreSQL database
We’re working with PostgreSQL, Sequelize JS and Node for quite some time now. We’ve created a way of creating tables with Sequelize, so it’s more bug proof than editing the database structure directly...
View ArticleUsing EXCEPTION to ignore duplicates during bulk inserts
In pq 9.3.5, I’m importing records from an external source where duplicates are VERY rare, but they do happen. Given a readings table with a unique compound key on (real_time_device_id, recorded_at),...
View Articleexport data to xml by the use of query to xml then importing it using xpath
i have use QUERY_TO_XML function in order to export data to xml , after that i want to export this data. this data might contain reserved chars in the xml tags like “‘ & …” ex electrical ‘...
View Article