Re: [HACKERS] On partitioning

2014-09-18 Thread Amit Langote
> -Original Message- > From: pgsql-hackers-ow...@postgresql.org [mailto:pgsql-hackers- > ow...@postgresql.org] On Behalf Of Amit Langote > Sent: Friday, September 19, 2014 2:13 PM > To: robertmh...@gmail.com > Cc: pgsql-hackers@postgresql.org; br...@momjian.us; t...@sss.pgh.pa.us; > alvhe

Re: [HACKERS] On partitioning

2014-09-18 Thread Amit Langote
Hi, I tend to agree with Robert that partitioning should continue using inheritance based implementation. In addition to his point about reinventing things it could be pointed out that there are discussions/proposals elsewhere about building foreign table inheritance capability; having partitionin

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Pavel Stehule
2014-09-18 22:35 GMT+02:00 Josh Berkus : > On 09/18/2014 01:29 PM, Vik Fearing wrote: > > On 09/18/2014 10:16 PM, Hannu Krosing wrote: > >>> WITH > >>> FUNCTION f1(a int) RETURNS int AS $$ .. $$ LANGUAGE plpgsql, > >>> FUNCTION f2(a int) RETURNS SETOF int AS $$ .. $$ LANGUAGE > >

Re: [HACKERS] Final Patch for GROUPING SETS

2014-09-18 Thread Andrew Gierth
> "Marti" == Marti Raudsepp writes: Marti> Since you were asking for feedback on the EXPLAIN output on Marti> IRC, I'd weigh in and say that having the groups on separate Marti> lines would be significantly more readable. I revisited the explain output a bit and have come up with these (s

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Hannu Krosing
On 09/19/2014 12:14 AM, Hannu Krosing wrote: > On 09/18/2014 10:40 PM, Marko Tiikkaja wrote: >> On 2014-09-18 10:29 PM, Vik Fearing wrote: >>> On 09/18/2014 10:16 PM, Hannu Krosing wrote: I guess it proves (a little) that WITH is the right place to do these kind of things ... >>> I've bee

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Hannu Krosing
On 09/18/2014 10:40 PM, Marko Tiikkaja wrote: > On 2014-09-18 10:29 PM, Vik Fearing wrote: >> On 09/18/2014 10:16 PM, Hannu Krosing wrote: >>> I guess it proves (a little) that WITH is the right place to do these >>> kind of things ... >> >> I've been wanting this syntax for a few years now, so I c

Re: [HACKERS] [GENERAL] [SQL] pg_multixact issues

2014-09-18 Thread Adrian Klaver
On 09/18/2014 10:22 AM, Dev Kumkar wrote: On Thu, Sep 18, 2014 at 6:20 PM, Dev Kumkar mailto:devdas.kum...@gmail.com>> wrote: On Thu, Sep 18, 2014 at 4:03 PM, Andres Freund mailto:and...@2ndquadrant.com>> wrote: I don't think that's relevant for you. Did you upgrade the

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Marko Tiikkaja
On 2014-09-18 10:29 PM, Vik Fearing wrote: On 09/18/2014 10:16 PM, Hannu Krosing wrote: I guess it proves (a little) that WITH is the right place to do these kind of things ... I've been wanting this syntax for a few years now, so I certainly vote for it. I've also been wanting do to somethi

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Josh Berkus
On 09/18/2014 01:29 PM, Vik Fearing wrote: > On 09/18/2014 10:16 PM, Hannu Krosing wrote: >>> WITH >>> FUNCTION f1(a int) RETURNS int AS $$ .. $$ LANGUAGE plpgsql, >>> FUNCTION f2(a int) RETURNS SETOF int AS $$ .. $$ LANGUAGE >>> plpgsql, >>> SELECT f1(x) FROM f2(z) LATERAL

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Vik Fearing
On 09/18/2014 10:16 PM, Hannu Krosing wrote: > On 09/18/2014 02:37 PM, Pavel Stehule wrote: >> >> if we would to need a "single use" function, then we should to >> implement it, and we should not to rape some different objects. Some, >> what has behave like function should be function. >> >> After

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Josh Berkus
On 09/18/2014 01:10 PM, Hannu Krosing wrote: > One possible syntax would be extending WITH to somehow enable on-spot > functions in addition to on-spot views > > WITH FUNCTION myfunc(...) RETURNS TABLE(...) LANGUAGE plpgsql AS $$ > ... > $$ > SELECT f.* > FROM myfunc(x,y,z); Oh! Awesome! --

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Hannu Krosing
On 09/18/2014 02:37 PM, Pavel Stehule wrote: > > if we would to need a "single use" function, then we should to > implement it, and we should not to rape some different objects. Some, > what has behave like function should be function. > > After some thinking, probably CTE design can be only one fr

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Hannu Krosing
On 09/18/2014 08:41 PM, Andrew Dunstan wrote: > > On 09/18/2014 07:40 AM, Andres Freund wrote: >> On 2014-09-17 22:17:22 +0200, Pavel Stehule wrote: >>> 2014-09-17 22:07 GMT+02:00 Vik Fearing : >>> On 09/16/2014 10:09 AM, Heikki Linnakangas wrote: > On 09/16/2014 10:57 AM, Craig Ringer wro

Re: [HACKERS] Collations and Replication; Next Steps

2014-09-18 Thread Peter Geoghegan
On Thu, Sep 18, 2014 at 6:51 AM, Heikki Linnakangas wrote: > The same it works with libxml, openssl, libreadline and all the other > libraries you can build with. I like the comparison with libxml. If we were to adopt ICU, it would be as a core component that makes collation versioning work, that

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Andrew Dunstan
On 09/18/2014 07:40 AM, Andres Freund wrote: On 2014-09-17 22:17:22 +0200, Pavel Stehule wrote: 2014-09-17 22:07 GMT+02:00 Vik Fearing : On 09/16/2014 10:09 AM, Heikki Linnakangas wrote: On 09/16/2014 10:57 AM, Craig Ringer wrote: On 09/16/2014 03:15 PM, Pavel Stehule wrote: Why we don't

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-09-18 Thread Heikki Linnakangas
On 09/18/2014 07:53 PM, Josh Berkus wrote: On 09/16/2014 08:45 PM, Tom Lane wrote: We're somewhat comparing apples and oranges here, in that I pushed my approach to something that I think is of committable quality (and which, not incidentally, fixes some existing bugs that we'd need to fix in an

Re: [HACKERS] [GENERAL] [SQL] pg_multixact issues

2014-09-18 Thread Dev Kumkar
On Thu, Sep 18, 2014 at 6:20 PM, Dev Kumkar wrote: > On Thu, Sep 18, 2014 at 4:03 PM, Andres Freund > wrote: > >> I don't think that's relevant for you. >> >> Did you upgrade the database using pg_upgrade? >> > > That's correct! No, there is no upgrade here. > > >> Can you show pg_controldata ou

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-09-18 Thread Josh Berkus
On 09/16/2014 08:45 PM, Tom Lane wrote: > We're somewhat comparing apples and oranges here, in that I pushed my > approach to something that I think is of committable quality (and which, > not incidentally, fixes some existing bugs that we'd need to fix in any > case); while Heikki's patch was just

[HACKERS] BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)

2014-09-18 Thread Jehan-Guillaume de Rorthais
Hi hackers, We spend some time with Guillaume Lelarge studying this issue. CreateRestartPoint() calls RemoveOldXlogFiles() to drop/recycle old WALs. This one is calling XLogArchiveCheckDone() to check if the given WAL can be dropped. As our slave has "archive_mode" & "archive_command" set, XLogAr

Re: [HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Michael Paquier
On Thu, Sep 18, 2014 at 9:56 AM, Andres Freund wrote: > On 2014-09-18 09:50:38 -0500, Michael Paquier wrote: >> > Do you see the difference between what your doc patch states and the >> > explanation I've given nearby in this thread? >> Perhaps that's the lack of documentation... > > Man. I've exp

Re: [HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Andres Freund
On 2014-09-18 09:50:38 -0500, Michael Paquier wrote: > > Do you see the difference between what your doc patch states and the > > explanation I've given nearby in this thread? > Perhaps that's the lack of documentation... Man. I've explained it to you about three times. The previous attempts at do

Re: [HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Michael Paquier
On Thu, Sep 18, 2014 at 9:23 AM, Andres Freund wrote: > On 2014-09-18 09:13:48 -0500, Michael Paquier wrote: >> > On Thu, Sep 18, 2014 at 2:18 AM, Andres Freund >> > wrote: >> >> Improving the docs here is on my roadmap, but I don't see the benefit of >> >> this. >> Btw, I sent a couple of weeks

Re: [HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Andres Freund
On 2014-09-18 09:13:48 -0500, Michael Paquier wrote: > > On Thu, Sep 18, 2014 at 2:18 AM, Andres Freund > > wrote: > >> Improving the docs here is on my roadmap, but I don't see the benefit of > >> this. > Btw, I sent a couple of weeks back a patch that was an attempt to > improve this portion of

Re: [HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Michael Paquier
> On Thu, Sep 18, 2014 at 2:18 AM, Andres Freund wrote: >> Improving the docs here is on my roadmap, but I don't see the benefit of >> this. Btw, I sent a couple of weeks back a patch that was an attempt to improve this portion of the docs, feel free to have a look if that helps :) http://www.post

Re: [HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Andres Freund
On 2014-09-18 08:57:26 -0500, Michael Paquier wrote: > On Thu, Sep 18, 2014 at 2:18 AM, Andres Freund wrote: > > The point is that operating with byteas on SQL level is freaking > > painful. > An example perhaps? I fail to see why it is related to the fact that a > user could simply use that to fe

Re: [HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Michael Paquier
On Thu, Sep 18, 2014 at 2:18 AM, Andres Freund wrote: > The point is that operating with byteas on SQL level is freaking > painful. An example perhaps? I fail to see why it is related to the fact that a user could simply use that to fetch changes in bytea from a slot: select data::bytea from pg_lo

Re: [HACKERS] Collations and Replication; Next Steps

2014-09-18 Thread Heikki Linnakangas
On 09/18/2014 04:12 PM, Oleg Bartunov wrote: On Thu, Sep 18, 2014 at 3:25 PM, Martijn van Oosterhout wrote: On Thu, Sep 18, 2014 at 01:35:10PM +0900, Tatsuo Ishii wrote: In my understanding PostgreSQL's manual MUST include the ICU license term (this is not a problem). What I am not so sure i

Re: [HACKERS] Collations and Replication; Next Steps

2014-09-18 Thread Oleg Bartunov
On Thu, Sep 18, 2014 at 3:25 PM, Martijn van Oosterhout wrote: > On Thu, Sep 18, 2014 at 01:35:10PM +0900, Tatsuo Ishii wrote: > > In my understanding PostgreSQL's manual MUST include the ICU license > > term (this is not a problem). What I am not so sure is, any software > > uses PostgreSQL als

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Pavel Stehule
2014-09-18 13:59 GMT+02:00 Pavel Stehule : > > > 2014-09-18 13:53 GMT+02:00 Andres Freund : > >> On 2014-09-18 13:51:56 +0200, Pavel Stehule wrote: >> > 2014-09-18 13:48 GMT+02:00 Andres Freund : >> > >> > > On 2014-09-18 13:44:47 +0200, Pavel Stehule wrote: >> > > Isn't being able to do this on a

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Pavel Stehule
2014-09-18 13:53 GMT+02:00 Andres Freund : > On 2014-09-18 13:51:56 +0200, Pavel Stehule wrote: > > 2014-09-18 13:48 GMT+02:00 Andres Freund : > > > > > On 2014-09-18 13:44:47 +0200, Pavel Stehule wrote: > > > Isn't being able to do this on a standby a fundamental enough > advantage? > > > Being s

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Andres Freund
On 2014-09-18 13:51:56 +0200, Pavel Stehule wrote: > 2014-09-18 13:48 GMT+02:00 Andres Freund : > > > On 2014-09-18 13:44:47 +0200, Pavel Stehule wrote: > > Isn't being able to do this on a standby a fundamental enough advantage? > > Being significantly cheaper? Needing fewer roundtrips? > > > >

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Pavel Stehule
2014-09-18 13:48 GMT+02:00 Andres Freund : > On 2014-09-18 13:44:47 +0200, Pavel Stehule wrote: > > 2014-09-18 13:40 GMT+02:00 Andres Freund : > > > > > On 2014-09-17 22:17:22 +0200, Pavel Stehule wrote: > > > > 2014-09-17 22:07 GMT+02:00 Vik Fearing : > > > I fail to see why that is so much prefe

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Marko Tiikkaja
On 9/18/14 1:35 PM, Martijn van Oosterhout wrote: On Wed, Sep 17, 2014 at 10:17:22PM +0200, Pavel Stehule wrote: Because you still have to do SELECT pg_temp.my_temp_function(blah); to execute it. this problem should be solvable. I can to use a temporary tables without using pg_temp sch

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Andres Freund
On 2014-09-18 13:44:47 +0200, Pavel Stehule wrote: > 2014-09-18 13:40 GMT+02:00 Andres Freund : > > > On 2014-09-17 22:17:22 +0200, Pavel Stehule wrote: > > > 2014-09-17 22:07 GMT+02:00 Vik Fearing : > > I fail to see why that is so much preferrable for you to passing > > parameter to DO? > > >

Re: [HACKERS] Collations and Replication; Next Steps

2014-09-18 Thread Martijn van Oosterhout
On Wed, Sep 17, 2014 at 03:57:38PM +0100, Greg Stark wrote: > Then there's the concern that ICU is a *huge* dependency. ICU is > itself larger than the entire Postgres install. It's a big burden on > users to have to install and configure a second collation library in > addition to the system libra

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Pavel Stehule
2014-09-18 13:40 GMT+02:00 Andres Freund : > On 2014-09-17 22:17:22 +0200, Pavel Stehule wrote: > > 2014-09-17 22:07 GMT+02:00 Vik Fearing : > > > > > On 09/16/2014 10:09 AM, Heikki Linnakangas wrote: > > > > On 09/16/2014 10:57 AM, Craig Ringer wrote: > > > >> On 09/16/2014 03:15 PM, Pavel Stehul

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Andres Freund
On 2014-09-17 22:17:22 +0200, Pavel Stehule wrote: > 2014-09-17 22:07 GMT+02:00 Vik Fearing : > > > On 09/16/2014 10:09 AM, Heikki Linnakangas wrote: > > > On 09/16/2014 10:57 AM, Craig Ringer wrote: > > >> On 09/16/2014 03:15 PM, Pavel Stehule wrote: > > >> > > >>> Why we don't introduce a tempor

Re: [HACKERS] Anonymous code block with parameters

2014-09-18 Thread Martijn van Oosterhout
On Wed, Sep 17, 2014 at 10:17:22PM +0200, Pavel Stehule wrote: > > Because you still have to do > > > > SELECT pg_temp.my_temp_function(blah); > > > > to execute it. > > > > this problem should be solvable. I can to use a temporary tables without > using pg_temp schema. Umm, IIRC it used to w

Re: [HACKERS] Collations and Replication; Next Steps

2014-09-18 Thread Martijn van Oosterhout
On Thu, Sep 18, 2014 at 01:35:10PM +0900, Tatsuo Ishii wrote: > In my understanding PostgreSQL's manual MUST include the ICU license > term (this is not a problem). What I am not so sure is, any software > uses PostgreSQL also MUST include the ICU license or not. If yes, I > think this is surely a

Re: [HACKERS] proposal (9.5) : psql unicode border line styles

2014-09-18 Thread Pavel Stehule
2014-09-18 12:51 GMT+02:00 Andres Freund : > On 2014-09-18 12:47:25 +0200, Pavel Stehule wrote: > > - output = PageOutput(81, pager); > > + output = PageOutput(87, pager); > > > > fprintf(output, _("List of specially treated variables.\n")); > > > > @@ -364,6 +364,10 @@ helpVariables

Re: [HACKERS] proposal (9.5) : psql unicode border line styles

2014-09-18 Thread Andres Freund
On 2014-09-18 12:47:25 +0200, Pavel Stehule wrote: > - output = PageOutput(81, pager); > + output = PageOutput(87, pager); > > fprintf(output, _("List of specially treated variables.\n")); > > @@ -364,6 +364,10 @@ helpVariables(unsigned short int pager) >

Re: [HACKERS] proposal (9.5) : psql unicode border line styles

2014-09-18 Thread Pavel Stehule
Hi Stephen I forgot to fix new enhanced pset help fix attached Regards Pavel 2014-09-12 18:15 GMT+02:00 Pavel Stehule : > > > 2014-09-12 18:09 GMT+02:00 Stephen Frost : > >> * Stephen Frost (sfr...@snowman.net) wrote: >> > * Pavel Stehule (pavel.steh...@gmail.com) wrote: >> > > I though abo

Re: [HACKERS] [TODO] Process pg_hba.conf keywords as case-insensitive

2014-09-18 Thread Kyotaro HORIGUCHI
Hi, This is revised patch including document. I confused three identifiers to be compared, names in the catalog, those in pg_hba lines and those given from the client under connecting. This patch concerns the comparison between pg_hba and client names. Finally all the additional pg_strcasecmp() o

Re: [HACKERS] New developer TODO suggestions

2014-09-18 Thread Andres Freund
On 2014-09-18 17:30:38 +0800, Craig Ringer wrote: > On 07/29/2014 10:43 PM, Bruce Momjian wrote: > >> > * When a user tries to run "psql -f some_custom_format_backup", detect > >> > this and emit a useful error message. Ditto stdin. > > > > Uh, good idea, but can we really do that in psql? > > Whe

Re: [HACKERS] New developer TODO suggestions

2014-09-18 Thread Craig Ringer
On 07/29/2014 10:43 PM, Bruce Momjian wrote: >> > * When a user tries to run "psql -f some_custom_format_backup", detect >> > this and emit a useful error message. Ditto stdin. > > Uh, good idea, but can we really do that in psql? Where stdin is a file, or an explicit -f is given, then yes. Just

Re: [HACKERS] END_OF_RECOVERY shutdowns and ResetUnloggedRelations()

2014-09-18 Thread Andres Freund
On 2014-09-12 14:44:48 -0400, Robert Haas wrote: > On Fri, Sep 12, 2014 at 7:22 AM, Andres Freund wrote: > > What I like even less is that pg_control is actually marked as > > DB_SHUTDOWNED due to END_OF_RECOVERY. That's just plain wrong. Obviously > > the database was *NOT* shutdown peacefully. I

Re: [HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Andres Freund
Hi, On 2014-09-18 02:14:48 -0500, Michael Paquier wrote: > As there has been a dump of CATALOG_VERSION_NO on REL9_4_STABLE > recently, I am coming back to the options OUTPUT_PLUGIN_* that are > rather confusing for developers of decoder plugins. In short, when > extracting changes from a replicati

[HACKERS] Options OUTPUT_PLUGIN_* controlling format are confusing (Was: Misleading error message in logical decoding)

2014-09-18 Thread Michael Paquier
Hi all, As there has been a dump of CATALOG_VERSION_NO on REL9_4_STABLE recently, I am coming back to the options OUTPUT_PLUGIN_* that are rather confusing for developers of decoder plugins. In short, when extracting changes from a replication slot, a decoder plugin is free to set one option that