Re: FW: [HACKERS] Allow replacement of bloated primary key indexes without foreign key rebuilds

2012-07-12 Thread Amit Kapila
> From: Gurjeet Singh [mailto:singh.gurj...@gmail.com] > Sent: Friday, July 13, 2012 4:24 AM >>On Tue, Jul 10, 2012 at 2:40 AM, Amit Kapila wrote: >>> Having to drop foreign key constraints before this command, and recreate them afterwards makes this command useless to most database setups. I

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Amit Kapila
> From: pgsql-hackers-ow...@postgresql.org [mailto:pgsql-hackers-ow...@postgresql.org] > On Behalf Of Jose Ildefonso Camargo Tolosa >>On Thu, Jul 12, 2012 at 9:28 AM, Aidan Van Dyk wrote: > On Thu, Jul 12, 2012 at 9:21 AM, Shaun Thomas wrote: > > As currently is, the point of: freezing the mas

Re: [HACKERS] [PERFORM] DELETE vs TRUNCATE explanation

2012-07-12 Thread Jeff Janes
I've moved this thread from performance to hackers. The topic was poor performance when truncating lots of small tables repeatedly on test environments with fsync=off. On Thu, Jul 12, 2012 at 6:00 PM, Jeff Janes wrote: > I think the problem is in the Fsync Absorption queue. Every truncate > ad

Re: [HACKERS] pgsql_fdw in contrib

2012-07-12 Thread Etsuro Fujita
Hi Hanada-san, > It would be possible to add some more features, such as ORDER BY > push-down with index information support, without changing existing > APIs, but at first add relatively simple pgsql_fdw and enhance it seems > better. In addition, once pgsql_fdw has been merged, it would help >

Re: [HACKERS] pgsql_fdw in contrib

2012-07-12 Thread Kohei KaiGai
2012/7/13 Shigeru HANADA : > (2012/07/12 20:48), Kohei KaiGai wrote: >> It seems to me what postgresql_fdw_validator() is doing looks like >> a function to be named as "libpq_fdw_validator()". >> >> How about your opinion? It will help this namespace conflicts. > > I'd prefer dblink_fdw_validator.

Re: [HACKERS] has_language_privilege returns incorrect answer for non-superuser

2012-07-12 Thread Tom Lane
Joe Conway writes: > Is it still worth backpatching a change to has_language_privilege as a > bug fix? I think back-patching a behavioral change in this area is probably a bad idea. We can fix it (in one way or another) going forward, but changing this sort of thing in a minor release seems like

Re: [HACKERS] WIP Patch: Selective binary conversion of CSV file foreign tables

2012-07-12 Thread Etsuro Fujita
Thanks! Best regards, Etsuro Fujita > -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Friday, July 13, 2012 5:30 AM > To: Etsuro Fujita > Cc: 'Kohei KaiGai'; 'Robert Haas'; pgsql-hackers@postgresql.org > Subject: Re: [HACKERS] WIP Patch: Selective binary conversion

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Jose Ildefonso Camargo Tolosa
On Thu, Jul 12, 2012 at 4:10 PM, Shaun Thomas wrote: > On 07/12/2012 12:02 PM, Bruce Momjian wrote: > >> Well, the problem also exists if add it as an internal database >> feature --- how long do we wait to consider the standby dead, how do >> we inform administrators, etc. > > > True. Though if t

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Jose Ildefonso Camargo Tolosa
On Thu, Jul 12, 2012 at 8:29 PM, Aidan Van Dyk wrote: > On Thu, Jul 12, 2012 at 8:27 PM, Jose Ildefonso Camargo Tolosa > >> Yeah, you need that with PostgreSQL, but no with DRBD, for example >> (sorry, but DRBD is one of the flagships of HA things in the Linux >> world). Also, I'm not convinced a

Re: [HACKERS] pgsql_fdw in contrib

2012-07-12 Thread Shigeru HANADA
(2012/07/12 20:48), Kohei KaiGai wrote: > It seems to me what postgresql_fdw_validator() is doing looks like > a function to be named as "libpq_fdw_validator()". > > How about your opinion? It will help this namespace conflicts. I'd prefer dblink_fdw_validator. The name "libpq_fdw_validator" imp

Re: [HACKERS] has_language_privilege returns incorrect answer for non-superuser

2012-07-12 Thread Joe Conway
On 07/12/2012 02:53 PM, Tom Lane wrote: > Peter Eisentraut writes: >> As long as we're spending time on this, I'd propose getting rid of >> lanplistrusted, at least for access checking. Instead, just don't >> install USAGE privileges by default for those languages. > > There's definitely somethi

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Aidan Van Dyk
On Thu, Jul 12, 2012 at 8:27 PM, Jose Ildefonso Camargo Tolosa > Yeah, you need that with PostgreSQL, but no with DRBD, for example > (sorry, but DRBD is one of the flagships of HA things in the Linux > world). Also, I'm not convinced about the "2nd standby" thing... I > mean, just read this on t

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Jose Ildefonso Camargo Tolosa
On Thu, Jul 12, 2012 at 12:17 PM, Bruce Momjian wrote: > On Thu, Jul 12, 2012 at 11:33:26AM +0530, Amit Kapila wrote: >> > From: pgsql-hackers-ow...@postgresql.org >> [mailto:pgsql-hackers-ow...@postgresql.org] >> > On Behalf Of Jose Ildefonso Camargo Tolosa >> >> > Please, stop arguing on all of

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Jose Ildefonso Camargo Tolosa
On Thu, Jul 12, 2012 at 9:28 AM, Aidan Van Dyk wrote: > On Thu, Jul 12, 2012 at 9:21 AM, Shaun Thomas > wrote: > >> So far as transaction durability is concerned... we have a continuous >> background rsync over dark fiber for archived transaction logs, DRBD for >> block-level sync, filesystem sn

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Jose Ildefonso Camargo Tolosa
On Thu, Jul 12, 2012 at 8:35 AM, Dimitri Fontaine wrote: > Hi, > > Jose Ildefonso Camargo Tolosa writes: >> environments. And no, it doesn't makes synchronous replication >> meaningless, because it will work synchronous if it have someone to >> sync to, and work async (or standalone) if it doesn

Re: [HACKERS] Re: Allow replacement of bloated primary key indexes without foreign key rebuilds

2012-07-12 Thread Gurjeet Singh
On Tue, Jul 10, 2012 at 11:11 AM, Greg Stark wrote: > On Tue, Jul 10, 2012 at 3:44 PM, Tom Lane wrote: > >> The problem you describe is one of constraints and dependencies and > >> not one of indexes. It seems what you really want is a way to alter > >> foreign key dependencies to depend on a ne

Re: [HACKERS] Re: Allow replacement of bloated primary key indexes without foreign key rebuilds

2012-07-12 Thread Gurjeet Singh
On Tue, Jul 10, 2012 at 10:44 AM, Tom Lane wrote: > Greg Stark writes: > > On Sat, Jul 7, 2012 at 4:53 AM, Gurjeet Singh > wrote: > >> All we need to do is allow swapping of pg_class.relfilenode of two > indexes. > > > Fwiw I don't like swapping relfilenodes on indexes the user created. > > REI

Re: FW: [HACKERS] Allow replacement of bloated primary key indexes without foreign key rebuilds

2012-07-12 Thread Gurjeet Singh
On Tue, Jul 10, 2012 at 2:40 AM, Amit Kapila wrote: > > Today I learnt [1,2,3] that the feature ALTER TABLE .. ADD CONSTRAINT > ... USING INDEX we added back in the day is not so useful in the field. ** > ** > > > Having to drop foreign key constraints before this command, and > recreate them af

Re: [HACKERS] has_language_privilege returns incorrect answer for non-superuser

2012-07-12 Thread Tom Lane
Peter Eisentraut writes: > As long as we're spending time on this, I'd propose getting rid of > lanplistrusted, at least for access checking. Instead, just don't > install USAGE privileges by default for those languages. There's definitely something to that idea --- certainly lanpltrusted dates

Re: [HACKERS] has_language_privilege returns incorrect answer for non-superuser

2012-07-12 Thread Peter Eisentraut
On tor, 2012-07-12 at 01:40 -0400, Tom Lane wrote: > So it seems arguably reasonable to me for has_language_privilege() > to take superuserness and lanpltrusted into account, without thereby > concluding that other privilege() functions must do more than they > do today. If we don't want it to do

Re: [HACKERS] compiler warnings on the buildfarm

2012-07-12 Thread Peter Eisentraut
On sön, 2012-07-01 at 19:04 +0200, Stefan Kaltenbrunner wrote: > seeing some of the latest commits about fixing compiler warnings I > took a look at the buildfarm to see if there are any interesting ones > there (in total we have a thousends of warnings on the buildfarm but > most of those are from

Re: [HACKERS] CREATE FOREGIN TABLE LACUNA

2012-07-12 Thread Peter Eisentraut
On lör, 2012-06-23 at 23:08 +0100, Dean Rasheed wrote: > I spotted a couple of other issues during testing: > > * You're still allowing INCLUDING DEFAULTS and INCLUDING STORAGE, even > though these options are not supported on foreign tables. > > * If I do INCLUDING ALL, I get an error because of

[HACKERS] sign mismatch in walreceiver.c

2012-07-12 Thread Peter Eisentraut
This looks suspicious static TimeLineID recvFileTLI = -1; because TimeLineID is uint32. The Solaris compiler complains about the sign mismatch. Maybe 0 would be a better initial value? -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscripti

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Shaun Thomas
On 07/12/2012 12:02 PM, Bruce Momjian wrote: Well, the problem also exists if add it as an internal database feature --- how long do we wait to consider the standby dead, how do we inform administrators, etc. True. Though if there is no secondary connected, either because it's not there yet,

Re: [HACKERS] WIP Patch: Selective binary conversion of CSV file foreign tables

2012-07-12 Thread Tom Lane
"Etsuro Fujita" writes: > Besides the revision, I modified check_selective_binary_conversion() to run > heap_close() in the whole-row-reference case. Attached is an updated version > of > the patch. Applied with minor, mostly-cosmetic revisions. I did fix check_selective_binary_conversion to n

Re: [HACKERS] WIP pgindent replacement

2012-07-12 Thread Bruce Momjian
On Wed, Jun 22, 2011 at 10:16:28AM -0400, Bruce Momjian wrote: > Andrew Dunstan wrote: > > >> Further research shows that C89 explicitly dropped support for the old > > >> K&R "=-" operator, so we probably *should* remove this in case it > > >> introduces an unintended bug. > > > Well, the point is

Re: [HACKERS] [PATCH] lock_timeout and common SIGALRM framework

2012-07-12 Thread Tom Lane
Here is a revised version of the timeout-infrastructure patch. I whacked it around quite a bit, notably: * I decided that the most convenient way to handle the initialization issue was to combine establishment of the signal handler with resetting of the per-process variables. So handle_sig_alarm

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Bruce Momjian
On Thu, Jul 12, 2012 at 08:21:08AM -0500, Shaun Thomas wrote: > >But, putting that aside, why not write a piece of middleware that > >does precisely this, or whatever you want? It can live on the same > >machine as Postgres and ack synchronous commit when nobody is home, > >and notify (e.g. page) y

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Bruce Momjian
On Thu, Jul 12, 2012 at 11:33:26AM +0530, Amit Kapila wrote: > > From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] > > On Behalf Of Jose Ildefonso Camargo Tolosa > > > Please, stop arguing on all of this: I don't think that adding an > > option will hurt anybo

Re: [HACKERS] several problems in pg_receivexlog

2012-07-12 Thread Magnus Hagander
On Thu, Jul 12, 2012 at 6:07 PM, Fujii Masao wrote: > On Thu, Jul 12, 2012 at 8:39 PM, Magnus Hagander wrote: >> On Tue, Jul 10, 2012 at 7:03 PM, Fujii Masao wrote: >>> On Tue, Jul 10, 2012 at 3:23 AM, Fujii Masao wrote: Hi, I found several problems in pg_receivexlog, e.g., memor

Re: [HACKERS] several problems in pg_receivexlog

2012-07-12 Thread Fujii Masao
On Thu, Jul 12, 2012 at 8:39 PM, Magnus Hagander wrote: > On Tue, Jul 10, 2012 at 7:03 PM, Fujii Masao wrote: >> On Tue, Jul 10, 2012 at 3:23 AM, Fujii Masao wrote: >>> Hi, >>> >>> I found several problems in pg_receivexlog, e.g., memory leaks, >>> file-descripter leaks, ..etc. The attached patc

Re: [HACKERS] Schema version management

2012-07-12 Thread Andrew Dunstan
On 07/12/2012 10:01 AM, Tom Lane wrote: FWIW, I think you could save a level of naming if you were willing to put the type first, since the type would imply whether the object lives in a schema or not: [type]/[name].sql [type]/[schema]/[name].sql T

Re: [HACKERS] Schema version management

2012-07-12 Thread Joel Jacobson
On Thu, Jul 12, 2012 at 4:01 PM, Tom Lane wrote: > FWIW, I think you could save a level of naming if you were willing to > put the type first, since the type would imply whether the object > lives in a schema or not: > > [type]/[name].sql > [type]/[schema]/[name].sql > > Could wor

Re: [HACKERS] Schema version management

2012-07-12 Thread Tom Lane
Joel Jacobson writes: > On Thursday, July 12, 2012, Tom Lane wrote: >> What are you going to do with objects that don't have schemas? >> (Including, but not restricted to, the schemas themselves.) > Good question. Maybe something like this? > For objects without schema: > /global/[type]/[name].s

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Aidan Van Dyk
On Thu, Jul 12, 2012 at 9:21 AM, Shaun Thomas wrote: > So far as transaction durability is concerned... we have a continuous > background rsync over dark fiber for archived transaction logs, DRBD for > block-level sync, filesystem snapshots for our backups, a redundant async DR > cluster, an offs

Re: [HACKERS] Schema version management

2012-07-12 Thread Joel Jacobson
On Thursday, July 12, 2012, Tom Lane wrote: > > What are you going to do with objects that don't have schemas? > (Including, but not restricted to, the schemas themselves.) > Good question. Maybe something like this? For objects without schema: /global/[type]/[name].sql For objects with schema:

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-07-12 Thread Heikki Linnakangas
On 09.07.2012 11:35, Shigeru HANADA wrote: Once the issues above are fixed, IMO this patch can be marked as "Ready for committer". Thanks. The docs on async connections says: "The connect_timeout connection parameter is ignored when using PQconnectPoll; it is the application's responsibility

Re: [HACKERS] Schema version management

2012-07-12 Thread Tom Lane
Joel Jacobson writes: > I think the directory structure [schema]/[type]/[name] should be the same > for all object types. I don't like "operator" being part of the filename, > it should be the directory name. What are you going to do with objects that don't have schemas? (Including, but not restr

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Shaun Thomas
On 07/12/2012 12:31 AM, Daniel Farina wrote: But RAID-1 as nominally seen is a fundamentally different problem, with much tinier differences in latency, bandwidth, and connectivity. Perhaps useful for study, but to suggest the problem is *that* similar I think is wrong. Well, yes and no. One o

Re: [HACKERS] PG9.2 and FDW query planning.

2012-07-12 Thread Ronan Dunklau
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/07/2012 18:30, Tom Lane wrote: > Ronan Dunklau writes: >> Let's say I have an IMAP foreign data wrapper, and I write a >> query joining the table on itself using the In-Reply-To and >> Message-ID headers, is there anything I can do to avoid fetc

Re: [HACKERS] Synchronous Standalone Master Redoux

2012-07-12 Thread Dimitri Fontaine
Hi, Jose Ildefonso Camargo Tolosa writes: > environments. And no, it doesn't makes synchronous replication > meaningless, because it will work synchronous if it have someone to > sync to, and work async (or standalone) if it doesn't: that's perfect > for HA environment. You seem to want Service

Re: [HACKERS] pgsql_fdw in contrib

2012-07-12 Thread Kohei KaiGai
2012/7/12 Shigeru HANADA : > (2012/07/12 6:04), Peter Eisentraut wrote: >> On tor, 2012-06-14 at 21:29 +0900, Shigeru HANADA wrote: >>> I'd like to propose pgsql_fdw, FDW for PostgreSQL, as a contrib module >>> in core, again. >> >> Do you have any new proposals regarding naming, and how to deal wi

Re: [HACKERS] several problems in pg_receivexlog

2012-07-12 Thread Magnus Hagander
On Tue, Jul 10, 2012 at 7:03 PM, Fujii Masao wrote: > On Tue, Jul 10, 2012 at 3:23 AM, Fujii Masao wrote: >> Hi, >> >> I found several problems in pg_receivexlog, e.g., memory leaks, >> file-descripter leaks, ..etc. The attached patch fixes these problems. >> >> ISTM there are still some other pr

Re: [HACKERS] several problems in pg_receivexlog

2012-07-12 Thread Magnus Hagander
On Tue, Jul 10, 2012 at 6:45 PM, Fujii Masao wrote: > On Tue, Jul 10, 2012 at 6:27 AM, Magnus Hagander wrote: >> On Mon, Jul 9, 2012 at 8:23 PM, Fujii Masao wrote: >>> Hi, >>> >>> I found several problems in pg_receivexlog, e.g., memory leaks, >>> file-descripter leaks, ..etc. The attached patch

Re: [HACKERS] pgsql_fdw in contrib

2012-07-12 Thread Shigeru HANADA
(2012/07/12 6:04), Peter Eisentraut wrote: > On tor, 2012-06-14 at 21:29 +0900, Shigeru HANADA wrote: >> I'd like to propose pgsql_fdw, FDW for PostgreSQL, as a contrib module >> in core, again. > > Do you have any new proposals regarding naming, and how to deal with > postgresql_fdw_validator, an

Re: [HACKERS] pgsql_fdw in contrib

2012-07-12 Thread Etsuro Fujita
> 2012/6/26 Kohei KaiGai : > > Harada-san, > > > > I checked your patch, and had an impression that includes many > > improvements from the previous revision that I looked at the last > > commit fest. > > > > However, I noticed several points to be revised, or investigated. > > > > * It seems to me

Re: [HACKERS] Scheduled back-branch releases?

2012-07-12 Thread Magnus Hagander
On Thu, Jul 12, 2012 at 11:41 AM, Bernd Helmle wrote: > Do we have a schedule for when next back-branch releases are packaged (i hope > i > didn't miss any announcement...)? No, there is no such schedule (yet). -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.

[HACKERS] Scheduled back-branch releases?

2012-07-12 Thread Bernd Helmle
Do we have a schedule for when next back-branch releases are packaged (i hope i didn't miss any announcement...)? -- Thanks Bernd -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Re: [COMMITTERS] pgsql: Fix mapping of PostgreSQL encodings to Python encodings.

2012-07-12 Thread Heikki Linnakangas
On 07.07.2012 00:12, Jan Urbański wrote: On 06/07/12 22:47, Peter Eisentraut wrote: On fre, 2012-07-06 at 18:53 +0300, Heikki Linnakangas wrote: What shall we do about those? Ignore them? Document that if you're sing one of these encodings then PL/Python with Python 2 will be crippled and with

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-12 Thread Heikki Linnakangas
On 07.07.2012 01:03, Peter Eisentraut wrote: On tis, 2012-07-03 at 14:52 -0400, Tom Lane wrote: Peter Eisentraut writes: On tis, 2012-07-03 at 19:35 +0200, Andres Freund wrote: I wonder if we just should add a format code like %R or something similar as a replacement for the %X/%X notion.

[HACKERS] Logging both start and end of temporary file usage

2012-07-12 Thread Christophe Pettus
In working with s a client to analyze their temp file usage, it became useful to know when a temporary file was created as well as when it was closed. That way, we could process the logs to determine a high water mark of overall temp file usage, to know how high it was safe (in that workload) t