Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHFEa-0000d8-5b for pgsql-general@arkaria.postgresql.org; Mon, 29 Oct 2018 21:38:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHFEV-0004aO-P7 for pgsql-general@arkaria.postgresql.org; Mon, 29 Oct 2018 21:37:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHFEV-0004aD-Gs for pgsql-general@lists.postgresql.org; Mon, 29 Oct 2018 21:37:59 +0000 Received: from smtp.burggraben.net ([2a01:4f8:140:50a2::3:1]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gHFET-00014i-Ca for pgsql-general@lists.postgresql.org; Mon, 29 Oct 2018 21:37:59 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.burggraben.net (Postfix) with ESMTP id A8EC66002F4 for ; Mon, 29 Oct 2018 22:37:55 +0100 (CET) X-Spam-Scanned: by amavisd-new at exwg.net Received: from smtp.burggraben.net ([127.0.0.1]) by localhost (ns.burggraben.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n6zRiBKYFMH5 for ; Mon, 29 Oct 2018 22:37:50 +0100 (CET) Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7120:1:127b:44ff:fe4f:148d]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "elch.exwg.net", Issuer "Christoph Moench-Tegeder" (verified OK)) by smtp.burggraben.net (Postfix) with ESMTPS for ; Mon, 29 Oct 2018 22:37:50 +0100 (CET) Received: by elch.exwg.net (Postfix, from userid 1000) id 43EC427376; Mon, 29 Oct 2018 22:37:50 +0100 (CET) Date: Mon, 29 Oct 2018 22:37:50 +0100 From: Christoph Moench-Tegeder To: pgsql-general@lists.postgresql.org Subject: Re: rw_redis_fdw: SQL Errors when statement is within a function Message-ID: <20181029213749.GA28998@elch.exwg.net> References: <20181025101948.r2hsnsm2ysn7q3ic@alap3.anarazel.de> <20181025215749.6yy3aparryceuker@squirrel.exwg.net> <20181026212725.33rqwraa73wpzq5f@squirrel.exwg.net> <20181027221321.zil4ktkmpkxbpmzv@squirrel.exwg.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ## GPT (gptmailinglists@gmail.com): > - In PG10.5 I run, out of function, a simple statement for 5 times > successfully and the 6th time I get an error "KEY is NULL". In the > meantime of these times I added, removed code, packages got updated, > etc. Suddenly, an error. Key is NULL!!!??? Check the key, write > statements to check the value of the key. Eh, it is not NULL! Hm, undo > all changes, start again! Oh, now it runs! Ok, redo the changes one by > one. Ah, ok still run. Suddenly, error again! Check again and again. > Ok check Redis. Uninstall packages, reinstall packages... Finally, > install PG9.6 make it run, install fdw to the new system, check the > environment. OK run. Keep it as it is! Your testing/debugging/validating processes seem to be a little erratic. Sometimes it does make sense to build minimal test cases; and to understand why things don't work or seem to be working again. > So, in order this thread to get over: > - PG developers made a drastic change. Not problem at all, more then welcome. > - I was the "lucky guy" who had a painful experience. These things > happen as Adrian wrote, and life goes on. Let me add another thing here: you're using software which is marked as "not really ready" (rw_redis_fdw/README.md: "work in progress and may have experience significant changes until it becomes stable") which uses very low level, internal interfaces to PostgreSQL; in a perhaps not-trivial project (there's PostgreSQL, Redis, rw_redis_fdw, you mentioned node.js and microservices...). I'm not sure you really did calculate the project risk of that. In some environments, such setup are called "technology jenga": deep stack with an unstable equilibrium. > What I would like to ask from developers is: > > Please, if possible improve the error system! > > Especially when there are internal changes which may affect > dynamically the outcome (from expected results to ERROR or whatever) > of a correct statement. I'm not sure we can do very much when external (not under any of our's control - I guess most people here wouldn't even have known about rw_redis_fdw until you mentioned it) components use interfaces in a fragile way. And as it was noted several times: the developer of that component identified the problem with the debug output (nothing fancy here) and fixed it. Regards, Christoph -- Spare Space