Re: [GENERAL] Why does autovacuum clean fewer rows than I expect?

2014-07-03 Thread Michael Paquier
On Fri, Jul 4, 2014 at 7:41 AM, Nick Cabatoff nick.cabat...@gmail.com wrote: 8.4.9. This has been released in 2011, so you are missing 3 years worth of bug fixes. It may be a good idea to first update to 8.4.21 before trying to work more on that (consider as well an upgrade as 8.4 will be EOL

Re: [GENERAL] How can I replace the year of the created_at column with the current year dynamically ?

2014-07-02 Thread Michael Paquier
On Wed, Jul 2, 2014 at 3:27 PM, Arup Rakshit arupraks...@rocketmail.com wrote: Here is my try : staging::= select to_char(created_at,'DD/MM') || '/' || to_char(now(),'') as when from users; when 24/02/2014 28/02/2014 02/03/2014 01/03/2014 04/03/2014

Re: [GENERAL] [ADMIN] [pgadmin-support] Best backup strategy for production systems

2014-06-30 Thread Michael Paquier
Please avoid top-posting... On Mon, Jun 30, 2014 at 7:24 PM, Oliver ofab...@gmail.com wrote: Ok, thanks. I mean by original wal segments to files generated in pg_xlog, yes. I have to 0 the parameter wal_keep_segments. They are being generated with 16MB of size and they are being rotated.

Re: [GENERAL] lock contention, need profiling idea

2014-06-30 Thread Michael Paquier
On Tue, Jul 1, 2014 at 7:36 AM, AI Rumman rumman...@gmail.com wrote: I see lots of similar log message at a certain time in a day on Postgresql 9,.1: LOG: process 18855 still waiting for ShareLock on transaction 2856146023 after 1001.209 ms STATEMENT: UPDATE table1 SET time = $1 WHERE id

Re: [GENERAL] [pgadmin-support] Best backup strategy for production systems

2014-06-29 Thread Michael Paquier
On Fri, Jun 27, 2014 at 9:55 PM, Oliver ofab...@gmail.com wrote: Thank you very much for your reply. I've spoken with my boss, databases aren't so important, so if there is a little of data lost, there isn't problem .. so I'm configuring this with continuous archiving and base backups. If you

Re: [GENERAL] Can't start postgresql server

2014-06-24 Thread Michael Paquier
On Wed, Jun 25, 2014 at 5:37 AM, ChoonSoo Park luisp...@gmail.com wrote: 30022 30023 are symbolic links under data/pg_tblspc folder. Their target directories are lost somehow. Does it cause this problem? I tried to delete those 2 symbolic links but postgresql still can't start up. Just

Re: [GENERAL] How can I get first day date of the previous month?

2014-06-21 Thread Michael Paquier
On Sat, Jun 21, 2014 at 12:54 PM, Arup Rakshit arupraks...@rocketmail.com wrote: One suggestion I need from you. Would it be a good to start straight from doco, or should I start from a book ? It depends on what you are looking for and what you want to learn, but personally, as the documentation

Re: [GENERAL] How can I get first day date of the previous month ?

2014-06-20 Thread Michael Paquier
On Fri, Jun 20, 2014 at 3:42 PM, Arup Rakshit arupraks...@rocketmail.com wrote: How can I get first day date of the previous month. Last day of previous month can be found using the answer - http://stackoverflow.com/a/8945281/2767755 Here is how to get the first day date of the previous month:

Re: [GENERAL] Creating Table Copy

2014-06-16 Thread Michael Paquier
On Tue, Jun 17, 2014 at 5:51 AM, Rich Shepard rshep...@appl-ecosys.com wrote: I have a table with some NULL values in a date column. I need to make a copy of that table containing only those rows where the date column is not null. Reading the CREATE TABLE man page I've tried to create a copy

Re: [GENERAL] what does pg_activity mean when the database is stuck?

2014-06-12 Thread Michael Paquier
On Thu, Jun 12, 2014 at 11:44 AM, Si Chen sic...@opensourcestrategies.com wrote: Is there a way to configure postgresql to automatically release connections that have been idle for a set amount of time? Not directly. However with 9.3 you could use a background worker like this one:

Re: [GENERAL] what does pg_activity mean when the database is stuck?

2014-06-12 Thread Michael Paquier
On Thu, Jun 12, 2014 at 6:34 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Jun 12, 2014 at 11:44 AM, Si Chen sic...@opensourcestrategies.com wrote: Is there a way to configure postgresql to automatically release connections that have been idle for a set amount of time

Re: [GENERAL] Accessing structured datatypes using libpq

2014-06-11 Thread Michael Paquier
On Wed, Jun 11, 2014 at 6:59 PM, Raimo Jormakka raimo.jorma...@gmail.com wrote: 2014-06-11 9:44 GMT+03:00 John R Pierce pie...@hogranch.com: On 6/10/2014 11:20 PM, Raimo Jormakka wrote: What is the recommended way of accessing structured data-types (especially JSONB and HSTORE) using libpq?

Re: [GENERAL] PosgtresSQL master-slave synchronous replication to multiple slaves

2014-05-31 Thread Michael Paquier
On Sat, May 31, 2014 at 5:30 PM, Vlad Mihalcea mihalcea.v...@gmail.com wrote: If you run a large enterprise system in a master-slave replication scheme on top of PostgreSQL, what options do I have for enabling multiple synchronous slaves? As of now, none. Only a single synchronous slave is

Re: [GENERAL] materialised views vs unlogged table (also, ize vs ise)

2014-05-18 Thread Michael Paquier
On Mon, May 19, 2014 at 6:47 AM, Tim Kane tim.k...@gmail.com wrote: Aside from the convenience of the REFRESH functionality, are there any other factors I should consider? An exclusive lock is taken on the materialized view during a REFRESH operation, blocking an read or write queries attempted

Re: [GENERAL] How to fix lost synchronization with server

2014-05-08 Thread Michael Paquier
On Fri, May 9, 2014 at 2:37 AM, Andrus kobrule...@hot.ee wrote: Where to get this fix in binary form for Windows 32-bit ? Here, but you will need to wait until 9.3.5 is out: http://www.postgresql.org/download/windows/. If you are in a hurry, you can still compile manually pg_dump and deploy it

[GENERAL] Building Postgres using mingw

2014-05-07 Thread Michael Paquier
Hi all, Following some instructions on the wiki and the docs, I am trying to compile the code using minwg: https://wiki.postgresql.org/wiki/Building_With_MinGW http://www.postgresql.org/docs/devel/static/installation-platform-notes.html#INSTALLATION-NOTES-MINGW After installing mingw-w64 and

Re: [GENERAL] Building Postgres using mingw

2014-05-07 Thread Michael Paquier
On Wed, May 7, 2014 at 10:26 AM, Jeff Janes jeff.ja...@gmail.com wrote: On Wed, May 7, 2014 at 8:27 AM, Michael Paquier michael.paqu...@gmail.com wrote: Hi all, Following some instructions on the wiki and the docs, I am trying to compile the code using minwg: https://wiki.postgresql.org

Re: [GENERAL] WAL Replication + PITR

2014-04-30 Thread Michael Paquier
On Tue, Apr 29, 2014 at 5:44 PM, basti ba...@unix-solution.de wrote: is it possible to have WAL Replication and Point-in-Time Recovery like follows: DB-Master -- (WAL to Slave) -- DB-Slave | |--- (PITR to an other Server) Yes. Be sure to take periodic base backups of the master

Re: [GENERAL] importing a messy text file

2014-04-30 Thread Michael Paquier
On Thu, May 1, 2014 at 1:30 AM, bricklen brick...@gmail.com wrote: On Wed, Apr 30, 2014 at 1:07 AM, Willy-Bas Loos willy...@gmail.com wrote: Hi, I have a 56GB textfile that i want to import into postgres. The file is tab delimited and not quoted. Would Pgloader be an option?

Re: [GENERAL] WAL archiving from a standby backup strategy Postgresql 9.3

2014-04-24 Thread Michael Paquier
On Thu, Apr 24, 2014 at 7:44 AM, Sergey Konoplev gray...@gmail.com wrote: On Wed, Apr 23, 2014 at 10:26 AM, Kal Black kalob...@gmail.com wrote: I am trying to figure out if wal archiving from a standby is possible and a viable option for a backup strategy on Postgresql 9.3. The idea is to be

Re: [GENERAL] Make basebackup use low level API and rsync

2014-04-22 Thread Michael Paquier
On Tue, Apr 22, 2014 at 1:28 PM, wd w...@wdicc.com wrote: I'v try to make a base backup use pg_start_backup, pg_stop_backup and rsync, but failed. After run select pg_start_backup('label') on db server, I run rsync on backup server, and got some errors like 'file has vanished: ', think

Re: [GENERAL] pg_stat_replication.state: streaming/catchup

2014-04-21 Thread Michael Paquier
On Mon, Apr 21, 2014 at 8:03 PM, Torsten Förtsch torsten.foert...@gmx.netwrote: Hi, just out of curiosity, what's the difference between streaming and catchup state in pg_stat_replication. According to the documentation this field is Current WAL sender state. But that does not tell me

Re: [GENERAL] pg_stat_replication.state: streaming/catchup

2014-04-21 Thread Michael Paquier
On Mon, Apr 21, 2014 at 8:34 PM, Torsten Förtsch torsten.foert...@gmx.netwrote: On 21/04/14 13:18, Michael Paquier wrote: s there a difference in the protocol used in those phases? Maybe the catchup phase is optimized for bulk throughput? There is no difference AFAIK, the same replication

Re: [GENERAL] shared memory allocation - C function

2014-04-16 Thread Michael Paquier
On Thu, Apr 17, 2014 at 8:04 AM, Alan Nilsson anils...@apple.com wrote: Is it possible to allocate a small chunk of shared memory outside of any pools(i.e. manually alloced de-alloced) that is visible to all processes? I would like a small amount to store a mutex and a condition variable

Re: [GENERAL] streaming replication and recovery

2014-04-14 Thread Michael Paquier
On Sat, Apr 12, 2014 at 3:12 PM, Anupama Ramaswamy anumr_0...@yahoo.com wrote: Lets suppose at this point there is 0 delivery lag but bytes of replay lag. All your answers are here: http://www.postgresql.org/docs/devel/static/warm-standby.html Standby mode is exited and the server switches

Re: [GENERAL] import .sql file into PostgreSQL database

2014-04-09 Thread Michael Paquier
On Thu, Apr 10, 2014 at 1:02 AM, Raymond O'Donnell r...@iol.ie wrote: I think that message is coming from the OS; messages from Postgres are usual more specific, for example, Permission denied for relation. It looks as if you haven't the OS permissions to read the SQL file. On Windows,

Re: [GENERAL] How do you find the row count for all your tables in Postgres?

2014-04-07 Thread Michael Paquier
On Mon, Apr 7, 2014 at 6:46 PM, Nithya Soman nit...@quintetsolutions.com wrote: How can we find the total row count for all db tables in psql version 7.4.3 ?? Are you aware that 7.4 is EOL for 5 years? 7.4.3 is missing as well at least 4 years of bug fixes in its stable branch. The query

Re: [GENERAL] import .sql file into PostgreSQL database

2014-04-07 Thread Michael Paquier
On Tue, Apr 8, 2014 at 12:33 PM, Gaurav Jindal gaur...@gmail.com wrote: How to import the .sql file using PSQL or PgAdmin? Can anyone guide me with details and step by step instructions. I tried \i filename.sql command but permission denied. I don't know how to make it work. Can anyone helps

Re: [GENERAL] is there a way to dump the version of extensions

2014-03-28 Thread Michael Paquier
On Thu, Mar 27, 2014 at 7:11 PM, Manuel Kniep man...@adjust.com wrote: Hi, when doing a pg_dump on postgres 9.2 the resulting sql file only has CREATE EXTENSION extension_name; I would like to include the specific version of the extension to make sure that the correct version is

Re: [GENERAL] Trimming transaction logs after extended WAL archive failures

2014-03-27 Thread Michael Paquier
On Thu, Mar 27, 2014 at 1:42 AM, Steven Schlansker ste...@likeness.com wrote: On Mar 25, 2014, at 7:58 PM, Adrian Klaver adrian.kla...@aklaver.com wrote: On 03/25/2014 04:52 PM, Steven Schlansker wrote: Some more questions, what happens when things begin to dawn on me:) You said the disk

Re: [GENERAL] Backup WAL Replication Server

2014-03-20 Thread Michael Paquier
On Thu, Mar 20, 2014 at 9:48 PM, basti mailingl...@unix-solution.de wrote: at the moment we use a Postgres Server as Master and one as Hot-Standby. The Database is around 50GB and will massive grow next time. Backup and Restore with pg_dump take several hours, is there a faster way to do

Re: [GENERAL] Alter column with views depended on it without drop views

2014-03-19 Thread Michael Paquier
On Wed, Mar 19, 2014 at 11:27 PM, Emi Lu em...@encs.concordia.ca wrote: Is there a way to change a table column from varchar(n) to varchar with views depended on it. Nope. You cannot update the data type of a table column if it is used by a view. =# create table aa (a varchar(4)); CREATE TABLE

Re: [GENERAL] High Level Committers Wanted

2014-03-19 Thread Michael Paquier
On Wed, Mar 19, 2014 at 11:15 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Andy Colson escribió: I dunno. I'm new at conspiracy theories :-). I hoped, by some stretch, Oracle was feeling the heat of competition from PG ... and decided to solve the problem. See? If Oracle decided to

Re: [GENERAL] pg_worker and notify

2014-03-16 Thread Michael Paquier
On Sat, Mar 15, 2014 at 11:39 PM, Olivier Chaussavoine olivier.chaussavo...@gmail.com wrote: Applications using postgres frequently require central process serializing specific tasks. We usually implement these with external programs but the reliability of such solution depends on a complexity

Re: [GENERAL] There is bug in PCS 0.9.26: configure pacemaker resource agent for PG stream replication

2014-03-07 Thread Michael Paquier
On Fri, Mar 7, 2014 at 3:32 PM, leo dazhou...@gmail.com wrote: I just complete my HA configuration on Redhat 6.4 enterprise: Clusterware: Pacemaker 1.1.8 ( CMAN .0.12.1, corosync 1.4.1 ) Resource manager: PCS 0.9.26 PostgreSQL 9.3.3.1 Detailed configuration

Re: [GENERAL] How to recovery failed master after failover

2014-03-04 Thread Michael Paquier
On Tue, Mar 4, 2014 at 6:26 PM, leo dazhou...@gmail.com wrote: I wonder how to quickly recovery failed master? If I directly startup the failed master as slave ( assign proper parameter), is there any problem? Yep, if the master has got ahead of the slave in term of WAL replay where WAL forked

Re: [GENERAL] pgrestore command

2014-03-01 Thread Michael Paquier
On Sat, Mar 1, 2014 at 3:23 AM, John R Pierce pie...@hogranch.com wrote: On 2/28/2014 5:06 AM, Michael Paquier wrote: You could expect a loss of 20% at I/O level by using a virtualized environment compared to a physical server with similar hardware (rule of thumb, number more or less general

Re: [GENERAL] pgrestore command

2014-02-28 Thread Michael Paquier
On Fri, Feb 28, 2014 at 4:41 PM, Arun P.L aru...@hotmail.com wrote: Hi Is there any chances for any performance issues with pg_restore when changing the servers, like openvz, xen, etc.? You could expect a loss of 20% at I/O level by using a virtualized environment compared to a physical server

Re: [GENERAL] How to continue streaming replication after this error?

2014-02-23 Thread Michael Paquier
On Mon, Feb 24, 2014 at 12:23 PM, Torsten Förtsch torsten.foert...@gmx.netwrote: On 22/02/14 03:21, Torsten Förtsch wrote: Any idea what that means? Updating the replica to 9.3.3 cured it. The master was already on 9.3.3. 9.3.3 has introduced some new configuration parameters. So you need

Re: [GENERAL] Xlogdump compiling error : undefined reference to `ber_sockbuf_io_udp'

2014-02-13 Thread Michael Paquier
On Fri, Feb 14, 2014 at 3:14 PM, Adarsh Sharma eddy.ada...@gmail.com wrote: Yes. Able to retrieve table names now. I am reviewing the xlogdump output. Is dere any way where i can understand what is the meaning of these keywords in it. [root@1002 tmp]# xlogdump pg_xlog/* fullanalysis.txt

Re: [GENERAL] Xlogdump compiling error : undefined reference to `ber_sockbuf_io_udp'

2014-02-12 Thread Michael Paquier
On Wed, Feb 12, 2014 at 5:19 PM, Adarsh Sharma eddy.ada...@gmail.com wrote: Below link is little helpful :- http://michael.otacoo.com/postgresql-2/postgres-9-3-feature-highlight-pg_xlogdump/ Postgres core includes pg_xlogdump since 9.3 and not xlogdump. As their outputs are a bit different you

Re: [GENERAL] WAL archive on slave

2014-02-09 Thread Michael Paquier
On Mon, Feb 10, 2014 at 9:43 AM, James Sewell james.sew...@lisasoft.comwrote: Hi again, I just realised I asked this question around a year ago (for a different reason actually) and you answered me then! Amazing! Your answer then was: It works fine, only the server will not generate WAL

Re: [GENERAL] Better Connection Statistics

2014-02-09 Thread Michael Paquier
On Sun, Feb 9, 2014 at 4:52 AM, Greg Sabino Mullane g...@turnstep.com wrote: For instance, I want the number of transactions a specific connection has submitted. The number of queries. Total amount of CPU time consumed, etc. So far as I know, there is no module, statistic, or view that

Re: [GENERAL] pg_basebackup on standby node failed

2014-02-03 Thread Michael Paquier
On Tue, Feb 4, 2014 at 5:51 AM, Ying He yinghe0...@yahoo.com wrote: When I do: pg_basebackup -D /backupDir I am getting: pg_basebackup: directory /usr/local/pgsql/data/pg_tblspc/tablespace1 exists but is not empty tablespace1 is a tablespace created by CREATE TABLESPACE and

Re: [GENERAL] Fwd: lots of errors from fmgr.h when I try to write a C UDF

2014-02-01 Thread Michael Paquier
On Sat, Feb 1, 2014 at 1:34 PM, Anh Pham atpham@gmail.com wrote: Hi, I actually included 'postgres.h' However I found out that when I stopped the server, the code then compiled successfully. Code compilation and a server status are not related as compilation of Postgres-related modules

Re: [GENERAL] Postgresql multidimensional arrays cast fail

2014-02-01 Thread Michael Paquier
On Sat, Feb 1, 2014 at 6:45 PM, alexandros_e alexandros...@gmail.com wrote: I do: SELECT '{{1,2},{3,4}}'::INTEGER[][] But I get: {{1,2},{3,4}} INTEGER[]. Somehow the PostgreSQL server does not understand that is a multidimensional array. So, later if I want to get {1,2} or {3,4}, the

Re: [GENERAL] pg_basebackup on standby node failed

2014-01-31 Thread Michael Paquier
On Sat, Feb 1, 2014 at 7:07 AM, Ying He yinghe0...@yahoo.com wrote: hi, All, I intend to do a basebackup on a hot standby node. I followed the instructions on http://www.postgresql.org/docs/9.2/static/app-pgbasebackup.html to turn full_page_writes on at master and other settings on standby.

Re: [GENERAL] Reindexing and tablespaces

2014-01-30 Thread Michael Paquier
On Fri, Jan 31, 2014 at 1:24 PM, alexandros_e alexandros...@gmail.com wrote: Hello to all, I have done ALTER DATABASE [database_name] SET default_tablespace = [new_tablespace]; I am wondering, if I reindex this entire DB would the indexes automatically moved into the [new_tablespace] or will

Re: [GENERAL] Composite type

2014-01-27 Thread Michael Paquier
On Mon, Jan 27, 2014 at 2:02 AM, antono124 g.antonopoulos...@gmail.com wrote: Lets say that we have 2 tables. Create Table table1 Of type1 Create Table table2 Of type2 I want to refer the first table in the second. I want to reference the whole table not only one field, so something like

Re: [GENERAL] Fully-automatic streaming replication failover when master dies?

2014-01-26 Thread Michael Paquier
On Mon, Jan 27, 2014 at 12:10 PM, Sameer Kumar sameer.ku...@ashnik.comwrote: Dmitry Koterov wrote: PostgreSQL supports synchronous multi-master, MongoDB supports write concern, but this causes a performance penalty). Anyways I doubt that PostgreSQL supports synchronous multi-master

Re: [GENERAL] Fully-automatic streaming replication failover when master dies?

2014-01-26 Thread Michael Paquier
On Mon, Jan 27, 2014 at 12:35 PM, Sameer Kumar sameer.ku...@ashnik.comwrote: On Mon, Jan 27, 2014 at 11:24 AM, Michael Paquier michael.paqu...@gmail.com wrote: PostgreSQL supports synchronous multi-master, MongoDB supports write concern, but this causes a performance penalty). Anyways I

Re: [GENERAL] pg_dump: dumpBlobs(): could not open large object: ERROR: large object 27729547 does not exist

2014-01-25 Thread Michael Paquier
On Fri, Jan 24, 2014 at 10:33 PM, Manoj Agarwal m...@ockham.be wrote: Hi, I have a Postgresql-7.4.19 database in SQL_ASCII Encoding format. You should really consider an upgrade first... As mentioned by Kevin this version is outdated. The latest versions of pg_dump support servers down to

Re: [GENERAL] Correct query to check streaming replication lag

2014-01-20 Thread Michael Paquier
On Tue, Jan 21, 2014 at 12:41 PM, Sameer Kumar sameer.ku...@ashnik.comwrote: On Mon, Jan 20, 2014 at 1:53 PM, Granthana Biswas granth...@zedo.comwrote: Yes we already do that. Count the number of ready wal files. I guess a better place to check would be pg_stat_replication Check this

Re: [GENERAL] Correct query to check streaming replication lag

2014-01-20 Thread Michael Paquier
On Tue, Jan 21, 2014 at 1:30 PM, Sameer Kumar sameer.ku...@ashnik.comwrote: On Tue, Jan 21, 2014 at 12:12 PM, Michael Paquier michael.paqu...@gmail.com wrote: Mind you, here is a simple suggestion: SELECT application_name, pg_xlog_location_diff(sent_location, flush_location

Re: [GENERAL] Correct query to check streaming replication lag

2014-01-20 Thread Michael Paquier
On Tue, Jan 21, 2014 at 2:33 PM, Sameer Kumar sameer.ku...@ashnik.com wrote: We are already using the following query: SELECT CASE WHEN pg_last_xlog_receive_location( ) = pg_last_xlog_replay_location() THEN 0 ELSE EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp()) END AS

Re: [GENERAL] pg_basebackup failing

2014-01-15 Thread Michael Paquier
On Wed, Jan 15, 2014 at 8:05 PM, Sameer Kumar sameer.ku...@ashnik.comwrote: The error you are seeing is triggered because this relation file exceeds MAX_TAR_MEMBER_FILELEN or 8GB for a single tar member, which is as well the norm for tar. I thought PostgreSQL would break the file if it

Re: [GENERAL] non-zero xmax yet visible

2014-01-14 Thread Michael Paquier
On Wed, Jan 15, 2014 at 1:26 AM, Ming Li mli89...@gmail.com wrote: I'm a little bit confused by the meaning of xmax. The documentation at http://www.postgresql.org/docs/current/static/ddl-system-columns.html says xmax The identity (transaction ID) of the deleting transaction, or zero for

Re: [GENERAL] pg_basebackup failing

2014-01-14 Thread Michael Paquier
On Wed, Jan 15, 2014 at 6:53 AM, Alan Nilsson anils...@apple.com wrote: Could someone give me some insight to the following error message: [mqsql06:/Volumes/SQL_Set] _postgres% pg_basebackup --user=replicate --host=mqsql03 -xP -Fp --pgdata=pgsql 19439890/65873894 kB (29%), 1/1 tablespace

Re: [GENERAL] question about checksum in 9.3

2014-01-13 Thread Michael Paquier
On Tue, Jan 14, 2014 at 1:50 AM, Mike Broers mbro...@gmail.com wrote: Hello, I am in the process of planning a 9.3 migration of postgres and I am curious about the checksum features available. In my test 9.3 instance it seemed like this feature provides a log entry of the exact database/oid of

Re: [GENERAL] wal archive peak during pg_dump

2014-01-09 Thread Michael Paquier
On Thu, Jan 9, 2014 at 7:42 PM, Willy-Bas Loos willy...@gmail.com wrote: Hi, I've set up hot standby slaves for a couple of clusters. The wal is cleaned up after use, i don't use it as a backup (yet). It seems that the amount of wal peaks shortly after midnight, when pg_dump is running. It

Re: [GENERAL] AutoVacuum Daemon

2014-01-07 Thread Michael Paquier
On Mon, Dec 30, 2013 at 11:02 PM, Leonardo M. Ramé l.r...@griensu.com wrote: On 2013-12-30 13:45:43 +, Haribabu kommi wrote: On 30 December 2013 19:11 Leonardo M. Ramé wrote: Hi, I want know if I should run the auto-vacuum daemon (from /etc/init.d/) or it runs automatically and

Re: [GENERAL] question on parallelism

2014-01-07 Thread Michael Paquier
On Thu, Jan 2, 2014 at 2:29 PM, Chris Travers chris.trav...@gmail.com wrote: On Wed, Jan 1, 2014 at 7:35 PM, Andrew McIntyre amcint...@m-m.com wrote: does postgres have this capability? specifically local intrapartition?

Re: [GENERAL] Do I have to free storage in a UDF if I raise an error?

2014-01-07 Thread Michael Paquier
On Tue, Jan 7, 2014 at 12:46 AM, Stephen Woodbridge wood...@swoodbridge.com wrote: On 1/6/2014 10:00 AM, Pfuntner, John wrote: If I've done a palloc() to get storage inside a user-defined function and raise an error using ereport(), should I be using pfree() to release the storage before the

Re: [GENERAL] Dynamic SQL - transition from ms to pg

2014-01-05 Thread Michael Paquier
On Mon, Jan 6, 2014 at 2:13 PM, Erik Darling edarlin...@gmail.com wrote: Hi, I've been developing for MS SQL around four years. I'm starting out with some work in Postgresql next week, and I'd like to know if there's any equivalent way to do something like this (from my word press)

Re: [GENERAL] pg_dump dumps EVENT TRIGGER owned by extension

2013-12-31 Thread Michael Paquier
On Tue, Dec 31, 2013 at 5:33 AM, Moshe Jacobson mo...@neadwerx.com wrote: On Mon, Dec 30, 2013 at 2:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I've committed fixes for these Will these fixes appear in 9.3.3? Yes. -- Michael -- Sent via pgsql-general mailing list

Re: [GENERAL] Do all Postgres queries touch Shared_Buffers at some point?

2013-12-29 Thread Michael Paquier
On Sun, Dec 29, 2013 at 9:05 PM, Shiv Sharma shiv.sharma.1...@gmail.com wrote: I am puzzled about the extent to which shared_bufferes is used for different queries. Do _all_ queries touch shared buffers at some point of their execution? Many of our warehouse queries are seq_scan followed by

Re: [GENERAL] Multi Master Replication

2013-12-19 Thread Michael Paquier
On Thu, Dec 19, 2013 at 11:18 PM, Chris Travers chris.trav...@gmail.com wrote: On Thu, Dec 19, 2013 at 6:52 AM, Wolfgang Keller felip...@gmx.net wrote: 2. With sync replication, you have coordination problems and therefore it is never (at least IME) a win compared to master-slave

Re: [GENERAL] Multi Master Replication

2013-12-19 Thread Michael Paquier
On Fri, Dec 20, 2013 at 8:48 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Dec 19, 2013 at 11:18 PM, Chris Travers chris.trav...@gmail.com wrote: On Thu, Dec 19, 2013 at 6:52 AM, Wolfgang Keller felip...@gmx.net wrote: 2. With sync replication, you have coordination

Re: [GENERAL] Is it advisable to pg_upgrade directly from 9.0 to 9.3?

2013-12-19 Thread Michael Paquier
On Thu, Dec 19, 2013 at 10:07 PM, Laurentius Purba lpu...@sproutloud.com wrote: Hi Greg, I just wanted to know if you were able successfully upgrading from 9.0 to 9.3. I have been doing this upgrading this past week, but always ended up with unsuccessful upgrade. It will be great if you

Re: [GENERAL] Best way to sync possibly corrupted data?

2013-12-19 Thread Michael Paquier
On Fri, Dec 20, 2013 at 5:28 AM, Anand Kumar, Karthik karthik.anandku...@classmates.com wrote: HI, We have an issue with possibly corrupt data in our postgresql server. Errors like: ERROR: index photos_p00_n2 contains unexpected zero page at block 0 ERROR: invalid page header in block

Re: [GENERAL] Multi Master Replication

2013-12-18 Thread Michael Paquier
On Thu, Dec 19, 2013 at 7:12 AM, Scott Marlowe scott.marl...@gmail.com wrote: On Wed, Dec 18, 2013 at 1:16 PM, John R Pierce pie...@hogranch.com wrote: that sort of replication is very problematic. its virtually impossible to maintain ACID (Atomicity, Consistency, Isolation, Durability) and

Re: [GENERAL] Multi Master Replication

2013-12-18 Thread Michael Paquier
On Thu, Dec 19, 2013 at 2:05 PM, Scott Marlowe scott.marl...@gmail.com wrote: Sharding with plproxy is pretty easy and can scale hugely. Yeah indeed, the writable postgres_fdw could also be used as a solution, if designed carefully. -- Michael -- Sent via pgsql-general mailing list

Re: [GENERAL] validate synatax

2013-12-11 Thread Michael Paquier
On Wed, Dec 11, 2013 at 9:11 PM, Szymon Guz mabew...@gmail.com wrote: This would simply be as complicated as the database itself, and I'm sure that if I had to implement such a validator, I would just finish with embedding the query in a transaction rolled back at the end, and run it on some

Re: [GENERAL] build from source with MSVC

2013-12-11 Thread Michael Paquier
On Wed, Dec 11, 2013 at 7:20 PM, Philipp Kraus philipp.kr...@tu-clausthal.de wrote: I must build the pg library from sources under MSVC 2010 and later 2012. Under OSX Linux I call the configure / make tools and I can build the lib well, but is there a project structure for building under

Re: postgresql.org inconsistent (Re: [GENERAL] PG replication across DataCenters)

2013-12-11 Thread Michael Paquier
On Thu, Dec 12, 2013 at 3:19 AM, Wolfgang Keller felip...@gmx.net wrote: postgresql-xc is not postgresql, its a fork. It would at least merit being mentioned in the doc, just like other forks or whatever you may call it, as long as they're open-source. You seem to not realize how many

Re: [Postgres-xc-general] [GENERAL] Tuple not found error during Index creation

2013-12-10 Thread Michael Paquier
On Tue, Dec 10, 2013 at 11:00 PM, Mason Sharp msh...@translattice.com wrote: In our StormDB fork (now TransLattice Storm) I made some changes to address some issues that were uncovered with XC. I am not sure if it will address this specific issue above, but in most cases we make it an error

Re: [Postgres-xc-general] [GENERAL] Tuple not found error during Index creation

2013-12-10 Thread Michael Paquier
On Wed, Dec 11, 2013 at 1:17 PM, Sandeep Gupta gupta.sand...@gmail.com wrote: Hi Michael, I can provide the table schema and the data over which indexing almost always fails with tuple not found error. Would this be of help. The other issue is that file is 3.2GB so we would have work some

Re: [Postgres-xc-general] [GENERAL] Tuple not found error during Index creation

2013-12-09 Thread Michael Paquier
On Tue, Dec 10, 2013 at 7:17 AM, Sandeep Gupta gupta.sand...@gmail.com wrote: We are trying to trace cause and potential solution of tuple not found error with postgres-xc. The problem happens when indexing a large file. It seems the autovaccum locks certain cache pages that the indexer tries

Re: [GENERAL] Replication: GZIP compression in WAL sender/receiver processes communication?

2013-12-09 Thread Michael Paquier
On Tue, Dec 10, 2013 at 8:13 AM, Dmitry Koterov dmi...@koterov.ru wrote: Hello. Is there a way to compress the traffic between master and slave during the replication?.. The streaming gzip would be quite efficient for that. (WAL archiving is not too good for this purpose because of high lag.

Re: [GENERAL] [HACKERS] [pgrpm-HACKERS]SPEC file for PostgreSQL

2013-12-06 Thread Michael Paquier
That On Fri, Dec 6, 2013 at 7:08 PM, Sameer Kumar sameer.ku...@ashnik.comwrote: Hi, I am trying to do a custom build (and generate binary and source RPM) package for PostgreSQL. I know community already has a RPM package, but I am trying to do a custom build. I am using attached SPEC

Re: [GENERAL] Fwd: row_to_json() with numerical indices in stead of associative indices

2013-11-30 Thread Michael Paquier
On Sat, Nov 30, 2013 at 11:48 PM, Tjibbe tji...@rijpma.org wrote: Hello there, Is it possible to add an parameter for the function row_to_json()? So you can choose for: numerical indices: [1, true, string, null] associative indices: [f1:1,f2: true, f3:string,f4: null] The this extra

Re: [GENERAL] PG replication across DataCenters

2013-11-23 Thread Michael Paquier
On Fri, Nov 22, 2013 at 11:46 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: Michael Paquier wrote: On Fri, Nov 22, 2013 at 10:03 PM, Kaushal Shriyan kaushalshri...@gmail.com wrote: I am not sure i understand the difference between async and sync replication and on what scenarios i should

Re: [GENERAL] shared_buffers and temp_buffers why manual and code are different?

2013-11-23 Thread Michael Paquier
On Sat, Nov 23, 2013 at 4:30 PM, Tianyin Xu t...@cs.ucsd.edu wrote: Hi, I want to tune the memory usage of PG (9.3.1) on my environment. I'm really confused by the following two configuration parameters, shared_buffers, temp_buffers, Take shared_buffers as the example, the manual says,

Re: [GENERAL] PG replication across DataCenters

2013-11-22 Thread Michael Paquier
On Fri, Nov 22, 2013 at 10:03 PM, Kaushal Shriyan kaushalshri...@gmail.com wrote: I am not sure i understand the difference between async and sync replication and on what scenarios i should use async or sync replication. Does it mean if it is within same DC then sync replication is the best and

Re: [GENERAL] PG replication across DataCenters

2013-11-22 Thread Michael Paquier
On Fri, Nov 22, 2013 at 9:44 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: Torsten Förtsch wrote: Don't use synchronous replication if you have a high transaction rate and a noticable network latency between the sites. Wait for the next bugfix release, since a nasty bug has just been

Re: [GENERAL] Postgres as In-Memory Database?

2013-11-17 Thread Michael Paquier
On Sun, Nov 17, 2013 at 8:25 PM, Stefan Keller sfkel...@gmail.com wrote: How can Postgres be used and configured as an In-Memory Database? Does anybody know of thoughts or presentations about this NoSQL feature - beyond e.g. Perspectives on NoSQL from Gavin Roy at PGCon 2010)? Given, say 128

Re: [GENERAL] Install pg_trgm from source

2013-11-15 Thread Michael Paquier
On Fri, Nov 15, 2013 at 10:00 PM, Janek Sendrowski jane...@web.de wrote: Hi, I like to change the source code of the pg_trgm extension a little bit. Where can I get the source code and how do I compile it? If you have fetched a tarball of Postgres or git copy, simply have a look in

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Michael Paquier
On Thu, Nov 14, 2013 at 10:44 PM, Alexander Farber alexander.far...@gmail.com wrote: sysctl.conf: kernel.shmmax=17179869184 kernel.shmall=4194304 You do not need those settings in sysctl.conf since 9.3 as consumption of V shared memory has been reduced with this commit:

Re: [GENERAL] what checksum algo?

2013-11-13 Thread Michael Paquier
On Thu, Nov 14, 2013 at 12:58 AM, Scott Ribe scott_r...@elevated-dev.com wrote: What checksum algorithm wound up in 9.3? (I found Simon Riggs 12/2011 submittal using Fletcher's, Michael Paquier's 7/2013 post stating CRC32 reduced to 16, and another post online claiming that it was changed

Re: [GENERAL] Is there something like a limited superuser to give to a db-assistant?

2013-10-24 Thread Michael Paquier
On Fri, Oct 25, 2013 at 10:53 AM, Andreas maps...@gmx.net wrote: Hi, how can I give a db-assistant the rights to create and drop schemas, tables, views ... BUT keep him out of certain existing schemas and tables? Depending on what you want to do, you will have to use a combination GRANT and

Re: [GENERAL] Need help how to manage a couple of daily DB copies.

2013-10-24 Thread Michael Paquier
On Fri, Oct 25, 2013 at 10:53 AM, Andreas maps...@gmx.net wrote: Hi, I'd like to set up a DB-Server that keeps copies of our productive db for an external db-assistant. He should prepare chores on the test-server and mail the sql scripts to me. I'll look over those scripts and run them

Re: [GENERAL] declare constraint as valid

2013-10-12 Thread Michael Paquier
On Thu, Oct 10, 2013 at 3:44 AM, Torsten Förtsch torsten.foert...@gmx.net wrote: Hi, assuming a constraint is added to a table as NOT VALID. Now I know it IS valid. Can I simply declare it as valid by update pg_constraint set convalidated='t' where conrelid=(select c.oid

Re: [GENERAL] Need some help on Performance 9.0.4

2013-10-12 Thread Michael Paquier
On Sat, Oct 12, 2013 at 12:56 AM, akp geek akpg...@gmail.com wrote: We have been running 4 of our applications on 9.0.4, which we are planning to update the database 9.2.2 by the year end. we have the streaming replication also running 9.2.4 has fixed a severe security problem. If you do not

Re: [GENERAL] Feature request: support queries with returning on simple views with automatic update

2013-10-11 Thread Michael Paquier
it would be great if i could simply write 'insert into simple_view returning col1' or 'insert into simple_view returning col2' and postgres would make the magic behind. You can do it with 9.3~ servers already. Here is an example: =# create table aa (a int); CREATE TABLE =# insert into aa

Re: [GENERAL] [HACKERS] Who is pgFoundery administrator?

2013-10-02 Thread Michael Paquier
On Wed, Oct 2, 2013 at 5:37 PM, KONDO Mitsumasa kondo.mitsum...@lab.ntt.co.jp wrote: Who is pgFoundery administrator or board member now? I would like to send e-mail them. At least, it does not have information and support page in pgFoundery homepage. Why don't you consider github as a

Re: [GENERAL] how to tell master from replica

2013-09-25 Thread Michael Paquier
On Thu, Sep 26, 2013 at 8:53 AM, Scott Ribe scott_r...@elevated-dev.com wrote: Assuming a master replica set up using streaming replication, hot standby, 9.3. I'd like to have a single script on both machines distinguish whether it's running on the machine with the master or replica, and

Re: [GENERAL] How to create recurrence schedule event?

2013-09-23 Thread Michael Paquier
On Tue, Sep 24, 2013 at 3:55 AM, Raymond O'Donnell r...@iol.ie wrote: There isn't a built-in scheduler in PostgreSQL - the usual advice is to use cron to execute a query via the psql client, or to install and use pgAgent. Or with a 9.3 server to use a background worker that could do the job for

Re: [GENERAL] Number of WAL segment

2013-09-21 Thread Michael Paquier
On Tue, Sep 17, 2013 at 2:35 PM, tdev457 idzo...@gmail.com wrote: Thanks, I am confused now.When checkpoint_segment is set to 3 there are 7 WAL segments in pg_xlog.When I set checkpoint_segments to 10 there are 11 WAL segments. The maximum number of WAL files is defined by this formula: (2 +

Re: [GENERAL] Number of WAL segment

2013-09-21 Thread Michael Paquier
On Tue, Sep 17, 2013 at 9:46 PM, tdev457 idzo...@gmail.com wrote: Hi, I am using PostgreSQL 8.3.8!!! How can I increase number of WAL segments in pg_xlog??? Current settings are: checkpoint_segments=10 checkpoint_completion_target=0.5 WAL segments are generated every 10 min and I want to

[GENERAL] Re: [GENERAL] pg_upgrade unrecognized configuration parameter “unix_socket_directory”

2013-09-21 Thread Michael Paquier
On Wed, Sep 18, 2013 at 11:35 AM, Clodoaldo Neto clodoaldo.pinto.n...@gmail.com wrote: I'm trying to upgrade Postgresql from 9.2 to 9.3 in Fedora 18 using this command as the postgres user $ pg_upgrade -b /bin -B /usr/pgsql-9.3/bin -d /var/lib/pgsql/data -D /var/lib/pgsql/9.3/data/ -j 2 -u

<    1   2   3   4   5   6   >