Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csWk0-0006Nr-Lu for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Mar 2017 15:39:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1csWk0-0003ej-8m for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Mar 2017 15:39:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1csWjz-0003bh-F7 for pgsql-bugs@postgresql.org; Mon, 27 Mar 2017 15:39:31 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1csWjw-0006zl-HP for pgsql-bugs@postgresql.org; Mon, 27 Mar 2017 15:39:30 +0000 Received: from [192.168.127.1] (port=48642 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1csWjt-000GUf-BC; Mon, 27 Mar 2017 15:39:25 +0000 Received: from [127.0.0.1] (port=21027 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1csWjs-000Pny-Ba; Mon, 27 Mar 2017 15:39:24 +0000 From: Andrew Gierth To: coladict@gmail.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14599: Segmentation fault and database corruption with hstore In-Reply-To: <20170327143251.2688.47498@wrigleys.postgresql.org> (coladict@gmail.com's message of "Mon, 27 Mar 2017 14:32:51 +0000") Message-ID: <87wpba7n5h.fsf@news-spur.riddles.org.uk> References: <20170327143251.2688.47498@wrigleys.postgresql.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Mon, 27 Mar 2017 16:39:23 +0100 MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org >>>>> "coladict" == coladict writes: coladict> 3. "CREATE CAST (varchar AS hstore) WITHOUT FUNCTION AS coladict> ASSIGNMENT;". If we skip step 4, everything works fine, but I coladict> was afraid it might fail with longer strings, so I did that coladict> anyway. What on earth makes you think this is safe or useful? Creating a WITHOUT FUNCTION cast opens a hole whereby you can feed values to the hstore functions which are not actually valid hstores, so _of course_ it crashes. (There's a good reason why only superusers can create such casts.) Once you've stored such a value in a table, then subsequent accesses to it will of course crash too. -- Andrew (irc:RhodiumToad) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs