Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Merlin Moncure
On Fri, Feb 28, 2014 at 1:45 PM, Andrew Dunstan wrote: > Well, the jsonb portion of this is arguably the most ready, certainly it's > had a lot more on-list review. That is definitely true. Also, the jsonb type does not introduce any new patterns that are not already covered by json -- it just

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Tom Lane
Andrew Dunstan writes: > That hasn't been the way we've done things in the past. We're frequently > incremental. New features sometimes take several releases to mature. That's perfectly fair. What I don't want to see is a user-visible dependency from jsonb to hstore. I think that'll be a mess

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Andrew Dunstan
On 02/28/2014 02:46 PM, Tom Lane wrote: Josh Berkus writes: ... This requires larger changes to the existing patch, which likely means missing the bus for 9.4 (and you've seen my blog about that) Yeah. I realize you're gung-ho about getting jsonb into 9.4 in some form, and I recognize that g

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Andres Freund
On 2014-02-28 14:45:29 -0500, Andrew Dunstan wrote: > Well, the jsonb portion of this is arguably the most ready, certainly it's > had a lot more on-list review. Having crossread both patches I tend to agree with this. I don't think it's unrealistic to get jsonb committable, but the hstore bits ar

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Peter Geoghegan
On Fri, Feb 28, 2014 at 11:12 AM, Josh Berkus wrote: > I think Robert and Christophe are right: we're building a Berkeley BART > Curve. I think there's two courses of action from here which make sense: > > A) We move *all* of the important HStore libraries and operators into > core, and make the

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Tom Lane
Josh Berkus writes: > ... This requires larger changes to the existing patch, which likely means > missing the bus for 9.4 (and you've seen my blog about that) Yeah. I realize you're gung-ho about getting jsonb into 9.4 in some form, and I recognize that getting better JSON support is important.

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Andrew Dunstan
On 02/28/2014 02:00 PM, Tom Lane wrote: Peter Geoghegan writes: On Fri, Feb 28, 2014 at 5:01 AM, Andrew Dunstan wrote: But anyway, I think we've seen enough of these to conclude that the casts from hstore to jsonb and back should not be implicit. I am fairly confident that changing that woul

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Greg Stark
On Fri, Feb 28, 2014 at 7:12 PM, Josh Berkus wrote: > * As cited, many sysadmins block the install of the -contrib package. Of course the more you put things in core the more you make this logic sound reasonable. -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Josh Berkus
On 02/28/2014 06:27 AM, Robert Haas wrote: > Taken individually, none of those decisions seem crazy, but taken > together it's pretty weird. Instead of inventing a new type (jsonb) > designed from the ground up to do what we want, we're, well, we're > doing what Christophe says: creating our own p

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Tom Lane
Peter Geoghegan writes: > On Fri, Feb 28, 2014 at 5:01 AM, Andrew Dunstan wrote: >> But anyway, I think we've seen enough of these to conclude that the casts >> from hstore to jsonb and back should not be implicit. I am fairly confident >> that changing that would fix your complaint and the simil

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Peter Geoghegan
On Fri, Feb 28, 2014 at 5:01 AM, Andrew Dunstan wrote: > But anyway, I think we've seen enough of these to conclude that the casts > from hstore to jsonb and back should not be implicit. I am fairly confident > that changing that would fix your complaint and the similar one that Peter > Geoghegan

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Josh Berkus
On 02/28/2014 07:39 AM, Joshua D. Drake wrote: > > This is an old and currently false argument. It is true that once upon a > time, contrib was a banished heart, weeping for the attention of a true > prince. Now? Not so much. She is a full on passion flower with the > princes of all the kingdoms w

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Christophe Pettus
On Feb 28, 2014, at 6:27 AM, Robert Haas wrote: > Taken individually, none of those decisions seem crazy, but taken > together it's pretty weird. Instead of inventing a new type (jsonb) > designed from the ground up to do what we want, we're, well, we're > doing what Christophe says: creating o

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Teodor Sigaev
+v.size += VARSIZE_ANY(v.numeric) +sizeof(JEntry) /* alignment */ ; Why does + sizeof(JEntry) change anything about alignment? If it was aligned before, adding a statically sized value doesn't give any new guarantees about alignment? Teodor, please comment. Because numeric type wil

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Merlin Moncure
On Fri, Feb 28, 2014 at 8:57 AM, Stephen Frost wrote: > The specific issues mentioned on this thread look more like bugs to be > addressed or additional operators which need to be implemented for > jsonb (imv, that should really be done for 9.4, but we have this > deadline looming...) along with p

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Joshua D. Drake
On 02/27/2014 11:02 PM, Christophe Pettus wrote: On Feb 27, 2014, at 9:59 PM, Peter Geoghegan wrote: I don't find that very reassuring. Obviously, we have to try it, and that will decide it. I don't understand why an extension is seen as not befitting of a more important feature. cont

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > Taken individually, none of those decisions seem crazy, but taken > together it's pretty weird. Instead of inventing a new type (jsonb) > designed from the ground up to do what we want, we're, well, we're > doing what Christophe says: creating our own

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Andrew Dunstan
On 02/28/2014 09:27 AM, Robert Haas wrote: On Thu, Feb 27, 2014 at 8:55 PM, Christophe Pettus wrote: On Feb 27, 2014, at 5:31 PM, Peter Geoghegan wrote: Now, it's confusing that it has to go through hstore, perhaps, but that's hardly all that bad in and of itself. Yes, it is. It strikes me

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Robert Haas
On Thu, Feb 27, 2014 at 8:55 PM, Christophe Pettus wrote: > On Feb 27, 2014, at 5:31 PM, Peter Geoghegan wrote: >> Now, it's confusing that it has to go through hstore, perhaps, but >> that's hardly all that bad in and of itself. > > Yes, it is. It strikes me as irrational to have jsonb depend o

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Stephen Frost
* Peter Geoghegan (p...@heroku.com) wrote: > On Thu, Feb 27, 2014 at 8:07 PM, Peter Geoghegan wrote: > > I'm not advocating authoring two extensions. I am tentatively > > suggesting that we look at one extension for everything. That may well > > be the least worst thing. > > (Not that it's clear

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Andrew Dunstan
On 02/28/2014 07:19 AM, Thom Brown wrote: On 28 February 2014 08:12, Andres Freund > wrote: On 2014-02-27 15:06:33 -0500, Andrew Dunstan wrote: > You realize that this API dates from 9.3 and has been used in numerous > extensions, right? So the nam

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Thom Brown
On 28 February 2014 13:01, Andrew Dunstan wrote: > > On 02/28/2014 07:19 AM, Thom Brown wrote: > > On 28 February 2014 08:12, Andres Freund > and...@2ndquadrant.com>> wrote: >> >> On 2014-02-27 15:06:33 -0500, Andrew Dunstan wrote: >> > You realize that this API dates from 9.3 and has be

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Thom Brown
On 28 February 2014 08:12, Andres Freund wrote: > On 2014-02-27 15:06:33 -0500, Andrew Dunstan wrote: > > You realize that this API dates from 9.3 and has been used in numerous > > extensions, right? So the names are pretty well fixed, for good or ill. > > Sure. Doesn't prevent adding a couple mo

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Andres Freund
On 2014-02-27 15:06:33 -0500, Andrew Dunstan wrote: > You realize that this API dates from 9.3 and has been used in numerous > extensions, right? So the names are pretty well fixed, for good or ill. Sure. Doesn't prevent adding a couple more comments tho. I've only noticed this because I opened th

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Peter Geoghegan
On Fri, Feb 28, 2014 at 12:01 AM, Andres Freund wrote: > On 2014-02-27 23:54:47 -0800, Peter Geoghegan wrote: >> In any case, as I say, if that's the patch that Andres or Oleg or >> Teodor really want to submit, then by all means let them submit it. > > Just to make that clear, I am not one of the

Re: [HACKERS] jsonb and nested hstore

2014-02-28 Thread Andres Freund
On 2014-02-27 23:54:47 -0800, Peter Geoghegan wrote: > In any case, as I say, if that's the patch that Andres or Oleg or > Teodor really want to submit, then by all means let them submit it. Just to make that clear, I am not one of the authors, I just did a couple of light review passes. Greeting

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 11:36 PM, Christophe Pettus wrote: > There was no technical reason that json couldn't have been an extension, > either, but there were very compelling presentational reasons to have it in > core. jsonb has exactly the same presentational issues. There were also no compe

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Christophe Pettus
On Feb 27, 2014, at 11:15 PM, Peter Geoghegan wrote: > I don't think that's obvious at all. Anyone is free to spend their > time however they please, but personally I don't think that that's a > wise use of anyone's time. I believe you are misunderstanding me. If there are actual technical pro

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 11:02 PM, Christophe Pettus wrote: > On Feb 27, 2014, at 9:59 PM, Peter Geoghegan wrote: >> I don't find that very reassuring. > > Obviously, we have to try it, and that will decide it. I don't think that's obvious at all. Anyone is free to spend their time however they p

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Heikki Linnakangas
On 02/28/2014 09:02 AM, Christophe Pettus wrote: contrib/ is considered a secondary set of features; I routinely get pushback from clients about using hstore because it's not in core, and they are thus suspicious of it. The educational project required to change that far exceeds any technical

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Christophe Pettus
On Feb 27, 2014, at 9:59 PM, Peter Geoghegan wrote: > I don't find that very reassuring. Obviously, we have to try it, and that will decide it. > I don't understand why an extension is seen as not befitting > of a more important feature. contrib/ is considered a secondary set of features; I r

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Andres Freund
On 2014-02-27 22:10:22 -0500, Peter Eisentraut wrote: > On 2/26/14, 10:42 PM, Andrew Dunstan wrote: > > Extensions can't call each other's code. > > That's not necessarily so. I don't think we have portable infrastructure to it properly yet, without a detour via the fmgr. If I am wrong, what's th

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 9:35 PM, Christophe Pettus wrote: >> The only problem with that is now you have to move the implementation >> of ||, plus a bunch of other hstore operators into core. That seems >> like a more difficult direction to move in from a practical >> perspective, and I'm not sure

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Christophe Pettus
On Feb 27, 2014, at 9:28 PM, Peter Geoghegan wrote: > The only problem with that is now you have to move the implementation > of ||, plus a bunch of other hstore operators into core. That seems > like a more difficult direction to move in from a practical > perspective, and I'm not sure that you

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Christophe Pettus
On Feb 27, 2014, at 9:12 PM, Craig Ringer wrote: > On 02/28/2014 12:43 PM, Christophe Pettus wrote: >> My proposal is that we break the dependencies of jsonb (at least, at the >> user-visible level) on hstore2, thus allowing it in core successfully. jsonb >> || jsonb returning hstore seems lik

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 8:43 PM, Christophe Pettus wrote: >> I'm not the one opposed to putting jsonb stuff in the hstore module! > > My proposal is that we break the dependencies of jsonb (at least, at the > user-visible level) on > hstore2, thus allowing it in core successfully. jsonb || jsonb

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Craig Ringer
On 02/28/2014 12:43 PM, Christophe Pettus wrote: > My proposal is that we break the dependencies of jsonb (at least, at the > user-visible level) on hstore2, thus allowing it in core successfully. jsonb > || jsonb returning hstore seems like a bug to me, not a feature we should be > supporting.

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Christophe Pettus
On Feb 27, 2014, at 8:31 PM, Peter Geoghegan wrote: > On Thu, Feb 27, 2014 at 8:23 PM, Christophe Pettus wrote: >> Surely, the answer is to define a jsonb || jsonb (and likely the other >> combinatorics of json and jsonb), along with the appropriate GIN and GiST >> interfaces for jsonb. Why

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 8:23 PM, Christophe Pettus wrote: > On Feb 27, 2014, at 8:04 PM, Peter Geoghegan wrote: > >> I'm hearing a lot about how important jsonb is, but not much on how to >> make the simple jsonb cases that are currently broken (as illustrated >> by my earlier examples [1], [2])

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Christophe Pettus
On Feb 27, 2014, at 8:04 PM, Peter Geoghegan wrote: > I'm hearing a lot about how important jsonb is, but not much on how to > make the simple jsonb cases that are currently broken (as illustrated > by my earlier examples [1], [2]) work. Surely, the answer is to define a jsonb || jsonb (and lik

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Joshua D. Drake
On 02/27/2014 05:54 PM, Josh Berkus wrote: And it's not just that "broadly speaking most people would prefer the interface to speak JSON"; it's that a JSONish interface for indexed heirachical data is a Big Feature which will drive adoption among web developers, and hstore2 without JSON sup

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 8:07 PM, Peter Geoghegan wrote: > On Thu, Feb 27, 2014 at 8:05 PM, Stephen Frost wrote: >> And, for my 2c, I'd like to see jsonb as a built-in type *anyway*. Even >> if it's possible to fight with things and make inter-extension >> dependency work, it's not trivial and wo

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 8:05 PM, Stephen Frost wrote: > And, for my 2c, I'd like to see jsonb as a built-in type *anyway*. Even > if it's possible to fight with things and make inter-extension > dependency work, it's not trivial and would likely discourage new > developers trying to use it. I'm

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 7:27 PM, Andrew Dunstan wrote: > On 02/27/2014 10:09 PM, Peter Geoghegan wrote: > >> * It hardly makes any sense to have an in-core jsonb if it comes with >> no batteries included. You need to install hstore for this jsonb >> implementation to be of *any* use anyway. > > >

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Stephen Frost
Peter, * Peter Eisentraut (pete...@gmx.net) wrote: > On 2/27/14, 9:08 PM, Stephen Frost wrote: > > Extensions can't depend on other extensions directly- hence you can't > > write an extension that depends on hstore, which sucks. > > Sure they can, see transforms. > > (Or if you disagree, downloa

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Andrew Dunstan
On 02/27/2014 10:09 PM, Peter Geoghegan wrote: * It hardly makes any sense to have an in-core jsonb if it comes with no batteries included. You need to install hstore for this jsonb implementation to be of *any* use anyway. This is complete nonsense. Right out of the box today a considerable

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Eisentraut
On 2/27/14, 9:08 PM, Stephen Frost wrote: > Extensions can't depend on other extensions directly- hence you can't > write an extension that depends on hstore, which sucks. Sure they can, see transforms. (Or if you disagree, download that patch and demo it, because I'd like to know. ;-) ) -- S

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 5:54 PM, Josh Berkus wrote: > And it's not just that "broadly speaking most people would prefer > the interface to speak JSON"; it's that a JSONish interface for indexed > heirachical data is a Big Feature which will drive adoption among web > developers, and hstore2 withou

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Eisentraut
On 2/26/14, 10:42 PM, Andrew Dunstan wrote: > Extensions can't call each other's code. That's not necessarily so. -- 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] jsonb and nested hstore

2014-02-27 Thread Peter Eisentraut
On 2/27/14, 2:11 PM, Josh Berkus wrote: > This means that, if we have jsonb as an extension, we'll > eventually be in the position where the recommended json type with all > the features is an extension, whereas the legacy json type is in core. Well that wouldn't be a new situation. Compare geome

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Stephen Frost
* Peter Geoghegan (p...@heroku.com) wrote: > On Thu, Feb 27, 2014 at 6:08 PM, Stephen Frost wrote: > > Extensions can't depend on other extensions directly- hence you can't > > write an extension that depends on hstore, which sucks. It'd be > > preferrable to not have that issue w/ json/jsonb/wha

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 6:08 PM, Stephen Frost wrote: >> On Thu, Feb 27, 2014 at 6:02 PM, Craig Ringer wrote: >> > It's also make it a lot harder to use in other extensions, something >> > that's already an issue with hstore. >> >> What do you mean? > > Extensions can't depend on other extensions

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Stephen Frost
* Peter Geoghegan (p...@heroku.com) wrote: > On Thu, Feb 27, 2014 at 6:02 PM, Craig Ringer wrote: > > It's also make it a lot harder to use in other extensions, something > > that's already an issue with hstore. > > What do you mean? Extensions can't depend on other extensions directly- hence yo

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 6:02 PM, Craig Ringer wrote: > It's also make it a lot harder to use in other extensions, something > that's already an issue with hstore. What do you mean? -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to yo

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Craig Ringer
On 02/28/2014 09:54 AM, Josh Berkus wrote: > On 02/27/2014 01:28 PM, Merlin Moncure wrote: >> How we got here is not the point. All that matters is what's going to >> happen from here. Here are the facts as I see them: > > Well, it certainly matters if we want it in this release. > > As far as

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Christophe Pettus
On Feb 27, 2014, at 5:31 PM, Peter Geoghegan wrote: > Now, it's confusing that it has to go through hstore, perhaps, but > that's hardly all that bad in and of itself. Yes, it is. It strikes me as irrational to have jsonb depend on hstore. Let's be honest with ourselves: if we were starting

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Josh Berkus
On 02/27/2014 01:28 PM, Merlin Moncure wrote: > How we got here is not the point. All that matters is what's going to > happen from here. Here are the facts as I see them: Well, it certainly matters if we want it in this release. As far as I can tell, moving jsonb to contrib basically requires

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 1:28 PM, Merlin Moncure wrote: > 3) In it's current state jsonb is not very useful and we have to > recognize that; it optimizes text json but OTOH covers, maybe 30-40% > of what hstore offers. In particular, it's missing manipulation and > GIST/GIN. The stuff it does off

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 3:54 AM, Robert Haas wrote: > So I tried to tease it out from looking at the patches. As nearly as > I can tell, the reason for making jsonb use hstore's binary format is > because then we can build indexes on jsonbfield::hstore, and the > actual type conversion will be a

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Thu, Feb 27, 2014 at 11:11 AM, Josh Berkus wrote: > Because the course Andrew is following is the one which *this list* > decided on in CF3, no matter that people who participated in that > discussion seem to have collective amnesia. There was a considerable > amount of effort involved in impl

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Merlin Moncure
On Thu, Feb 27, 2014 at 1:11 PM, Josh Berkus wrote: > However, we had this discussion already in November-December, which > resulted in the current patch. Now you and Robert want to change the > rules on Andrew, which means Andrew is ready to quit, and we go another > year without JSON indexing.

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Andrew Dunstan
On 02/26/2014 05:45 PM, Andres Freund wrote: On 2014-02-26 16:23:12 -0500, Andrew Dunstan wrote: On 02/10/2014 09:11 PM, Andres Freund wrote: Is it just me or is jsonapi.h not very well documented? What about it do you think is missing? In any case, it's hardly relevant to this patch, so I'l

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Josh Berkus
On 02/27/2014 01:56 AM, Peter Geoghegan wrote: > I don't understand why you'd consider it to be a matter of shoehorning > jsonb into hstore (and yes, that is what I was suggesting). Because the course Andrew is following is the one which *this list* decided on in CF3, no matter that people who par

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread David E . Wheeler
On Feb 27, 2014, at 3:54 AM, Robert Haas wrote: > It's not very clear to me why we think it's a good idea to share the > tree-ish representation between json and hstore. In deference to your > comments that this has been very publicly discussed over quite a > considerable period, I went back and

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Robert Haas
On Wed, Feb 26, 2014 at 10:42 PM, Andrew Dunstan wrote: >>> Why can't this whole thing be shipped as an extension? It might well >>> be more convenient to have the whole thing packaged as an extension >>> than to have parts of it in core and parts of it not in core. >> >> That's a good question.

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Hannu Krosing
On 02/26/2014 09:17 AM, Christophe Pettus wrote: > On Feb 25, 2014, at 1:57 PM, Hannu Krosing wrote: > >> It is not in any specs, but nevertheless all major imlementations do it and >> some code depends on it. > I have no doubt that some code depends on it, but "all major implementations" > is >

Re: [HACKERS] jsonb and nested hstore

2014-02-27 Thread Peter Geoghegan
On Wed, Feb 26, 2014 at 7:42 PM, Andrew Dunstan wrote: > The jsonb set will get larger as time goes on. I don't think either of you > are thinking very clearly about how we would do this. Extensions can't call > each other's code. So the whole notion we have here of sharing the tree-ish > data rep

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Hannu Krosing
On 02/26/2014 07:41 PM, Josh Berkus wrote: > On 02/26/2014 07:02 AM, Merlin Moncure wrote: >> On Tue, Feb 25, 2014 at 3:57 PM, Hannu Krosing wrote: >>> It is not in any specs, but nevertheless all major imlementations do it and >>> some code depends on it. >>> IIRC, this behaviour is currently als

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Stephen Frost
* Andrew Dunstan (and...@dunslane.net) wrote: > The jsonb set will get larger as time goes on. I don't think either > of you are thinking very clearly about how we would do this. > Extensions can't call each other's code. Yeah, that was puzzling me too. Agree with the rest of your comments as wel

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Andrew Dunstan
On 02/26/2014 09:43 PM, Peter Geoghegan wrote: On Wed, Feb 26, 2014 at 6:29 PM, Robert Haas wrote: Why can't this whole thing be shipped as an extension? It might well be more convenient to have the whole thing packaged as an extension than to have parts of it in core and parts of it not in

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Peter Geoghegan
On Wed, Feb 26, 2014 at 6:29 PM, Robert Haas wrote: > Why can't this whole thing be shipped as an extension? It might well > be more convenient to have the whole thing packaged as an extension > than to have parts of it in core and parts of it not in core. That's a good question. I think having

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Robert Haas
On Wed, Feb 26, 2014 at 3:45 PM, Josh Berkus wrote: > On 02/26/2014 11:39 AM, Merlin Moncure wrote: >> On Wed, Feb 26, 2014 at 12:05 PM, Josh Berkus wrote: >>> On 02/26/2014 09:57 AM, Merlin Moncure wrote: What is not going to be so clear for users (particularly without good supporting

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Andrew Dunstan
On 02/26/2014 08:09 PM, Peter Geoghegan wrote: On Wed, Feb 26, 2014 at 5:06 PM, Alvaro Herrera wrote: I think that this is not a great idea. I think that we should do away with the GUC, but keep the function hstore_print() so we can pretty print that way. I don't believe that this falls afoul

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Peter Geoghegan
On Wed, Feb 26, 2014 at 5:06 PM, Alvaro Herrera wrote: >> I think that this is not a great idea. I think that we should do away >> with the GUC, but keep the function hstore_print() so we can pretty >> print that way. I don't believe that this falls afoul of the usual >> obvious reasons for not va

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Alvaro Herrera
Peter Geoghegan wrote: > On Wed, Feb 26, 2014 at 2:10 PM, Andrew Dunstan wrote: > > new patch attached, change pushed to github. > > > + /* GUC variables */ > > + static bool pretty_print_var = false; > > + #define SET_PRETTY_PRINT_VAR(x) ((pretty_print_var) ? \ > > +

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Alvaro Herrera
Andres Freund wrote: > On 2014-02-26 16:23:12 -0500, Andrew Dunstan wrote: > > >>+ if (va->string.len == vb->string.len) > > >>+ { > > >>+ res = memcmp(va->string.val, vb->string.val, va->string.len); > > >>+ if (res == 0 && arg) > > >>+ *(bool *) arg = true; > > >S

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Peter Geoghegan
On Wed, Feb 26, 2014 at 2:10 PM, Andrew Dunstan wrote: > new patch attached, change pushed to github. > + /* GUC variables */ > + static bool pretty_print_var = false; > + #define SET_PRETTY_PRINT_VAR(x) ((pretty_print_var) ? \ > +

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Andrew Dunstan
On 02/26/2014 05:48 PM, Erik Rijkers wrote: On Wed, February 26, 2014 23:10, Andrew Dunstan wrote: new patch attached, change pushed to github. [jsonb-13.patch.gz] This does not apply, see attached: src/backend/utils/adt/jsonfuncs.c.rej Please ignore if this was not supposed to work togethe

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Erik Rijkers
On Wed, February 26, 2014 23:10, Andrew Dunstan wrote: > > new patch attached, change pushed to github. > > [jsonb-13.patch.gz] > This does not apply, see attached: src/backend/utils/adt/jsonfuncs.c.rej Please ignore if this was not supposed to work together with the earlier nested-hstore-11.pat

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Andres Freund
On 2014-02-26 16:23:12 -0500, Andrew Dunstan wrote: > On 02/10/2014 09:11 PM, Andres Freund wrote: > >Is it just me or is jsonapi.h not very well documented? > > > What about it do you think is missing? In any case, it's hardly relevant to > this patch, so I'll take that as obiter dicta. It's r

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Andrew Dunstan
On 02/26/2014 04:59 PM, Peter Geoghegan wrote: On Wed, Feb 26, 2014 at 1:23 PM, Andrew Dunstan wrote: + if (va->string.len == vb->string.len) + { + res = memcmp(va->string.val, vb->string.val, va->string.len); + if (res == 0 && arg) +

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Peter Geoghegan
On Wed, Feb 26, 2014 at 1:23 PM, Andrew Dunstan wrote: >>> + if (va->string.len == vb->string.len) >>> + { >>> + res = memcmp(va->string.val, vb->string.val, >>> va->string.len); >>> + if (res == 0 && arg) >>> + *(bool *) arg = true; >>

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Josh Berkus
On 02/26/2014 11:39 AM, Merlin Moncure wrote: > On Wed, Feb 26, 2014 at 12:05 PM, Josh Berkus wrote: >> On 02/26/2014 09:57 AM, Merlin Moncure wrote: >>> What is not going to be so clear for users (particularly without good >>> supporting documentation) is how things break down in terms of usage >

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Merlin Moncure
On Wed, Feb 26, 2014 at 12:05 PM, Josh Berkus wrote: > On 02/26/2014 09:57 AM, Merlin Moncure wrote: >> What is not going to be so clear for users (particularly without good >> supporting documentation) is how things break down in terms of usage >> between hstore and jsonb. > > Realistically? Onc

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Josh Berkus
On 02/26/2014 09:57 AM, Merlin Moncure wrote: > On Wed, Feb 26, 2014 at 11:41 AM, Josh Berkus wrote: >> On 02/26/2014 07:02 AM, Merlin Moncure wrote: >>> On Tue, Feb 25, 2014 at 3:57 PM, Hannu Krosing >>> wrote: It is not in any specs, but nevertheless all major imlementations do it and >>>

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Merlin Moncure
On Wed, Feb 26, 2014 at 11:41 AM, Josh Berkus wrote: > On 02/26/2014 07:02 AM, Merlin Moncure wrote: >> On Tue, Feb 25, 2014 at 3:57 PM, Hannu Krosing wrote: >>> It is not in any specs, but nevertheless all major imlementations do it and >>> some code depends on it. >>> IIRC, this behaviour is cu

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Josh Berkus
On 02/25/2014 08:07 PM, Craig Ringer wrote: > On 02/26/2014 06:21 AM, Merlin Moncure wrote: >> On Tue, Feb 25, 2014 at 4:03 PM, Josh Berkus wrote: >>> On 02/25/2014 12:12 PM, Robert Haas wrote: I don't agree that jsonb should be preferred in all but a handful of situations. Nor do I agr

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Josh Berkus
On 02/26/2014 07:02 AM, Merlin Moncure wrote: > On Tue, Feb 25, 2014 at 3:57 PM, Hannu Krosing wrote: >> It is not in any specs, but nevertheless all major imlementations do it and >> some code depends on it. >> IIRC, this behaviour is currently also met only by json and not by jsonb. > > Yes: Th

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Andrew Dunstan
On 02/26/2014 02:17 AM, Christophe Pettus wrote: On Feb 25, 2014, at 1:57 PM, Hannu Krosing wrote: It is not in any specs, but nevertheless all major imlementations do it and some code depends on it. I have no doubt that some code depends on it, but "all major implementations" is too strong

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Merlin Moncure
On Tue, Feb 25, 2014 at 3:57 PM, Hannu Krosing wrote: > On 02/25/2014 08:54 PM, Josh Berkus wrote: >> That's called a "straw man argument", Robert. >> Me: We should recommend that people use jsonb unless they have a >> specific reason for using json. > We could also make the opposite argument - pe

Re: [HACKERS] jsonb and nested hstore

2014-02-26 Thread Merlin Moncure
On Tue, Feb 25, 2014 at 10:07 PM, Craig Ringer wrote: > On 02/26/2014 06:21 AM, Merlin Moncure wrote: >> On Tue, Feb 25, 2014 at 4:03 PM, Josh Berkus wrote: >>> On 02/25/2014 12:12 PM, Robert Haas wrote: I don't agree that jsonb should be preferred in all but a handful of situations. N

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Christophe Pettus
On Feb 25, 2014, at 1:57 PM, Hannu Krosing wrote: > It is not in any specs, but nevertheless all major imlementations do it and > some code depends on it. I have no doubt that some code depends on it, but "all major implementations" is too strong a statement. BSON, in particular, does not hav

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Hannu Krosing
On 02/25/2014 08:54 PM, Josh Berkus wrote: > That's called a "straw man argument", Robert. > Me: We should recommend that people use jsonb unless they have a > specific reason for using json. We could also make the opposite argument - people use json unless they have a specific reason for using jso

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Stephen Frost
* Peter Geoghegan (p...@heroku.com) wrote: > On Tue, Feb 25, 2014 at 8:07 PM, Craig Ringer wrote: > > Please also highlight that any change will require a full table rewrite > > with an exclusive lock, so data type choices on larger tables may be > > hard to change later. > > It sure looks like t

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Peter Geoghegan
On Tue, Feb 25, 2014 at 8:07 PM, Craig Ringer wrote: > Please also highlight that any change will require a full table rewrite > with an exclusive lock, so data type choices on larger tables may be > hard to change later. It sure looks like they're binary-coercible to me: + CREATE CAST (hstore A

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Craig Ringer
On 02/26/2014 06:21 AM, Merlin Moncure wrote: > On Tue, Feb 25, 2014 at 4:03 PM, Josh Berkus wrote: >> On 02/25/2014 12:12 PM, Robert Haas wrote: >>> I don't agree that jsonb should be preferred in all but a handful of >>> situations. Nor do I agree that partisanship belongs in our >>> documentat

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Merlin Moncure
On Tue, Feb 25, 2014 at 4:03 PM, Josh Berkus wrote: > On 02/25/2014 12:12 PM, Robert Haas wrote: >> I don't agree that jsonb should be preferred in all but a handful of >> situations. Nor do I agree that partisanship belongs in our >> documentation. Therefore, -1 for your proposal to recommend t

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Josh Berkus
On 02/25/2014 12:12 PM, Robert Haas wrote: > I don't agree that jsonb should be preferred in all but a handful of > situations. Nor do I agree that partisanship belongs in our > documentation. Therefore, -1 for your proposal to recommend that, and > +1 for Merlin's proposal to present a compariso

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Alvaro Herrera
Josh Berkus escribió: > (to clarify below: "json" refers to the current varlena datatype; JSON > refers to JSON serialized data). FWIW the term "varlena json" is misleading. jsonb is also varlena, only different. I think you need a different term to say that json uses the text representation.

Re: [HACKERS] jsonb and nested hstore

2014-02-25 Thread Robert Haas
On Tue, Feb 25, 2014 at 1:54 PM, Josh Berkus wrote: > On 02/25/2014 10:50 AM, Robert Haas wrote: >> On Tue, Feb 25, 2014 at 1:45 PM, Josh Berkus wrote: >>> On 02/25/2014 10:31 AM, Robert Haas wrote: And I definitely don't agree that our documentation should push people towards stuffing

<    1   2   3   4   5   >