Re: [GENERAL] VACUUM FULL doesn't reduce table size

2015-03-06 Thread Alvaro Herrera
pinker wrote: > I have deleted a large number of records from my_table, which originally had > 288 MB. Then I ran vacuum full to make the table size smaller. After this > operation size of the table remains the same, despite of the fact that table > contains now only 241 rows and after rewriting it

Re: [GENERAL] VACUUM FULL doesn't reduce table size

2015-03-06 Thread Alvaro Herrera
pinker wrote: > Query output is empty... I hope you read the whole paragraph, not just the last phrase. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-general mailing list (pgsql-general@post

Re: [GENERAL] How does one make the following psql statement sql-injection resilient?

2015-03-16 Thread Alvaro Herrera
David G. Johnston wrote: > Thanks! I got the gist even with the typo. I actually pondered about > prepare/execute after hitting send. Am I correct in remembering that > "CREATE TEMP TABLE" cannot be prepared? I was using the actual query with > CREATE TEMP TABLE and then issuing "\copy" to dum

[GENERAL] Re: Great Software Opportunities: VP, Front End Developer, etc. (Ruby, Python)

2015-03-17 Thread Alvaro Herrera
Can you please resend this to pgsql-j...@postgresql.org? We don't normally publish job opportunities in pgsql-general, but we'll be happy to have this in pgsql-jobs. Thanks. On Sun, Mar 15, 2015 at 08:55:41PM -0700, Nicholas Meyler wrote: > My repeat client is continuing to grow and expand, seek

Re: [GENERAL] Re: Great Software Opportunities: VP, Front End Developer, etc. (Ruby, Python)

2015-03-17 Thread Alvaro Herrera
Alvaro Herrera wrote: > Can you please resend this to pgsql-j...@postgresql.org? We don't > normally publish job opportunities in pgsql-general, but we'll be happy > to have this in pgsql-jobs. Thanks. Oh well. Sorry about that. Evidently everybody has read the annou

[GENERAL] Re: How does one make the following psql statement sql-injection resilient?

2015-03-19 Thread Alvaro Herrera
David G. Johnston wrote: > Except that server "COPY" only is documented to accept a "query" that > begins with either SELECT or VALUES :( > > I hereby voice my desire for EXECUTE to be usable as well. Feel free to submit a patch ... -- Álvaro Herrerahttp://www.2ndQuadrant.com/

Re: [GENERAL] ERROR: could not access status of transaction 283479860

2015-04-06 Thread Alvaro Herrera
Pweaver (Paul Weaver) wrote: > We started getting the following error on some transactions on our database > (when against particular rows run against the table). > > > PGError: ERROR: could not access status of transaction 283479860 DETAIL: > Could not open file "pg_multixact/members/4D6D": No s

Re: [GENERAL] Running pg_upgrade under Debian

2015-04-20 Thread Alvaro Herrera
ISTM there's a documentation bug here: in the code, the "dump" method checks for tablespaces and raises an error if they are found, but the "upgrade" method does not check. I think the documentation should state that only the dump method does not support tablespaces. Bruce Momjian wrote: > On Mo

Re: [GENERAL] Running pg_upgrade under Debian

2015-04-20 Thread Alvaro Herrera
Bruce Momjian wrote: > On Mon, Apr 20, 2015 at 07:06:37PM -0300, Alvaro Herrera wrote: > > ISTM there's a documentation bug here: in the code, the "dump" method > > checks for tablespaces and raises an error if they are found, but the > > "upgrade" met

Re: [GENERAL] Stellar Phoenix File Recovery Software

2015-05-01 Thread Alvaro Herrera
Dorian Hoxha wrote: > That's spam. Can an admin ban this user/email ? We get a dozen of these daily, and most of them are rejected in moderation. I removed this address now. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training &

Re: [GENERAL] [pgsql-jobs] PostreSQL Engineer and DBA! Atlanta, GA

2015-05-06 Thread Alvaro Herrera
Joshua D. Drake wrote: > > On 05/06/2015 08:11 AM, Sujit K M wrote: > > > >On Wed, May 6, 2015 at 8:35 PM, Jason May wrote: > >>You find the description offensive? That’s interesting. You're very > >>easily offended. I think it reads more like an Engineer than a DBA > > > >lol, you are cribbin

Re: [GENERAL] Why is there no object create date is the catalogs?

2015-05-12 Thread Alvaro Herrera
Melvin Davidson wrote: > Can anyone tell me why there is no "relcreated" column in pg_class to track > the creation date of an object? > > It seems to me it would make sense to have one as it would facilitate > auditing of when objects are created. In addition, it would also facilitate > the dropp

Re: [GENERAL] SELECT INTO and ON COMMIT

2015-05-13 Thread Alvaro Herrera
Melvin Davidson wrote: > So perhaps replace the SQL SELECT INTO with SQL ADD INTO ? No, the alternative spelling is CREATE TABLE AS; we already have it. (To simply insert a query result into an existing table, the spelling is INSERT INTO .. SELECT). -- Álvaro Herrerahttp://www.2

Re: [GENERAL] date with month and year

2015-05-21 Thread Alvaro Herrera
Adrian Klaver wrote: > SELECT > extract ( > YEAR > FROM > school_day ) AS YEAR, > Reformatting courtesy of pgFormatter(http://sqlformat.darold.net/). FWIW I think this indenting of FROM inside an extract() call is odd and ugly --- probably just an accident resulting from

Re: [GENERAL] delaying autovacuum freeze via storage params?

2015-05-26 Thread Alvaro Herrera
Steve Kehlet wrote: > Hello, I'd like to postpone an "autovacuum: VACUUM public.mytable (to > prevent wraparound)" and handle it manually at another time. I thought I > could set these storage parameters on the large table in question > ("mytable") like this: > > ALTER TABLE mytable SET ( > auto

Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-27 Thread Alvaro Herrera
Steve Kehlet wrote: > I have a database that was upgraded from 9.4.1 to 9.4.2 (no pg_upgrade, we > just dropped new binaries in place) but it wouldn't start up. I found this > in the logs: > > waiting for server to start2015-05-27 13:13:00 PDT [27341]: [1-1] LOG: > database system was shut do

Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-27 Thread Alvaro Herrera
Steve Kehlet wrote: > On Wed, May 27, 2015 at 3:21 PM Alvaro Herrera > wrote: > > > I think a patch like this should be able to fix it ... not tested yet. > > > > Thanks Alvaro. I got a compile error, so looked for other uses of > SimpleLruDoesPhysicalPageExis

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-27 Thread Alvaro Herrera
Robert Haas wrote: > On Wed, May 27, 2015 at 6:21 PM, Alvaro Herrera > wrote: > > Steve Kehlet wrote: > >> I have a database that was upgraded from 9.4.1 to 9.4.2 (no pg_upgrade, we > >> just dropped new binaries in place) but it wouldn't start up. I found this

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-28 Thread Alvaro Herrera
Robert Haas wrote: > On Thu, May 28, 2015 at 8:51 AM, Robert Haas wrote: > > [ speculation ] > > OK, I finally managed to reproduce this, after some off-list help from > Steve Kehlet (the reporter), Alvaro, and Thomas Munro. Here's how to > do it: It's a long list of steps, but if you consider

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-28 Thread Alvaro Herrera
Robert Haas wrote: > 2. If you pg_upgrade to 9.3.7 or 9.4.2, then you may have datminmxid > values which are equal to the next-mxid counter instead of the correct > value; in other words, they are too new. What you describe is what happens if you upgrade from 9.2 or earlier. For this case we use

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-28 Thread Alvaro Herrera
Alvaro Herrera wrote: > Robert Haas wrote: > > > 2. If you pg_upgrade to 9.3.7 or 9.4.2, then you may have datminmxid > > values which are equal to the next-mxid counter instead of the correct > > value; in other words, they are too new. > > What you describe is wh

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-29 Thread Alvaro Herrera
Andres Freund wrote: > I considered for a second whether the solution for that could be to not > truncate while inconsistent - but I think that doesn't solve anything as > then we can end up with directories where every single offsets/member > file exists. Hang on a minute. We don't need to scan

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-29 Thread Alvaro Herrera
Bruce Momjian wrote: > I think we need to step back and look at the brain power required to > unravel the mess we have made regarding multi-xact and fixes. (I bet > few people can even remember which multi-xact fixes went into which > releases --- I can't.) Instead of working on actual features,

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-01 Thread Alvaro Herrera
Thomas Munro wrote: > > - There's a third possible problem related to boundary cases in > > SlruScanDirCbRemoveMembers, but I don't understand that one well > > enough to explain it. Maybe Thomas can jump in here and explain the > > concern. > > I noticed something in passing which is probably n

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-01 Thread Alvaro Herrera
Alvaro Herrera wrote: > Robert Haas wrote: > > In the process of investigating this, we found a few other things that > > seem like they may also be bugs: > > > > - As noted upthread, replaying an older checkpoint after a newer > > checkpoint has already happ

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-01 Thread Alvaro Herrera
Alvaro Herrera wrote: > Anyway here's a quick script to almost-reproduce the problem. Meh. Really attached now. I also wanted to post the error messages we got: 2015-05-27 16:15:17 UTC [4782]: [3-1] user=,db= LOG: entering standby mode 2015-05-27 16:15:18 UTC [4782]: [4-1] user=

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-02 Thread Alvaro Herrera
Thomas Munro wrote: > On Tue, Jun 2, 2015 at 9:30 AM, Alvaro Herrera > wrote: > > My guess is that the file existed, and perhaps had one or more pages, > > but the wanted page doesn't exist, so we tried to read but got 0 bytes > > back. read() returns 0 in th

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-03 Thread Alvaro Herrera
Thomas Munro wrote: > I have finally reproduced that error! See attached repro shell script. > > The conditions are: > > 1. next multixact == oldest multixact (no active multixacts, pointing > past the end) > 2. next multixact would be the first item on a new page (multixact % 2048 == > 0) >

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-03 Thread Alvaro Herrera
Andres Freund wrote: > On 2015-06-03 00:42:55 -0300, Alvaro Herrera wrote: > > Thomas Munro wrote: > > > On Tue, Jun 2, 2015 at 9:30 AM, Alvaro Herrera > > > wrote: > > > > My guess is that the file existed, and perhaps had one or more pages, > >

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-03 Thread Alvaro Herrera
Alvaro Herrera wrote: > Really, the whole question of how this code goes past the open() failure > in SlruPhysicalReadPage baffles me. I don't see any possible way for > the file to be created ... Hmm, the checkpointer can call TruncateMultiXact when in recovery, on restartpoint

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-03 Thread Alvaro Herrera
Andres Freund wrote: > On 2015-06-03 15:01:46 -0300, Alvaro Herrera wrote: > > One idea I had was: what if the oldestMulti pointed to another multi > > earlier in the same 0046 file, so that it is read-as-zeroes (and the > > file is created), and then a subsequent multixact t

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-03 Thread Alvaro Herrera
Robert Haas wrote: > So here's a patch taking a different approach. I tried to apply this to 9.3 but it's messy because of pgindent. Anyone would have a problem with me backpatching a pgindent run of multixact.c? Also, you have a new function SlruPageExists, but we already have SimpleLruDoesPhy

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-04 Thread Alvaro Herrera
Alvaro Herrera wrote: > Robert Haas wrote: > > > So here's a patch taking a different approach. > > I tried to apply this to 9.3 but it's messy because of pgindent. Anyone > would have a problem with me backpatching a pgindent run of multixact.c? Done. -- Álv

Re: [HACKERS] [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-05 Thread Alvaro Herrera
Tom Lane wrote: > Robert Haas writes: > > There are at least two other known issues that seem like they should > > be fixed before we release: > > > 1. The problem that we might truncate an SLRU members page away when > > it's in the buffers, but not drop it from the buffers, leading to a > > fa

Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-05 Thread Alvaro Herrera
Robert Haas wrote: > On Fri, Jun 5, 2015 at 2:20 AM, Noah Misch wrote: > > On Thu, Jun 04, 2015 at 05:29:51PM -0400, Robert Haas wrote: > >> Here's a new version with some more fixes and improvements: > > > > I read through this version and found nothing to change. I encourage other > > hackers t

Re: [HACKERS] [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-05 Thread Alvaro Herrera
Joshua D. Drake wrote: > I believe there are likely quite a few parties willing to help test, if we > knew how? The code involved is related to checkpoints, pg_basebackups that take a long time to run, and multixact freezing and truncation. If you can set up test servers that eat lots of multixa

Re: [HACKERS] [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-08 Thread Alvaro Herrera
Andres Freund wrote: > A first version to address this problem can be found appended to this > email. > > Basically it does: > * Whenever more than MULTIXACT_MEMBER_SAFE_THRESHOLD are used, signal > autovacuum once per members segment > * For both members and offsets, once hitting the hard limi

Re: [HACKERS] [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-08 Thread Alvaro Herrera
Andres Freund wrote: > On June 8, 2015 7:06:31 PM GMT+02:00, Alvaro Herrera > wrote: > >I might be misreading the code, but PMSIGNAL_START_AUTOVAC_LAUNCHER > >only causes things to happen (i.e. a new worker to be started) when > >autovacuum is disabled. If autovacuu

Re: [HACKERS] [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-08 Thread Alvaro Herrera
Robert Haas wrote: > On Mon, Jun 8, 2015 at 1:23 PM, Alvaro Herrera > wrote: > > (My personal alarm bells go off when I see autovac_naptime=15min or > > more, but apparently not everybody sees things that way.) > > Uh, I'd echo that sentiment if you did s/15min/

Re: [HACKERS] [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-15 Thread Alvaro Herrera
Andres Freund wrote: > A first version to address this problem can be found appended to this > email. > > Basically it does: > * Whenever more than MULTIXACT_MEMBER_SAFE_THRESHOLD are used, signal > autovacuum once per members segment > * For both members and offsets, once hitting the hard limi

Re: [HACKERS] [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-16 Thread Alvaro Herrera
Alvaro Herrera wrote: > I see another hole in this area. See do_start_worker() -- there we only > consider the offsets limit to determine a database to be in > almost-wrapped-around state (causing emergency attention). If the > database in members trouble has no pgstat entry,

Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-16 Thread Alvaro Herrera
Thomas Munro wrote: > Thanks. As mentioned elsewhere in the thread, I discovered that the > same problem exists for page boundaries, with a different error > message. I've tried the attached repro scripts on 9.3.0, 9.3.5, 9.4.1 > and master with the same results: > > FATAL: could not access s

Re: [GENERAL] PL/pgSQL: How to return two columns and multiple rows

2015-06-18 Thread Alvaro Herrera
Sven Geggus wrote: > Using your suggestion the desired two columns are generated, but I consider > this a little bit ugly: > > mydb=> WITH exec_func AS ( select myfunc(col1,col2) from mytable ) > SELECT (exec_func.myfunc).* FROM exec_func; > HINWEIS: called with parms foo,bar: text1 value1 > HIN

Re: [GENERAL] When files in pg_multixact/{members,offsets} get recycled?

2015-06-25 Thread Alvaro Herrera
Piotr Gasidło wrote: > Running latest 9.3.9. Database was never pg_upgraded. I list > pg_multixact/offsets and pg_multixact/members and I see many files > with dates more than one year old. Is that ok? Yes, it's okay, if a bit annoying. You can decrease the number of files by reducing the freeze

Re: [GENERAL] Correct place for feature requests

2015-06-25 Thread Alvaro Herrera
John R Pierce wrote: > On 6/25/2015 11:59 AM, Алексей Бережняк wrote: > >Or maybe some option that will make double quotes case-insensitive. > > the current behavior is compliant with the SQL specification. if you want > case-insensitive, don't quote the identifiers. if you do quote them, the

Re: [GENERAL] very slow queries and ineffective vacuum

2015-06-30 Thread Alvaro Herrera
Lukasz Wrobel wrote: > Hello. > > I have multiple problems with my database, the biggest of which is how to > find out what is actually wrong. > > First of all I have a 9.3 postgres database that is running for about a > month. Right now the queries on that database are running very slowly > (sel

Re: [GENERAL] A table of magic constants

2015-07-14 Thread Alvaro Herrera
Dane Foster wrote: > Hi Michael, > > You nailed it. I am reading the documentation cover to cover. I started > chapter 9 two weeks ago but haven't found the time to read beyond 9.1 yet. > But for day to day usage on the MySQL to PostgreSQL migration project that > I'm working on I jump around in t

Re: [GENERAL] Recovering database from crashed HD (bad sectors)

2015-07-18 Thread Alvaro Herrera
Michael Paquier wrote: > On Sat, Jul 18, 2015 at 6:59 PM, Amitabh Kant wrote: > > A development box hard disk failed which was running a PG instance with > > multiple databases on it. I got the data recovered with some bad sector > > errors. Ran another instance of PG (same version), and was to a

Re: [GENERAL] Recovering database from crashed HD (bad sectors)

2015-07-18 Thread Alvaro Herrera
Tom Lane wrote: > Amitabh Kant writes: > > As for running the sql command as suggested by Tom, here is the result: > > template1=# select * from pg_class where pg_relation_filenode(oid) = 11678; > > > pg_class | 11 | 83 | 0 | 10 | 0 | > > 0 | 0 |

Re: [GENERAL] Lots of stuck queries after upgrade to 9.4

2015-07-20 Thread Alvaro Herrera
Spiros Ioannou wrote: > Hi Tom, > thank you for your input. The DB was stuck again, I attach all logs and > stack traces. > > A stack trace from a COMMIT, an INSERT, an UPDATE, the wal writer, the > writer, and a sequence. > > Stracing the commit was stuck at: semop(3145761, {{12, -1, 0}}, 1 Hmm

Re: [GENERAL] INSERT ... ON CONFLICT DO UPDATE

2015-07-20 Thread Alvaro Herrera
Geoff Winkless wrote: > On 20 July 2015 at 14:33, Rafal Pietrak wrote: > > > If I'm not mistaken, the conclusions from posts in this thread are: > > > > 3. there are methods (like cryptographic "random" sequence), which > > guarantee no conflicts. So one should resort to that. > > > > > Some web

Re: [GENERAL] Strange deadlock in foreign key check

2015-08-06 Thread Alvaro Herrera
Sophia Wright wrote: > I am seeing some odd locking behaviour when deleting a parent record > (Postgres 9.4.4). Somewhere in the triggers for FK checks we do "SELECT FOR KEY SHARE" of the PK tuples when the FK tuples are altered; and conversely when we remove tuples from the PK side we need to ens

Re: [GENERAL] pg_start_backup: file has vanished from pg_subtrans/

2015-08-07 Thread Alvaro Herrera
Leo Baltus wrote: > Hi, > > While backing up some postgresql-8.4.2 instances using > pg_start_backup()/pg_stop_backup() 8.4.2 was released in 2009, so you're missing all the bugfixes till July 2014 which is when the 8.4 branch was dropped out of support -- which means you're also missing bugfixes

Re: [GENERAL] pg_start_backup: file has vanished from pg_subtrans/

2015-08-07 Thread Alvaro Herrera
Adrian Klaver wrote: > On 08/07/2015 07:20 AM, Alvaro Herrera wrote: > >Leo Baltus wrote: > >>Hi, > >> > >>While backing up some postgresql-8.4.2 instances using > >>pg_start_backup()/pg_stop_backup() > > > >8.4.2 was released in 2009, so y

Re: [GENERAL] CentOS - PostgreSQL 9.2.13 -> 9.4

2015-08-18 Thread Alvaro Herrera
Joshua D. Drake wrote: > > On 08/18/2015 09:19 AM, Melvin Davidson wrote: > >>8 x 16GB 1600MHz PC3-12800 DDR3 - 128GB total > > >>shared_buffers=60GB > > > >I would say 60GB is too high when you have 128GB system memory. > >Try lowering it to shared_buffers=32GB and let the O/S han

Re: [GENERAL] CentOS - PostgreSQL 9.2.13 -> 9.4

2015-08-18 Thread Alvaro Herrera
Alvaro Herrera wrote: > One thing to look at is the rate of WAL generation for a set number of > transactions. Maybe the later releases are generating more WAL due to > multixacts, for instance (prior to 9.3 these weren't wal-logged.) Also try 9.5alpha2, wherein bug #8470 is fix

Re: [GENERAL] CentOS - PostgreSQL 9.2.13 -> 9.4

2015-08-18 Thread Alvaro Herrera
I wrote: > One thing to look at is the rate of WAL generation for a set number of > transactions. Maybe the later releases are generating more WAL due to > multixacts, for instance (prior to 9.3 these weren't wal-logged.) FWIW a very easy way to measure this is to look at the output of "pg_xlogd

Re: [GENERAL] CentOS - PostgreSQL 9.2.13 -> 9.4

2015-08-18 Thread Alvaro Herrera
Joshua D. Drake wrote: > > On 08/18/2015 09:41 AM, Alvaro Herrera wrote: > > > >Alvaro Herrera wrote: > > > >>One thing to look at is the rate of WAL generation for a set number of > >>transactions. Maybe the later releases are generating more WAL due

Re: [GENERAL] 9.5 beta pg_upgrade documentation

2015-08-21 Thread Alvaro Herrera
Andy Colson wrote: > On a side note, I'm confusing myself by the step numbers. There's two step > 7's. Can we renumber the step 9 sub steps to be 9.1, 9.2, etc? I've had this lying about for a while, which does more or less what you want, numbering the substeps "a, b, c" instead of "1, 2, 3".

Re: [GENERAL]

2015-08-21 Thread Alvaro Herrera
Adrian Klaver wrote: > On 08/21/2015 02:14 PM, Ali Panjwani wrote: > >Unsubscribe > > > See here: > http://www.postgresql.org/mailpref/pgsql-general Already unsubscribed. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Ser

Re: [GENERAL] BDR questions?

2015-08-27 Thread Alvaro Herrera
Ray Stell wrote: > Is there an preferred BDR? Should there be a mailing-list? This is the list for BDR questions. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-general mailing list (pgsql-g

Re: [GENERAL] bdr download

2015-08-31 Thread Alvaro Herrera
Bruce Momjian wrote: > On Mon, Aug 31, 2015 at 10:24:26AM -0400, Ray Stell wrote: > > Two comments on the BDR docs: > > > > The second option provided here, http://bdr-project.org/docs/stable/ > > installation-source.html#INSTALLATION-SOURCE-PREREQS > > "3.3.2.2 Downloading release source tarballs

Re: [GENERAL] bdr download

2015-08-31 Thread Alvaro Herrera
Bruce Momjian wrote: > Yeah, I just read the thread. I guess with the low volume makes sense > to use "general", but I figured if someone went to the work of > developing a website for BDR, they would just as soon create a mailing > list hosted there, but I guess not. Actually, that website was

Re: [GENERAL] FDW and BDR

2015-09-02 Thread Alvaro Herrera
Andres Freund wrote: > On 2015-09-02 20:27:40 +0800, Craig Ringer wrote: > > The reason for this is that BDR replicates at a database level, but > > CREATE SERVER and CREATE USER MAPPING are global, affecting all > > databases on a PostgreSQL install. BDR can't therefore guarantee to > > replicate

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Alvaro Herrera
Ken Tanzer wrote: > Are there any other potential solutions, pitfalls or considerations that > come to mind? Any thoughts welcome. And as I said, if there's not a good > way to do this I'll probably leave it alone. In part, it boils down to what you use the in ORDER BY clause. If you concatena

Re: [GENERAL] clone_schema function

2015-09-11 Thread Alvaro Herrera
Melvin Davidson wrote: > Here is one more tweak of clone_schema. Are you updating the wiki to match? If not (why?), I think at the very least you should add a link in the wiki page to this thread. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support,

Re: [GENERAL] clone_schema function

2015-09-11 Thread Alvaro Herrera
Melvin Davidson wrote: > Alvaro, > > no I haven't updated the wiki (or git). To be honest, I'm retired and I > just don't want to bother learning something new, > but I do enjoy helping othersfrom time to time. I would consider it a favor > if you would do the update for me. I wouldn't want to pr

Re: [GENERAL] clone_schema function

2015-09-11 Thread Alvaro Herrera
Melvin Davidson wrote: > Thank you very much Alvaro. Now I can go back to being Chief Engineer of > Sleeping Late @ retired. :) What? No! You still have a lot of other Snippet pages to go through to improve ;-) -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Developmen

Re: [GENERAL] BDR truncate and replication sets

2015-09-15 Thread Alvaro Herrera
Sylvain MARECHAL wrote: > Hello all, > > To avoid replication of some tables, I use a specific replication set. > For example, with 2 nodes 'node1' and 'node2' and a table 'test' which > content shall not be replicated, I do the following: > > mydb=# CREATE TABLE test (i INT PRIMARY KEY NOT NULL)

Re: [GENERAL] BDR truncate and replication sets

2015-09-17 Thread Alvaro Herrera
Sylvain MARECHAL wrote: > Le 15/09/2015 18:56, Alvaro Herrera a écrit : > >Sylvain MARECHAL wrote: > >>[...] The exception is with TRUNCATE: In case it is called, data is removed > >>on > >>both nodes. > >> > >>Is it a feature or a bug? >

Re: [GENERAL] Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?

2015-09-17 Thread Alvaro Herrera
Tom Lane wrote: > Since type record *does* have btree/hash opclasses, it is not negotiable > that the component column types obey btree or at least hash semantics. > The only way to fix this would be to provide such opclasses for point. > Btree has the probably-fatal obstacle that there's no plaus

Re: [GENERAL] postgres 9.3

2015-09-21 Thread Alvaro Herrera
John R Pierce wrote: > better would be to... > > ALTER ROLE username SET SEARCH_PATH='preview,"$user", public'; > or > ALTER DATABASE dbname SET...; > > and then this change just applies to that named role or database... (or ALTER ROLE username IN DATABASE dbname SET .. which applies

Re: [GENERAL] numeric data type

2015-09-22 Thread Alvaro Herrera
Juan Pablo L. wrote: > thank you for your answer, the function is declared as: > > FUNCTION wtt_discount_account(IN in_phonenumber varchar(20),IN in_balanceid > integer,IN in_chgval numeric(10,2)) > > i chose numeric because is supposed to be better for numbers/money > operations, supposed to b

Re: [GENERAL] numeric data type

2015-09-22 Thread Alvaro Herrera
Juan Pablo L. wrote: > Hi Alvaro, thank you for your answer, PG_GETARG_NUMERIC does not exist .. > cant find it in the source code and when running i get > undefined symbol: PG_GETARG_NUMERIC. #include "utils/numeric.h" -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL

Re: [GENERAL] The curious case of two inserts, a shrinking xmax, and a ShareLock on transaction

2015-09-22 Thread Alvaro Herrera
Jeff Dik wrote: > I'd really love to learn: > > 1. Why the xmax for foo_id1 goes from 696 to 1 and what does that >mean? When two transactions want to lock the same row, the xmax field is a multixact, no longer a bare transaction ID. This is an object that resolves to multiple transaction I

Re: [GENERAL] The curious case of two inserts, a shrinking xmax, and a ShareLock on transaction

2015-09-23 Thread Alvaro Herrera
Jeff Dik wrote: > Is there any way to inspect a multixact via psql to see what transaction ID > values it has? I wasn't able to find anything while searching for an hour > or so. There's the function pg_get_multixact_members(xid), =# select * from pg_get_multixact_members('1'); xid | mode

Re: [GENERAL] Dropped connections with pg_basebackup

2015-09-24 Thread Alvaro Herrera
Sherrylyn Branchaw wrote: > I'm assuming based on the "SSL error" that you have ssl set to 'on'. What's > your ssl_renegotiation_limit? The default is 512MB, but setting it to 0 has > solved problems for a number of people on this list, including myself. Moreover, the default has been set to 0, be

Re: [GENERAL] pg_restore fails to restore sequences

2015-09-28 Thread Alvaro Herrera
Tom Lane wrote: > Thom Brown writes: > > On 28 September 2015 at 22:21, Spencer Gardner > > wrote: > >> Actually, yes. That's the reason for backing up. We had been playing with > >> BDR on a custom build but have reverted to the stock Ubuntu build for the > >> time being. So it sounds like the

Re: [GENERAL] BDR Rejoin of failed node, hangs.

2015-10-01 Thread Alvaro Herrera
Jim Nasby wrote: > On 10/1/15 12:27 PM, Steve Pribyl wrote: > >I am in the process of testing out BDR > > Please send BDR requests to the BDR mailing list. Thanks! pgsql-general remains the BDR list. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Suppo

Re: [GENERAL] [pgsql-es-ayuda] No funciona WITH con mas de 2 sentencias DML

2015-10-06 Thread Alvaro Herrera
Hellmuth Vargas escribió: > Hola Lista > > Estaba realizando un cargue de un archivo Excel con información de clientes > bancarios con tarjeta para un call center poblando un modelo maestro, > detalle y tabla de llamadas telefónicas. En un principio se implemento por > medio de una herramienta de

Re: [GENERAL] dubious optimization of the function in SELECT INTO target list

2015-10-08 Thread Alvaro Herrera
Oleksii Kliukin wrote: > Thank you, now it’s clear. I have to say there is no guarantee that > the computation would be useless. Someone might be calling a function > that updates/deletes rows in the SELECT INTO block, being forced to > use SELECT INTO by inability of pl/pgSQL to just discard the

Re: [GENERAL] Understanding "seq scans"

2015-10-12 Thread Alvaro Herrera
Lele Gaifax wrote: > Hi all, > > I'm doing some experiments to find the better layout for reimplementing > an existing db (MySQL cough!) with PostgreSQL 9.4+. > > I noticed a strange plan coming out from a simple query joining two tables, > both containing 10Mrecs (and both ANALYZEd): >

Re: [GENERAL] Understanding "seq scans"

2015-10-13 Thread Alvaro Herrera
Lele Gaifax wrote: > Alvaro Herrera writes: > > > So 10% of your rows in the master_l10n table start with "quattro"? > > That's pretty odd, isn't it? How did you manufacture these data? > > Well, not a real scenario for sure, but definitely not odd

Re: [GENERAL] interperting type oid in C code

2015-10-19 Thread Alvaro Herrera
Ken Been wrote: > Thanks, but I actually wanted to do it from C code. But anyway I think I > found the answer: use the symbolic constants in catalog/pg_type.h, such as > INT4OID. You can probably use SearchSysCache1(TYPEOID, ObjectIdGetDatum(your_oid)) or perhaps lookup_type_cache(your_oid). --

Re: [GENERAL] interperting type oid in C code

2015-10-19 Thread Alvaro Herrera
Ken Been wrote: > Those are more complicated, and it's not obvious to me how to use them. I > really think that all I need is something as simple as "if (my_oid == > INT4OID) {...}". Is there any reason why I shouldn't just do that? I don't know. I was thinking that you might want to handle a l

Re: [GENERAL] Domain check constraint not honored?

2015-10-29 Thread Alvaro Herrera
Rob Sargent wrote: > Also thought I should mention that there is an ip address type if that's > what you're trying to accomplish. Looking at the domain name, I wonder whether contrib/ltree would be helpful. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24

Re: [GENERAL] pgxs/config/missing is... missing

2015-10-30 Thread Alvaro Herrera
David E. Wheeler wrote: > On Oct 29, 2015, at 7:22 PM, Jim Nasby wrote: > > > I'm not sure if this is the right way to go about it, but this patch at > > least installs the file. > > Which seems like a decent idea. I’d like a way to know when Perl is missing, > though. What does `missing` do?

Re: [GENERAL] Does PostgreSQL ever create indexes on its own?

2015-11-12 Thread Alvaro Herrera
Thomas Kellerer wrote: > Doiron, Daniel schrieb am 12.11.2015 um 23:21: > >I’m troubleshooting a schema and found this: > > > >Indexes: > > "pk_patient_diagnoses" PRIMARY KEY, btree (id) > The only index that Postgres "automatically" creates is the unique index > supporting a primary key or a

Re: [GENERAL] Log Shipping

2016-05-31 Thread Alvaro Herrera
Joseph Kregloh wrote: > It is my understanding that if PostgeSQL has log shipping enabled, if for > whatever reason it cannot ship the file the master server will hold it. But > for how long? Forever (which means it dies because of running out of space in the partition containing pg_xlog). > Seco

Re: [GENERAL] Postgres Dropped DB have recovered files how to restore

2016-06-06 Thread Alvaro Herrera
lifetronics wrote: > This morning I accidently deleted my database for my OpenERP accounting. I > did not have a good backup system setup so I was unable to do a system > restore. i did manage to recover the files the drop command removed but I > dont know how to get the DB back into postgres? Can

Re: [GENERAL] Postgres Dropped DB have recovered files how to restore

2016-06-07 Thread Alvaro Herrera
John R Pierce wrote: > On 6/6/2016 4:09 PM, Alvaro Herrera wrote: > >I have no idea about Windows filesystems but you may be able to > >"undelete" the files, as long as you don't touch the partition for > >anything else; search the web for "undelete ntfs

Re: [GENERAL] pg_dump fundenental question

2016-07-05 Thread Alvaro Herrera
J. Cassidy wrote: > As stated in the original email, I want to know whether compression > (whatever level) is on by default (or not) -  if I supply NO extra > switches/options. I have read the documentation and it is unclear in > this respect. I am a Mainframer and perhaps have a different world

Re: [GENERAL] Is it possible to use an EVENT TRIGGER to validate a TRIGGER?

2016-07-05 Thread Alvaro Herrera
Luís Eduardo Oliveira Lizardo wrote: > Hi, > > Is it possible to use an EVENT TRIGGER to validate a TRIGGER definition? > > What I want is to guarantee that the trigger is fired AFTER a STATEMENT, on > INSERT or UPDATE but not on DELETE, like the following example: What you can do with a C langu

Re: [GENERAL] Fastest memmove in C

2016-07-06 Thread Alvaro Herrera
FarjadFarid(ChkNet) wrote: > Excellent research and could be well worth checking out. As it could > improve the performance of postgresql engine. 0) We certainly do a lot of memory copying. 1) this work is under the "Code Project Open License" which doesn't look compatible with our Postgres lice

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Alvaro Herrera
Tom Lane wrote: > You might have better luck with "psql -n", or maybe not. I've wished sometimes for a "\set READLINE off" psql metacommand for this kind of thing. It's pretty annoying when the text being pasted contains tabs and readline uses to do completion. -- Álvaro Herrera

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Alvaro Herrera
Merlin Moncure wrote: > On Thu, Jul 7, 2016 at 1:18 PM, Alvaro Herrera > wrote: > > Tom Lane wrote: > > > >> You might have better luck with "psql -n", or maybe not. > > > > I've wished sometimes for a "\set READLINE off" psql me

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Alvaro Herrera
Merlin Moncure wrote: > Might be a 'xterm vs Mate Terminal' problem. Using raw xterm > performance is great. I like some of the creature comforts of the > mate terminal though. Heh. I've been using lxterminal for a couple of weeks now and I find some of these comfort features rather uncomforta

Re: [GENERAL] pasting a lot of commands to psql

2016-07-08 Thread Alvaro Herrera
Tom Lane wrote: > Francisco Olarte writes: > > On Thu, Jul 7, 2016 at 8:18 PM, Alvaro Herrera > > wrote: > >> I've wished sometimes for a "\set READLINE off" psql metacommand for > >> this kind of thing. It's pretty annoying when the text be

Re: [GENERAL] question on parsing postgres sql queries

2016-07-27 Thread Alvaro Herrera
Kevin Grittner wrote: > On the other hand, try connecting to a database with > psql and typing: > > \h create index > > ... (or any other command name). The help you get there is fished > out of the docs. BTW I noticed a few days ago that we don't have a "where BLAH can be one of" section for

Re: [GENERAL] Uber migrated from Postgres to MySQL

2016-07-27 Thread Alvaro Herrera
Patrick B wrote: > > > > I think it's safe to say that that has absolutely nothing to do > > with the size being 3TB. They symptoms you report are a little > > thin to diagnose the actual cause. > > might be... we're using SATA disks... and that's a big problem. But still.. > the size of the DB i

  1   2   3   4   5   6   7   8   9   10   >