Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zrvih-0001m5-JN for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Oct 2015 22:30:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zrvig-0001Wb-Ve for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Oct 2015 22:30:55 +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.84) (envelope-from ) id 1ZrmmM-00008W-90 for pgsql-bugs@postgresql.org; Thu, 29 Oct 2015 12:58:06 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZrmmJ-00076r-D0 for pgsql-bugs@postgresql.org; Thu, 29 Oct 2015 12:58:05 +0000 MIME-Version: 1.0 Subject: BUG #13744: Postgresql function auto add 's' character to the end of string To: pgsql-bugs@postgresql.org From: b.phamhuu@jacobs-university.de Date: Thu, 29 Oct 2015 12:57:30 +0000 Message-ID: <20151029125730.3019.68524@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following bug has been logged on the website: Bug reference: 13744 Logged by: Bang Email address: b.phamhuu@jacobs-university.de PostgreSQL version: 9.2.13 Operating system: Centos 7 Description: I've a function in Postgresql database. However, every time I run the function in postgresql, it auto add character 's' behind of the query so it will be error when execute (for example: WHAT IN HERE: query SELECT uom_id FROM ps_quantity where id = 11s ). My version is Postgresql 9.2.13. How can I solve this? CREATE OR REPLACE FUNCTION select_field( selected_table text, selected_field text, field_type_sample anyelement, where_clause text DEFAULT ''::text) RETURNS anyelement AS $BODY$ DECLARE -- Log ME constant text := 'selected_field()'; -- Local variables _qry varchar := ''; _result_value ALIAS FOR $0; where_clause1 varchar := 'asdasdsad'; BEGIN RAISE NOTICE 'FUNCTION: SELECT_FIELD'; -- BANGPH RAISE NOTICE 'BANGPH - CHANGE 11s to 11'; _qry := 'SELECT uom_id FROM ps_quantity where id = 11'; RAISE NOTICE 'WHERE = %s', where_clause1; RAISE NOTICE 'WHAT IN HERE: query %s', _qry; -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs