From 15c95399f8fd1cd7e48dfda7f11d2eb41d6b66de Mon Sep 17 00:00:00 2001 From: Ruslan Talpa Date: Fri, 9 Dec 2016 19:46:28 +0200 Subject: [PATCH] Prevent database memory cosumption by prepared statements caches (#768) --- CHANGELOG.md | 1 + src/PostgREST/QueryBuilder.hs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42a663364..853497b59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Customize content negotiation per route - @begriffs - Allow using nulls order without explicit order direction - @steve-chavez - Fatal error on postgres unsupported version, format supported version in error message - @steve-chavez +- Prevent database memory cosumption by prepared statements caches - @ruslantalpa ### Changed - Use HTTP 400 for raise\_exception - @begriffs diff --git a/src/PostgREST/QueryBuilder.hs b/src/PostgREST/QueryBuilder.hs index 03a077c82..2c9d41e94 100644 --- a/src/PostgREST/QueryBuilder.hs +++ b/src/PostgREST/QueryBuilder.hs @@ -93,7 +93,7 @@ encodeUniformObjs = createReadStatement :: SqlQuery -> SqlQuery -> Bool -> Bool -> Bool -> H.Query () ResultsWithCount createReadStatement selectQuery countQuery isSingle countTotal asCsv = - unicodeStatement sql HE.unit decodeStandard True + unicodeStatement sql HE.unit decodeStandard False where sql = [qc| WITH {sourceCTEName} AS ({selectQuery}) SELECT {cols}