Re: [GENERAL] Bypassing NULL elements in row_to_json function

2016-04-09 Thread Michael Nolan
2nd Followup: It turns out that loading a table from a JSON string is more complicated than going from a table to JSON, perhaps for good reason. There does not appear to be a direct inverse to the row_to_json() function, but it wasn't difficult for me to write a PHP program that takes the JSON

Re: [GENERAL] max_stack_depth problem though query is substantially smaller

2016-04-09 Thread Tom Lane
"Bannert Matthias" writes: > [ very deep stack of parser transformExprRecurse calls ] > #20137 0x7fe7fb80ab8c in pg_analyze_and_rewrite > (parsetree=parsetree@entry=0x7fe7fffdb2a0, > query_string=query_string@entry=0x7fe7fdf606b0 "INSERT INTO > ts_updates(ts_key,

Re: [GENERAL] Bypassing NULL elements in row_to_json function

2016-04-09 Thread Michael Nolan
I was able to try it on a test server, the combination of row_to_json() and json_strip_nulls() worked exactly as I had hoped. Stripping nulls reduced the JSON file by over 50%. (The data I needed to export has around 900,000 rows, so it gets quite large.) I've got a test file I can make

Re: [GENERAL] Really unique session ID - PID + connection timestamp?

2016-04-09 Thread Adrian Klaver
On 04/09/2016 01:30 AM, Durumdara wrote: Dear Everybody! In MS we had a "persistent lock" structure and method. This over transactions because based on real records in a real table with pri key (tablename + id). For garbaging we had a special session info. In MS the session id is smallint,

Re: [GENERAL] 9.5 - Is there any way to disable automatic rollback?

2016-04-09 Thread Adrian Klaver
On 04/09/2016 12:00 AM, durumd...@gmail.com wrote: Dear Everybody! See this sampe: StartTrans; try Update1; Insert1; Update2; // this cause error f.e. Commit; except AnyChecks; Rollback; When Update2 causes error, AnyChecks comes. In other databases I can do

Re: [GENERAL] Really unique session ID - PID + connection timestamp?

2016-04-09 Thread Christoph Berg
Re: Stephen Frost 2016-04-09 <20160409115712.gt10...@tamriel.snowman.net> > > Btw, what you are describing is exactly what %c in log_line_prefix > > does. > > That's not currently exposed at an SQL level anywhere though, is it? > Perhaps we should add a way to get that. Another thought would be

Re: [GENERAL] Really unique session ID - PID + connection timestamp?

2016-04-09 Thread Stephen Frost
* Christoph Berg (c...@df7cb.de) wrote: > Re: Durumdara 2016-04-09 > > > In MS the session id is smallint, so it can repeats after server restarts, > > but my coll. found a "session creation timestamp". > > This is a key which

Re: [GENERAL] Really unique session ID - PID + connection timestamp?

2016-04-09 Thread Durumdara
Dear John! This is not about MS. This is about: how to get unique session_id. This could be "pid" + "client starting time". The pid isn't unique, where I can get "client's starting time"? But I think the solution is pg_activity view. There is no same PID as mine, because no one have same

Re: [GENERAL] Really unique session ID - PID + connection timestamp?

2016-04-09 Thread Stephen Frost
Greetings, * Durumdara (durumd...@gmail.com) wrote: > Where I can get timestamp or some other unique data with I can create a > combined primary key? Not entirely sure about the rest of it, but if you want backend start time, you can look at pg_stat_activity (which also happens to have the pid).

Re: [GENERAL] Really unique session ID - PID + connection timestamp?

2016-04-09 Thread John R Pierce
On 4/9/2016 1:30 AM, Durumdara wrote: In MS we had... If you want Microsoft's unique version of SQL, run Microsoft SQL. That stuff you describe is a whole bunch of implementation specific wierdness from the standpoint of someone outside, looking in.. -- john r pierce, recycling bits in

Re: [GENERAL] Really unique session ID - PID + connection timestamp?

2016-04-09 Thread Christoph Berg
Re: Durumdara 2016-04-09 > In MS the session id is smallint, so it can repeats after server restarts, > but my coll. found a "session creation timestamp". > This is a key which unique. > With this we can check for died sessions

[GENERAL] Really unique session ID - PID + connection timestamp?

2016-04-09 Thread Durumdara
Dear Everybody! In MS we had a "persistent lock" structure and method. This over transactions because based on real records in a real table with pri key (tablename + id). For garbaging we had a special session info. In MS the session id is smallint, so it can repeats after server restarts, but

Re: [GENERAL] 9.5 - Is there any way to disable automatic rollback?

2016-04-09 Thread David G. Johnston
On Saturday, April 9, 2016, durumd...@gmail.com wrote: > Dear Everybody! > > > See this sampe: > > StartTrans; > try > Update1; > Insert1; > Update2; // this cause error f.e. > Commit; > except > AnyChecks; > Rollback; > > When Update2 causes error,

[GENERAL] 9.5 - Is there any way to disable automatic rollback?

2016-04-09 Thread durumd...@gmail.com
Dear Everybody! See this sampe: StartTrans; try Update1; Insert1; Update2; // this cause error f.e. Commit; except AnyChecks; Rollback; When Update2 causes error, AnyChecks comes. In other databases I can do anything in that point, because Update and Insert 1 stored