Re: service allowing arbitrary relations was Re: [GENERAL] hstore, but with fast range comparisons?

2014-12-11 Thread Andy Colson
On 12/10/2014 7:20 PM, Guyren Howe wrote: I want to do something that is perfectly satisfied by an hstore column. *Except* that I want to be able to do fast (ie indexed) <, > etc comparisons, not just equality. From what I can tell, there isn’t really any way to get hstore to do this, so

Re: service allowing arbitrary relations was Re: [GENERAL] hstore, but with fast range comparisons?

2014-12-10 Thread Guyren Howe
>> I want to do something that is perfectly satisfied by an hstore column. >> *Except* that I want to be able to do fast (ie indexed) <, > etc >> comparisons, not just equality. >> >> From what I can tell, there isn’t really any way to get hstore to do this, >> so I’ll have to go to a key-val

Re: service allowing arbitrary relations was Re: [GENERAL] hstore, but with fast range comparisons?

2014-11-14 Thread Andy Colson
On 11/13/2014 5:56 PM, Guyren Howe wrote: On Nov 13, 2014, at 2:28 PM, Andy Colson wrote: I want to do something that is perfectly satisfied by an hstore column. *Except* that I want to be able to do fast (ie indexed) <, > etc comparisons, not just equality. From what I can tell, there isn

Re: [GENERAL] hstore, but with fast range comparisons?

2014-11-13 Thread David G Johnston
Andy Colson wrote > On 11/13/2014 3:46 PM, Guyren Howe wrote: >> I want to do something that is perfectly satisfied by an hstore column. >> *Except* that I want to be able to do fast (ie indexed) <, > etc >> comparisons, not just equality. >> >> From what I can tell, there isn’t really any way to

Re: [GENERAL] hstore, but with fast range comparisons?

2014-11-13 Thread Andy Colson
On 11/13/2014 3:46 PM, Guyren Howe wrote: I want to do something that is perfectly satisfied by an hstore column. *Except* that I want to be able to do fast (ie indexed) <, > etc comparisons, not just equality. From what I can tell, there isn’t really any way to get hstore to do this, so I’l

[GENERAL] hstore, but with fast range comparisons?

2014-11-13 Thread Guyren Howe
I want to do something that is perfectly satisfied by an hstore column. *Except* that I want to be able to do fast (ie indexed) <, > etc comparisons, not just equality. >From what I can tell, there isn’t really any way to get hstore to do this, so >I’ll have to go to a key-value table. But I th

Re: [GENERAL] hstore/jsonb support in hibernate/JPA

2014-07-27 Thread Craig Ringer
On 07/22/2014 07:10 PM, Martin Gudmundsson wrote: > Hi all! > I saw that Rails 4 comes with hstore support out of the box. > > Does anyone know if there’s any integrated support like that in hibernate or > any other JPA implementation? > I know your able to write your own custom datatypes, but I’

[GENERAL] hstore/jsonb support in hibernate/JPA

2014-07-22 Thread Martin Gudmundsson
Hi all! I saw that Rails 4 comes with hstore support out of the box. Does anyone know if there’s any integrated support like that in hibernate or any other JPA implementation? I know your able to write your own custom datatypes, but I’m looking for integrated standardized support in the base lib

Re: [GENERAL] hstore to json and back again

2014-07-01 Thread Paul Jungwirth
> I'm trying to migrate an existing hstore column to json in Postgres > 9.3, and I'd like to be able to run the script in reverse. To answer my own question, this partially solves the problem for me (foo.datahash_new has json, foo.datahash_old has hstore): connection.select_rows(<<-EOQ).each

[GENERAL] hstore to json and back again

2014-07-01 Thread Paul Jungwirth
Hello, I'm trying to migrate an existing hstore column to json in Postgres 9.3, and I'd like to be able to run the script in reverse. I know not all JSON can turn back into hstore, but since this is coming from an old hstore column, I know the structure is flat (no nesting), and that all values ar

Re: [GENERAL] hstore binary representation of keys

2014-04-22 Thread Dorian Hoxha
Currently hstore is mongodb. It writes the keys everytime (and values as strings!, its mostly for dynamic keys or very sparse keys in my opinion). You can shorten keys,or put them in dedicated columns. I haven't read that there is a plan to compress the strings. On Tue, Apr 22, 2014 at 2:01 PM,

[GENERAL] hstore binary representation of keys

2014-04-22 Thread Tim Kane
Hi all, I’ve been using hstore to record various key/val pairs, but I’ve noticed it consumes a lot more disk than I would have expected. I don’t have any hard figures to illustrate, but empirical testing has shown that if I record these pairs as traditional column based fields, I can save a signif

Re: [GENERAL] hstore - jsonb

2014-04-04 Thread Oleg Bartunov
On Fri, Apr 4, 2014 at 7:17 PM, Thom Brown wrote: > On 4 April 2014 16:15, Oleg Bartunov wrote: >> We'll work on contrib/jsonxtra with all operators ported from hstore >> and release it after 9.4 as separate extension. > > That would be useful. :) > > Would there be an aim of getting that in-core

Re: [GENERAL] hstore - jsonb

2014-04-04 Thread Thom Brown
On 4 April 2014 16:15, Oleg Bartunov wrote: > We'll work on contrib/jsonxtra with all operators ported from hstore > and release it after 9.4 as separate extension. That would be useful. :) Would there be an aim of getting that in-core for 9.5? -- Thom -- Sent via pgsql-general mailing list

Re: [GENERAL] hstore - jsonb

2014-04-04 Thread Oleg Bartunov
We'll work on contrib/jsonxtra with all operators ported from hstore and release it after 9.4 as separate extension. On Fri, Apr 4, 2014 at 4:32 PM, Thom Brown wrote: > On 4 April 2014 13:04, Oleg Bartunov wrote: >> On Fri, Apr 4, 2014 at 12:20 PM, Armand Turpel >> wrote: >>> Hi, >>> >>> A few

Re: [GENERAL] hstore - jsonb

2014-04-04 Thread Thom Brown
On 4 April 2014 13:04, Oleg Bartunov wrote: > On Fri, Apr 4, 2014 at 12:20 PM, Armand Turpel > wrote: >> Hi, >> >> A few questions about jsonb and hstore: >> >> 1. does jsonb replace hstore? > > no, it's different data type > >> 2. compatibility of jsonb <> hstore? > > hstore is a simple key-valu

Re: [GENERAL] hstore - jsonb

2014-04-04 Thread Oleg Bartunov
On Fri, Apr 4, 2014 at 12:20 PM, Armand Turpel wrote: > Hi, > > A few questions about jsonb and hstore: > > 1. does jsonb replace hstore? no, it's different data type > 2. compatibility of jsonb <> hstore? hstore is a simple key-value model, while jsonb - richer document-based model. > 3. wil

[GENERAL] hstore - jsonb

2014-04-04 Thread Armand Turpel
Hi, A few questions about jsonb and hstore: 1. does jsonb replace hstore? 2. compatibility of jsonb <> hstore? 3. will the development of hstore continue? 4. is it recommended to use jsonb when planning new projects? Thanks Armand -- Sent via pgsql-general mailing list (pgsql-general@postgres

Re: [GENERAL] hstore syntax

2013-12-08 Thread Kaare Rasmussen
On 12/08/2013 11:45 AM, Magnus Hagander wrote: If it's just for a single value, you can just use SELECT hstore('key', s.part) It also takes array (either one big array, or one array of keys and one array of values). Super! I knew I was missing the obvious. -- Sent via pgsql-general mail

Re: [GENERAL] hstore syntax

2013-12-08 Thread Magnus Hagander
On Sun, Dec 8, 2013 at 11:22 AM, Kaare Rasmussen wrote: > Hi > > Trying to write a sql function to return hstore generated from a select. > But I'm thinking there must be a better way. > > SELECT 'key => "' || s.part || '"')::hstore > > is neither pretty nor secure. At least I need to escape any

[GENERAL] hstore syntax

2013-12-08 Thread Kaare Rasmussen
Hi Trying to write a sql function to return hstore generated from a select. But I'm thinking there must be a better way. SELECT 'key => "' || s.part || '"')::hstore is neither pretty nor secure. At least I need to escape any '"' in s.part. I'll do so if there's no better way to write this (?

Re: [GENERAL] hstore

2013-11-20 Thread Joey Quinn
Thank-you all... create extension hstore; was exactly what I needed (I'm new to PostgreSQL and was unfamiliar with the terminology... was searching unsuccessfully for things like "install hstore module"). Joey On Wed, Nov 20, 2013 at 4:12 PM, Joey Quinn wrote: > I'm using 9.3 (Windows 64 bit)

Re: [GENERAL] hstore

2013-11-20 Thread John R Pierce
On 11/20/2013 1:12 PM, Joey Quinn wrote: I'm using 9.3 (Windows 64 bit) and would like to use an hstore field in new table but it does not appear to be available. How do I add the correct module? CREATE EXTENSION hstore; should install the hstore contributed module into the current dat

Re: [GENERAL] hstore

2013-11-20 Thread Venkatesulu Jumbo
Here you go: http://www.postgresql.org/docs/current/static/hstore.html#HSTORE-OP-TABLE On Thu, Nov 21, 2013 at 2:42 AM, Joey Quinn wrote: > I'm using 9.3 (Windows 64 bit) and would like to use an hstore field in > new table but it does not appear to be available. How do I add the correct > modu

[GENERAL] hstore

2013-11-20 Thread Joey Quinn
I'm using 9.3 (Windows 64 bit) and would like to use an hstore field in new table but it does not appear to be available. How do I add the correct module? Joey

Re: [GENERAL] Hstore::TooBig ?

2013-10-31 Thread John R Pierce
On 10/31/2013 5:11 PM, john gale wrote: The further questions still apply though; are there documented size limitations for hstore? afaik only the practical limits of how big you want your tables to get, and the 1GB limit of the underlying text representation. having many 1000s of keys in a

Re: [GENERAL] Hstore::TooBig ?

2013-10-31 Thread john gale
On Oct 31, 2013, at 4:44 PM, Adrian Klaver wrote: >> So to piece out the questions, >> - is there a total size limitation of the hstore field? or is it >> theoretically large enough (1GB) that it really shouldn't matter? >> - is there a string size limitation of each key/val in 9.x, or is it st

Re: [GENERAL] Hstore::TooBig ?

2013-10-31 Thread john gale
On Oct 31, 2013, at 4:44 PM, Adrian Klaver wrote: >> So to piece out the questions, >> - is there a total size limitation of the hstore field? or is it >> theoretically large enough (1GB) that it really shouldn't matter? >> - is there a string size limitation of each key/val in 9.x, or is it st

Re: [GENERAL] Hstore::TooBig ?

2013-10-31 Thread Adrian Klaver
On 10/31/2013 03:46 PM, john gale wrote: I am running a somewhat unfamiliar Ruby automation results app using ActiveRecord to manage the postgres 9.0 backend. During our automation runs we sometimes get bursts of HTTP 500 errors coming back at us, and the Ruby app log shows an Hstore::TooBig

Re: [GENERAL] Hstore::TooBig ?

2013-10-31 Thread john gale
On Oct 31, 2013, at 3:46 PM, john gale wrote: > I don't quite know where this error is coming from. The ActiveRecord source > doesn't seem to have it, and I'm not familiar enough with Rails or > ActiveRecord to track definitively whether the failing function is actually > performing a DB ope

[GENERAL] Hstore::TooBig ?

2013-10-31 Thread john gale
I am running a somewhat unfamiliar Ruby automation results app using ActiveRecord to manage the postgres 9.0 backend. During our automation runs we sometimes get bursts of HTTP 500 errors coming back at us, and the Ruby app log shows an Hstore::TooBig error: Hstore::TooBig (Hstore::TooBig):

Re: [GENERAL] "?" hstore operator broken in 9.2?

2012-12-24 Thread David Johnston
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Tom Lane > Sent: Monday, December 24, 2012 9:34 PM > To: David Johnston > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] "?"

Re: [GENERAL] "?" hstore operator broken in 9.2?

2012-12-24 Thread John R Pierce
On 12/24/2012 6:33 PM, Tom Lane wrote: "David Johnston" writes: >When I execute the following query: >SELECT 'a=>1'::hstore ? 'a'::text FWIW, works fine for me. >I get an "Input parameter count is less then expected" error message. I can't find such a message (or indeed anything mentioning

Re: [GENERAL] "?" hstore operator broken in 9.2?

2012-12-24 Thread Tom Lane
"David Johnston" writes: > When I execute the following query: > SELECT 'a=>1'::hstore ? 'a'::text FWIW, works fine for me. > I get an "Input parameter count is less then expected" error message. I can't find such a message (or indeed anything mentioning "parameter count") anywhere in the Postg

Re: [GENERAL] "?" hstore operator broken in 9.2?

2012-12-24 Thread John R Pierce
On 12/24/2012 4:45 PM, David Johnston wrote: SELECT 'a=>1'::hstore ? 'a'::text fwiw, this works for me... select hstore 'a=>1' ? 'a'; 'something'::SOMETYPE is a type cast operation, while SOMETYPE 'something' is a constant of SOMETYPE. I didn't bother to cast 'a' to text as 'a' *is* t

[GENERAL] "?" hstore operator broken in 9.2?

2012-12-24 Thread David Johnston
Hi, When I execute the following query: SELECT 'a=>1'::hstore ? 'a'::text I get an "Input parameter count is less then expected" error message. SELECT defined('a=>1'::hstore, 'a'::text) -- works I have tried on Linux Ubuntu (9.2.1) and Windows 7 (9.2.2) machines. My knowle

Re: [GENERAL] hstore for audit logging: Finding differences between two hstore values

2012-07-13 Thread Craig Ringer
On 07/13/2012 02:15 PM, Sergey Konoplev wrote: On Fri, Jul 13, 2012 at 9:51 AM, Craig Ringer wrote: ... but it feels like there must be a smarter way. Well, may be kind of (h1 - h2), (h2 - h1) and derivatives will make sense? I apparently have the reading skills of a stoned mole, as I comp

Re: [GENERAL] hstore for audit logging: Finding differences between two hstore values

2012-07-12 Thread Sergey Konoplev
On Fri, Jul 13, 2012 at 9:51 AM, Craig Ringer wrote: > ... but it feels like there must be a smarter way. Well, may be kind of (h1 - h2), (h2 - h1) and derivatives will make sense? -- Sergey Konoplev a database architect, software developer at PostgreSQL-Consulting.com http://www.postgresql-c

[GENERAL] hstore for audit logging: Finding differences between two hstore values

2012-07-12 Thread Craig Ringer
Hi all I'm using Pg 9.1, working on enhancing my audit logging so it can record not only the old and new values of a record when it changes, but what exactly changed. It's easy to produce hstore values for the old and new records, and I've been happily logging those. I was about to start te

Re: [GENERAL] hstore installed in a separate schema

2011-08-05 Thread Ioana Danes
Thank you Harald --- On Thu, 8/4/11, Harald Fuchs wrote: > From: Harald Fuchs > Subject: Re: [GENERAL] hstore installed in a separate schema > To: pgsql-general@postgresql.org > Received: Thursday, August 4, 2011, 11:18 AM > In article <1312401318.5199.yahoomailclas...@

Re: [GENERAL] hstore installed in a separate schema

2011-08-04 Thread Harald Fuchs
In article <1312401318.5199.yahoomailclas...@web120108.mail.ne1.yahoo.com>, Ioana Danes writes: > Hi, > I am planning to use the contrib module hstore > but I would like to install it on a separate schema, not public, > and include the schema in the search_path. > Do you know if there are any

[GENERAL] hstore installed in a separate schema

2011-08-03 Thread Ioana Danes
Hi, I am planning to use the contrib module hstore but I would like to install it on a separate schema, not public, and include the schema in the search_path. Do you know if there are any issues with this scenario. In the hstore.sql script I see it forces it into public: -- Adjust this settin

Re: [GENERAL] hstore problem with UNION?

2010-05-10 Thread Ivan Voras
On 05/10/10 14:10, Jayadevan M wrote: When we do a union, the database has to get rid of duplicates and get distinct values. To achieve this, probably it does a sort. Just guesswork You are right, it looks like I have inverted the logic of UNION and UNION ALL - I actually needed "UNION ALL

Re: [GENERAL] hstore problem with UNION?

2010-05-10 Thread Jayadevan M
When we do a union, the database has to get rid of duplicates and get distinct values. To achieve this, probably it does a sort. Just guesswork Regards, Jayadevan DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and

Re: [GENERAL] hstore problem with UNION?

2010-05-10 Thread Jayadevan M
> How to get around this? I really don't care how hstores get sorted and > more, would like to avoid sorting them at all as they could get big. union all seems to work. Would that serve the purpose? Regards, Jayadevan DISCLAIMER: "The information in this e-mail and any attachment is inten

[GENERAL] hstore problem with UNION?

2010-05-10 Thread Ivan Voras
I've encountered the following problem: ivoras=# create table htest2(id integer, t hstore); CREATE TABLE ivoras=# create table htest3(id integer, t2 hstore); CREATE TABLE ivoras=# select id, t from htest2 union select id,t2 as t from htest3; ERROR: could not identify an ordering operator for t

Re: [GENERAL] hstore equality-index performance question

2010-03-30 Thread Tom Lane
Stefan Keller writes: > I'm trying to optimize the latter query: > # SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a'; The hstore gist and gin opclasses contain support for that. > ...or something like this (which also involves the '->' operator) > # SELECT id FROM mytable WHERE (kvp->'a') = '

Re: [GENERAL] hstore equality-index performance question

2010-03-30 Thread Stefan Keller
You are right, my negligence. I'm trying to optimize the latter query: # SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a'; ...or something like this (which also involves the '->' operator) # SELECT id FROM mytable WHERE (kvp->'a') = 'x'; -S. 2010/3/29 Sergey Konoplev : >> My question is, if o

Re: [GENERAL] hstore equality-index performance question

2010-03-29 Thread Sergey Konoplev
> My question is, if one can get also index support for the '->' operator? I am not sure what do you mean. >>>  SELECT id, (kvp->'a') FROM mytable; >>> >>> ... can be accelerated nevertheless by adding following where clause: >>> >>>  SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a'; >>> >>> =>

Re: [GENERAL] hstore equality-index performance question

2010-03-29 Thread Stefan Keller
Thank you Sergey for your reply. I'm not sure how your partial index makes a difference. Obviously the ? operator gets indexed: # EXPLAIN SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a'; Index Scan using mytable_kvp_idx on mytable (cost=0.00..8.27 rows=1 width=36) Index Cond: (kvp ? 'a'::te

Re: [GENERAL] hstore equality-index performance question

2010-03-29 Thread Sergey Konoplev
On 29 March 2010 02:57, Stefan Keller wrote: > Documentation at "F.13.3. Indexes" says that "hstore has index support > for @> and ? operators..." > => Therefore no index does support equality-indexes? > > If so, then I suppose that following (potentially slow) query > which contains an equality t

[GENERAL] hstore equality-index performance question

2010-03-28 Thread Stefan Keller
Documentation at "F.13.3. Indexes" says that "hstore has index support for @> and ? operators..." => Therefore no index does support equality-indexes? If so, then I suppose that following (potentially slow) query which contains an equality test for all keys 'a' and returns all values... SELECT