Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZyTkI-0002W3-QD for pgsql-sql@arkaria.postgresql.org; Tue, 17 Nov 2015 00:03:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZyTkI-0006i2-5C for pgsql-sql@arkaria.postgresql.org; Tue, 17 Nov 2015 00:03:38 +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 1ZyTjI-00044S-2N for pgsql-sql@postgresql.org; Tue, 17 Nov 2015 00:02:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZyTjF-0007el-IR for pgsql-sql@postgresql.org; Tue, 17 Nov 2015 00:02:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id tAH02Upf004388; Mon, 16 Nov 2015 19:02:30 -0500 From: Tom Lane To: Michael Moore cc: pgsql-sql@postgresql.org Subject: Re: Need more info on PL/pgSQL compile listing In-reply-to: References: Comments: In-reply-to Michael Moore message dated "Mon, 16 Nov 2015 15:29:56 -0800" Date: Mon, 16 Nov 2015 19:02:30 -0500 Message-ID: <4387.1447718550@sss.pgh.pa.us> X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Michael Moore writes: > I am doing like: > *mydb-# \i pxportal2_mod.sql* > which gives an error like: > *CREATE FUNCTION* > *psql:pxportal2_mod.sql:309: NOTICE: type reference > tx_portal.portal_name%TYPE converted to character varying* > *psql:pxportal2_mod.sql:309: NOTICE: type reference > tx_service_catalog.service_code%TYPE converted to character varying* > *psql:pxportal2_mod.sql:309: ERROR: syntax error at or near "pxportal2"* > *LINE 61: pxportal2.dlogerror (v_program_name, v_program_loca...* > * ^* > The problem is that there are lots of directives and comments in my input > file so that neither line 309 (above) or 61 is actually meaningful. I think 309 will be the file line number of the start of the CREATE FUNCTION command, while 61 will be the line number within the function body. If you have /* ... */ style comments in your file, I think psql might end up considering the start of the comment before the CREATE FUNCTION command as being the start point of that command for this purpose. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql