[HACKERS] default_isolation_level='serializable' crashes on Windows

2012-08-12 Thread Heikki Linnakangas
A customer reported that when you set default_isolation_level='serializable' in postgresql.conf on Windows, and try to start up the database, it crashes immediately. And sure enough, it does, on REL9_1_STABLE as well as on master. Stack trace: postgres!RecoveryInProgress+0x3a

Re: [HACKERS] default_isolation_level='serializable' crashes on Windows

2012-08-12 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: The problem is that when a postmaster subprocess is launched, it calls read_nondefault_variables() very early, before shmem initialization, to read the non-default config options from the file that postmaster wrote. When

Re: [HACKERS] Statistics and selectivity estimation for ranges

2012-08-12 Thread Alexander Korotkov
On Thu, Aug 9, 2012 at 12:44 AM, Alexander Korotkov aekorot...@gmail.comwrote: My conclusion is so, that current errors are probably ok for selectivity estimation. But taking into attention that generated datasets ideally fits assumptions of estimation, there could be room for improvement.

Re: [HACKERS] error handling in logging hooks

2012-08-12 Thread Peter Eisentraut
On Sat, 2012-08-11 at 14:05 -0400, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: What is the intended way to handle errors in the new logging hook? I'm not sure there is anything very useful you can do to handle them, if by handle you mean report somewhere. Yes, they ought to be

[HACKERS] Yet another failure mode in pg_upgrade

2012-08-12 Thread Tom Lane
I've been experimenting with moving the Unix socket directory to /var/run/postgresql for the Fedora distribution (don't ask :-(). It's mostly working, but I found out yet another way that pg_upgrade can crash and burn: it doesn't consider the possibility that the old or new postmaster is compiled

[HACKERS] PATCH: Implement value_to_json for single-datum conversion

2012-08-12 Thread Craig Ringer
Hi all Whenever I try to work with the new json types I trip over the lack of a function to escape text to json. The attached patch against master provides one by exposing the existing datum_to_json function to SQL. I've used the name value_to_json, but I'm not sure it's necessarily the

Re: [HACKERS] PATCH: Implement value_to_json for single-datum conversion

2012-08-12 Thread Craig Ringer
Whoops. It actually looks like the posted patch muffed up opr_sanity checks. I'm totally new to pg_proc.h wrangling so I'm not sure why yet, looking. Sorry, not sure how I missed that. I'll follow up shortly. -- Craig Ringer -- Sent via pgsql-hackers mailing list

[HACKERS] PL/Perl build problem: error: ‘OP_SETSTATE’ undeclared

2012-08-12 Thread Peter Eisentraut
It appears that a recent Perl version (I have 5.14.2) has eliminated OP_SETSTATE, which causes the current PostgreSQL build to fail: plperl.c: In function ‘_PG_init’: plperl.c:442:5645: error: ‘OP_SETSTATE’ undeclared (first use in this function) plperl.c:442:5645: note: each undeclared

Re: [HACKERS] PATCH: Implement value_to_json for single-datum conversion

2012-08-12 Thread Craig Ringer
OK, opr_sanity was failing because I added the value_to_json(text) alias to ensure that: value_to_json('some_literal') worked, following the same approach as quote_literal(anyelement) and quote_literal(text). That should be reasonable, right? The comments on the affected check in

Re: [HACKERS] PATCH: Implement value_to_json for single-datum conversion

2012-08-12 Thread Tom Lane
Craig Ringer ring...@ringerc.id.au writes: OK, opr_sanity was failing because I added the value_to_json(text) alias to ensure that: value_to_json('some_literal') worked, following the same approach as quote_literal(anyelement) and quote_literal(text). That should be reasonable, right?

Re: [HACKERS] PATCH: Implement value_to_json for single-datum conversion

2012-08-12 Thread Tom Lane
Craig Ringer ring...@ringerc.id.au writes: Whenever I try to work with the new json types I trip over the lack of a function to escape text to json. The attached patch against master provides one by exposing the existing datum_to_json function to SQL. ... This feels basic enough that I'm

Re: [HACKERS] PATCH: Implement value_to_json for single-datum conversion

2012-08-12 Thread Craig Ringer
On 08/13/2012 12:48 PM, Tom Lane wrote: There actually was a previous thread about this: http://archives.postgresql.org/pgsql-hackers/2012-05/msg1.php Note in particular Andrew's comment: Second, RFC 4627 is absolutely clear: a valid JSON value can only be an object or an