Re: [HACKERS] planner fails on HEAD

2011-12-03 Thread Pavel Stehule
a plan for modified query is ohs=# explain analyze SELECT object_id, inserted, 'ASSIGN_RSLT', order_id, 2, seqnum, rejected_flat_file_id, true FROM ( SELECT q.object_id, fe.inserted, q.order_id, q.seqnum, q

[HACKERS] planner fails on HEAD

2011-12-03 Thread Pavel Stehule
Hello I have a relative simple query SELECT q.object_id FROM queue q JOIN outgoing.cps_forms f ON f.id = q.object_id AND q.object_type = 'cp' JOIN flat_file_ex fe ON fe.id = q.rejected_flat_file_id WHERE q.rejected_resul

Re: [HACKERS] Review: Non-inheritable check constraints

2011-12-03 Thread Nikhil Sontakke
> I had a look at this patch today. The pg_dump bits conflict with > another patch I committed a few days ago, so I'm about to merge them. > I have one question which is about this hunk: > > Thanks for taking a look Alvaro. > @@ -2312,6 +2317,11 @@ MergeWithExistingConstraint(Relation rel, char

Re: [HACKERS] cannot read pg_class without having selected a database / is this a bug?

2011-12-03 Thread Tom Lane
Tomas Vondra writes: > That might explain why it fails at first and then works just fine, > although it's a bit strange. Wouldn't that mean you can't access any > catalogs from the auth hook? It should be possible to access shared catalogs from an auth hook. pg_stat_activity is neither shared nor

Re: [HACKERS] [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

2011-12-03 Thread NISHIYAMA Tomoaki
Hi, On 2011/12/04, at 9:45, Andrew Dunstan wrote: >> Yes, but there's a deal more work to do here. This whole thing is falling >> over in my build environment (64 bit Windows 7, MinGW/MSys, the machine that >> runs pitta on the buildfarm.) >> >> This is a long way from a done deal. > > In part

Re: [HACKERS] Review: Non-inheritable check constraints

2011-12-03 Thread Alvaro Herrera
Excerpts from Alex Hunsaker's message of dom oct 09 03:40:36 -0300 2011: > On Fri, Oct 7, 2011 at 21:30, Nikhil Sontakke wrote: > > Hi Alex, > > > > I guess we both are in agreement with each other :) > > > > After sleeping over it, I think that check is indeed dead code with this new > > non-inh

Re: [HACKERS] SQLDA fix for ECPG

2011-12-03 Thread Michael Meskes
On Sat, Nov 19, 2011 at 10:56:03PM +0100, Boszormenyi Zoltan wrote: > Hopefully last turn in this topic. For NUMERIC types, the safe minimum > alignment is a pointer because there are 5 int members followed by > two pointer members in this struct. I got a crash from this with a lucky > query and da

Re: [HACKERS] Command Triggers

2011-12-03 Thread Andres Freund
On Friday, December 02, 2011 03:09:55 AM Tom Lane wrote: > Andres Freund writes: > > On Thursday, December 01, 2011 07:21:25 PM Tom Lane wrote: > >> Making this work cleanly would be a bigger deal than I think you're > >> thinking. > > > > Obviously that depends on the definition of clean... > >

Re: [HACKERS] [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

2011-12-03 Thread Andrew Dunstan
On 12/03/2011 06:12 PM, Andrew Dunstan wrote: On 12/03/2011 09:59 AM, Magnus Hagander wrote: On Sat, Dec 3, 2011 at 15:49, NISHIYAMA Tomoaki wrote: Hi, Have you verified if tihs affects _MSC_VER< 1400? Suddently that branch would care about HAVE_CRTDEFS_H, and I'm not sure if that's so

[HACKERS] WARNING: pgstat wait timeout

2011-12-03 Thread Anders Steinlein
While doing some pgbench testing on a new server with 9.1.1, I noticed quite a lot of $subject in the logs. I did some Googling and found this previous thread: http://archives.postgresql.org/pgsql-hackers/2010-01/msg02897.php It doesn't seem like the issue was resolved? I did: # pgbench -i -

Re: [HACKERS] [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

2011-12-03 Thread Andrew Dunstan
On 12/03/2011 09:59 AM, Magnus Hagander wrote: On Sat, Dec 3, 2011 at 15:49, NISHIYAMA Tomoaki wrote: Hi, Have you verified if tihs affects _MSC_VER< 1400? Suddently that branch would care about HAVE_CRTDEFS_H, and I'm not sure if that's something we need to worry about. I have no MSVC.

Re: [HACKERS] cannot read pg_class without having selected a database / is this a bug?

2011-12-03 Thread Tomas Vondra
On 3.12.2011 23:37, Robert Haas wrote: > 2011/12/3 Tomas Vondra : >> psql: FATAL: cannot read pg_class without having selected a database >> >> I've found this happens because the extension defines a client auth hook >> that reads pg_stat_activity. The really interesting thing is that this >> happ

Re: [HACKERS] cannot read pg_class without having selected a database / is this a bug?

2011-12-03 Thread Robert Haas
2011/12/3 Tomas Vondra : > psql: FATAL:  cannot read pg_class without having selected a database > > I've found this happens because the extension defines a client auth hook > that reads pg_stat_activity. The really interesting thing is that this > happens only when I start several backends 'at the

[HACKERS] cannot read pg_class without having selected a database / is this a bug?

2011-12-03 Thread Tomas Vondra
Hi, I've written a simple extension that limits number of connection by IP/db/user, and I do receive this exception: psql: FATAL: cannot read pg_class without having selected a database I've found this happens because the extension defines a client auth hook that reads pg_stat_activity. The rea

Re: [HACKERS] Command Triggers

2011-12-03 Thread Andres Freund
On Friday, December 02, 2011 03:09:55 AM Tom Lane wrote: > Andres Freund writes: > > On Thursday, December 01, 2011 07:21:25 PM Tom Lane wrote: > >> Making this work cleanly would be a bigger deal than I think you're > >> thinking. > > > > Obviously that depends on the definition of clean... > >

Re: [HACKERS] Why so few built-in range types?

2011-12-03 Thread Dimitri Fontaine
Tom Lane writes: > IIRC, a lot of the basic behavior of the inet/cidr types was designed by > Paul Vixie (though he's not to blame for their I/O presentation). > So I'm inclined to doubt that they're as broken as Stephen claims. The ip4r extension's main use case is range lookups. You get an ip

Re: [HACKERS] Why so few built-in range types?

2011-12-03 Thread Dimitri Fontaine
Hi, I wanted to craft an answer here and Peter nailed it before I could. I use ip4r in a bunch of different projects and environments, it's doing a perfect job, it's simple to use and damn efficient. The ipv6 support is on the way, parts of it are already be in the CVS at http://cvs.pgfoundry.or

[HACKERS] missing rename support

2011-12-03 Thread Peter Eisentraut
I noticed the following object types don't have support for an ALTER ... RENAME command: DOMAIN (but ALTER TYPE works) FOREIGN DATA WRAPPER OPERATOR RULE SERVER Are there any restrictions why these couldn't be added? (I stumbled upon this while trying to rename a foreign server, but we might as

Re: [HACKERS] [REVIEW] Patch for cursor calling with named parameters

2011-12-03 Thread Kevin Grittner
The patch is in context format, includes docs and additional regression tests, applies cleanly, passes "world" regression tests. The parser changes don't cause any "backing up". Discussion on the list seems to have reached a consensus that this patch implements a useful feature. A previous versi

Re: [HACKERS] Inlining comparators as a performance optimisation

2011-12-03 Thread Tom Lane
Robert Haas writes: > OK, so I tried to code this up. Adding the new amproc wasn't too > difficult (see attached). It wasn't obvious to me how to tie it into > the tuplesort infrastructure, though, so instead of wasting time > guessing what a sensible approach might be I'm going to use one of my

Re: [HACKERS] why local_preload_libraries does require a separate directory ?

2011-12-03 Thread Tomas Vondra
On 3.12.2011 18:53, Tom Lane wrote: > Tomas Vondra writes: >> why the libraries loaded using local_preload_libraries need to be placed >> in a different subdirectory than libraries loaded using >> shared_preload_libraries? > > Security: it lets the DBA constrain which libraries are loadable this w

Re: [HACKERS] Command Triggers

2011-12-03 Thread Andres Freund
On Saturday, December 03, 2011 12:04:57 AM Dimitri Fontaine wrote: > Hi, > > First thing first: thank you Andres for a great review, I do appreciate > it. Please find attached a newer version of the patch. The github > repository is also updated. > > Andres Freund writes: > > I think at least

Re: [HACKERS] why local_preload_libraries does require a separate directory ?

2011-12-03 Thread Tom Lane
Tomas Vondra writes: > why the libraries loaded using local_preload_libraries need to be placed > in a different subdirectory than libraries loaded using > shared_preload_libraries? Security: it lets the DBA constrain which libraries are loadable this way. > I do understand that leaving the user

Re: [HACKERS] psql line number reporting from stdin

2011-12-03 Thread Peter Eisentraut
On lör, 2011-11-26 at 22:36 +0200, Peter Eisentraut wrote: > There is a long-standing oddity in psql that running > > psql -f foo.sql > > returns error messages with file name and line number, like > > psql:foo.sql:1: ERROR: syntax error at or near "foo" > > but running > > psql < foo.sql doe

Re: [HACKERS] Bug in walsender when calling out to do_pg_stop_backup (and others?)

2011-12-03 Thread Heikki Linnakangas
On 19.10.2011 19:41, Greg Jaskiewicz wrote: On 19 Oct 2011, at 18:28, Florian Pflug wrote: All the other flags which indicate cancellation reasons are set from signal handers, I believe. We could of course mark as ClientConnectionLostPending as volatile just to be consistent. Not sure whether

Re: [HACKERS] backup_label during crash recovery: do we know how to solve it?

2011-12-03 Thread Heikki Linnakangas
On 03.12.2011 01:25, Daniel Farina wrote: Here's a protocol: have pg_start_backup() write a file that just means "backing up". Restarts are OK, because that's all it means, it has no meaning to a recovery/restoration process. When one wishes to restore, one must touch a file -- not unlike the t

Re: [HACKERS] [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

2011-12-03 Thread Magnus Hagander
On Sat, Dec 3, 2011 at 15:49, NISHIYAMA Tomoaki wrote: > Hi, > >> Have you verified if tihs affects _MSC_VER < 1400? Suddently that >> branch would care about HAVE_CRTDEFS_H, and I'm not sure if that's >> something we need to worry about. > > > I have no MSVC. In that sense it is not verified in f

[HACKERS] why local_preload_libraries does require a separate directory ?

2011-12-03 Thread Tomas Vondra
Hi, why the libraries loaded using local_preload_libraries need to be placed in a different subdirectory than libraries loaded using shared_preload_libraries? And why it does not use dynamic_library_path but a hardcoded path '$libdir/plugins'? I do understand that leaving the users to load whate

Re: [HACKERS] [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

2011-12-03 Thread NISHIYAMA Tomoaki
Hi, > Have you verified if tihs affects _MSC_VER < 1400? Suddently that > branch would care about HAVE_CRTDEFS_H, and I'm not sure if that's > something we need to worry about. I have no MSVC. In that sense it is not verified in fact, and I hope those who knows well would kindly comment on it.

Re: [HACKERS] [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

2011-12-03 Thread Magnus Hagander
On Sat, Dec 3, 2011 at 09:24, NISHIYAMA Tomoaki wrote: > Hi, > > A new patch: > check for the presence of crtdefs.h in configure > > -#if _MSC_VER >= 1400 || defined(WIN64) > +#if _MSC_VER >= 1400 || HAVE_CRTDEFS_H >  #define errcode __msvc_errcode >  #include >  #undef errcode Have you verified

Re: [HACKERS] Command Triggers

2011-12-03 Thread Dimitri Fontaine
Simon Riggs writes: > Those are especially important because in 9.2 DDL commands will cause > additional locking overheads, so preventing DDL will be essential to > keeping performance stable in high txn rate databases. The patch now implements "any command" triggers, and you have the command tag

Re: [HACKERS] Review of VS 2010 support patches

2011-12-03 Thread Brar Piening
Magnus Hagander wrote: I'd vote for whatever matches the "general perl pest practices" at this time. I didn't kow the "perl pest practices" until now but as the PostgreSQL community is more into C I think I know what you mean ;-) -- Sent via pgsql-hackers mailing list (pgsql-hackers@postg

Re: [HACKERS] review: CHECK FUNCTION statement

2011-12-03 Thread Albe Laurenz
Pavel Stehule wrote: >> My attempt at a syntax that could also cover Peter's wish for multiple >> checker functions: >> >> CHECK FUNCTION { func(args) | ALL [IN SCHEMA schema] [FOR ROLE user] } >>  [ USING check_function ] OPTIONS (optname optarg [, ...]) > check_function should be related to one

Re: [HACKERS] Prep object creation hooks, and related sepgsql updates

2011-12-03 Thread Kohei KaiGai
2011/12/3 Robert Haas : > On Fri, Dec 2, 2011 at 6:52 AM, Kohei KaiGai wrote: >> At least, it is working. However, it is not a perfect solution to the >> future updates >> of code paths in the core. > > Hmm.  So, do you want this committed?  If so, I think the major thing > it lacks is documentati

Re: [HACKERS] [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

2011-12-03 Thread NISHIYAMA Tomoaki
Hi, A new patch: check for the presence of crtdefs.h in configure -#if _MSC_VER >= 1400 || defined(WIN64) +#if _MSC_VER >= 1400 || HAVE_CRTDEFS_H #define errcode __msvc_errcode #include #undef errcode Perhaps there is no guarantee that mingw (not -w64) may not have crtdefs.h in the future v

Re: [HACKERS] [v9.2] Fix Leaky View Problem

2011-12-03 Thread Kohei KaiGai
I rebased my patch set. New functions in pg_proc.h prevented to apply previous revision cleanly. Here is no functional changes. 2011/11/3 Kohei KaiGai : > 2011/11/2 Tom Lane : >> Kohei KaiGai writes: >>> The reason why I redefined the relid of RangeTblEntry is to avoid >>> the problem when securi