Re: [HACKERS] Not In Foreign Key Constraint

2013-09-19 Thread Misa Simic
2013/9/19 David Johnston > Misa Simic wrote > > I guess that rule can be achieved with triigers on TableA and TableC - > but > > the same is true for FK (and FK constraint is more effective then trigger > > - > > that is why I wonder would it be useful/ach

[HACKERS] Not In Foreign Key Constraint

2013-09-16 Thread Misa Simic
Hi hackers, I just wonder how hard would be to implement something like "Not In FK Constraint" or opposite to FK... i.e: FK ensures that value of FK column of inserted row exists in refferenced Table NotInFK should ensure that value of NotInFK column of inserted row does not Exist in referen

[HACKERS] PostgreSQL 9.3 latest dev snapshot

2013-06-25 Thread Misa Simic
Hi, Where we can find latest snapshot for 9.3 version? We have taken latest snapshot from http://ftp.postgresql.org/pub/snapshot/dev/ But it seems it is for 9.4 version... Thanks, Misa

Re: [HACKERS] missing event trigger support functions in 9.3

2013-05-09 Thread Misa Simic
2013/5/9 Pavel Stehule > Hello > > I am writing a article about 9.3. I found so event trigger functions is > not complete. We have only pg_event_trigger_dropped_objects() function. It > looks really strange and asymmetric. Can we implement similar function for > CREATE as minimum to 9.3? > > I am

Re: [HACKERS] Graph datatype addition

2013-05-01 Thread Misa Simic
On Wednesday, May 1, 2013, Atri Sharma wrote: > Hi all, > > Please find a probable prototype for the same: > > struct GraphNode > { > Oid NodeOid;// Oid of the row which is the node here. We will > store an identifier to it here rather than the complete row(with data) > itself. > Adjac

Re: [HACKERS] Graph datatype addition

2013-04-29 Thread Misa Simic
On Monday, April 29, 2013, Atri Sharma wrote: > On Mon, Apr 29, 2013 at 10:12 PM, Misa Simic > > > wrote: > > Hi Atri, > > > > What is an example of custom internal representation and its JSON > > representation (though and JSON and HStore represent its value

Re: [HACKERS] Graph datatype addition

2013-04-29 Thread Misa Simic
Hi Merlin, " Graphs are not currently able to be transported out of the database currently via JSON" What does it mean? (I probably dont understand graphs well - but from my point of view - any data can be transported out of DB via JSON) Thanks, Misa 2013/4/29 Merlin Moncure > On Mon, Apr

Re: [HACKERS] Graph datatype addition

2013-04-29 Thread Misa Simic
Hi Atri, What is an example of custom internal representation and its JSON representation (though and JSON and HStore represent its value as text)? I also think that the key question is: "what operations would you support on this data type?" Or what kind of problems it will solve? (what can't

Re: [HACKERS] Fwd: Range types (DATERANGE, TSTZRANGE) in a foreign key with "inclusion" logic

2013-04-07 Thread Misa Simic
Hi, Far as I am aware - there is not yet described FK feature... But should be possible to ensure that rule via trigger.. 1 after update on container, and one after insert/update on item... Kind Regards, Misa On Saturday, April 6, 2013, Matthias Nagel wrote: > Hello, > this is a re-post from

[HACKERS] Altering Views

2013-02-20 Thread Misa Simic
Hi, If we want to "add new column" to the view - the only one way (we have found) is: -drop view -create it again ( with new column ) Now, if some other view depends on the view we want change - it will not allow us to drop the view - what is fine, of course - but it does not allow us to change

Re: [HACKERS] function for setting/getting same timestamp during whole transaction

2013-02-06 Thread Misa Simic
Hi, I dont have access to pg at this moment... But: BEGIN; SELECT now(); SELECT clock_timestamp(); SELECT now(); SELECT pg_sleep(100); SELECT now(); cCOMMIT; Now() should always return the same, very first, result... On Wednesday, February 6, 2013, Miroslav Šimulčík wrote: > Hi all

Re: is JSON really "a type" (Re: [HACKERS] data to json enhancements)

2012-10-01 Thread Misa Simic
Datum_to_json SELECT 'a=>1'::hstore, '1'::xml, '{"a":1}' (Please note that last column is unknown – datatype) Now, what is the main goal? to get: 1) { "hstore": "\"a\"=>\"1\"", "xml": "1", "?column?": "{\"a\":1}" } or: 2) { "hstore": { "a": "1" },

Re: [HACKERS] data to json enhancements

2012-09-29 Thread Misa Simic
No probs... And I did...The thing is, subject is to wide... Post too long... Intention was just to better explain thoughts... I am not a blogger anyway, just new in Postgres community... Trying to say, probably 90% of post would be suficient just for the list, and because of i am new it is hard to

Re: [HACKERS] data to json enhancements

2012-09-28 Thread Misa Simic
Hi Guys, I have made some blog about the subject: http://misasimic.blogspot.co.uk/2012/09/postgresql-92-and-json-datatype.html Hopefully will help on some kind... Kind Regards, Misa

Re: [HACKERS] data to json enhancements

2012-09-27 Thread Misa Simic
Hm... IMO, '[1,2,3]'::json '[1,2,3]'::text::json '[1,2,3]'::int[]::json are the same thing... (though I am not sure '[1,2,3]'::int[] is valid in postgres...) in js var o = JSON.parse(result_of_any_cast_above) should produce array of 3 integer '[1,2,3]' is different then'"[1,2,3]"' If there is

Re: [HACKERS] [PATCH] Support for foreign keys with arrays

2012-06-18 Thread Misa Simic
2012/6/18 Kevin Grittner > The many-to-one case seems like it is better handled in the other > direction -- with the referenced table holding the set of valid keys > and the referencing table holding the single key. (I believe the > general case of this is what Jeff called an "inclusion constrai

Re: [HACKERS] [PATCH] Support for foreign keys with arrays

2012-06-17 Thread Misa Simic
2012/6/17 Kevin Grittner > > > Can someone provide a practical example of a "foreign key with array" > use case? The only situations I'm able to think of right now are the > same cases where you would now use a table with primary keys of two > tables to provide a many-to-many linkage. Does this

Re: [HACKERS] [PATCH] Support for foreign keys with arrays

2012-06-17 Thread Misa Simic
2012/6/17 Simon Riggs > > Do we need something like Exclusion FKs? i.e. the FK partner of > Exclusion Constraints? > +1 Definatelly it would be something usefull... Today's workaround to achieve that with additional table, and additional column in Key is a bit awkward... > > -- > Simon Riggs

Re: [HACKERS] [PATCH] Support for foreign keys with arrays

2012-06-17 Thread Misa Simic
IMO, both approaches make sense... >From temporal point no doubt, referencing should be contained by referenced table >From other side could be useful if in master table are elements with simple data type, but for some set of elements there could be common properties in another table.. What t

Re: [HACKERS] 9.2 Beta: intersection of daterange

2012-05-16 Thread Misa Simic
I think result is ok... 2010-01-04 is not inside first range... Sent from my Windows Phone From: Brar Piening Sent: 16/05/2012 09:53 To: pgsql-hackers Subject: [HACKERS] 9.2 Beta: intersection of daterange I'm currently doing some tests on range types: tests=# SELECT int8range(5,15) * int8range(1

Re: [HACKERS] Pg 9.2 extension install

2012-03-06 Thread Misa Simic
OK, I have removed all *.o and all *.so files - and extension is succesfully deployed on 9.2 Thanks, Misa 2012/3/6 Misa Simic > Hi, > > I have made some pg extension for Pg 9.1 and want to deploy it on Pg > 9.2dev... > > When i try create extension it shows error version

[HACKERS] Pg 9.2 extension install

2012-03-06 Thread Misa Simic
Hi, I have made some pg extension for Pg 9.1 and want to deploy it on Pg 9.2dev... When i try create extension it shows error version mismatch server is 9.2 library has made for 9.1... How to make library for 9.2? Thanks, Misa Sent from my Windows Phone

Re: [HACKERS] JSON for PG 9.2

2012-01-11 Thread Misa Simic
" I am able to write array_to_json fce and Andrew can write query_to_json" +1 Thanks guys... We are using a lot of JSON as communication protocol... having core support for JSON, And those functions, will be a real life saver... Many thanks, Misa Sent from my Windows Phone From: Pavel Stehul

Re: [HACKERS] UUID datatype GiST index support

2011-08-22 Thread Misa Simic
es just first 4, or 5 values from ipaddres even there is 16 - (decalred as char[16]) Many thanks, Misa 2011/8/22 Alexander Korotkov > Hi! > > On Mon, Aug 22, 2011 at 2:54 PM, Misa Simic wrote: > >> static int >> m4_uuidkey_cmp(const void *a, const void *b) >

[HACKERS] UUID datatype GiST index support

2011-08-22 Thread Misa Simic
Hi, Hopefully someone can help me and point me in right direction :) I have been looking for GiST support extension for UUID datatype... since I could not find it... I wanted to write it myself. I need it more for EXCLUSION constraint - than to use GIST index just on UUID column... i.e: CREATE