agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
Need more info on PL/pgSQL compile listing
3+ messages / 2 participants
[nested] [flat]

* Need more info on PL/pgSQL compile listing
@ 2015-11-16 23:29 Michael Moore <michaeljmoore@gmail.com>
  2015-11-17 00:02 ` Re: Need more info on PL/pgSQL compile listing Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Michael Moore @ 2015-11-16 23:29 UTC (permalink / raw)
  To: pgsql-sql

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 would simply like to echo the input lines to the output or get a more
verbose message. I spent over an hour googling this but no luck.

This is the beginning of my input file if that helps:
*-- Generated by Ora2Pg, the Oracle database Schema converter, version 16.0*
*-- Copyright 2000-2015 Gilles DAROLD. All rights reserved.*
*-- DATASOURCE: dbi:Oracle:LCD1_DEV*

*SET client_encoding TO 'UTF8';*

*\set ON_ERROR_STOP OFF*

*-- Oracle package 'PXPORTAL2' declaration, please edit to match PostgreSQL
syntax.*
*-- PostgreSQL does not recognize PACKAGES, using SCHEMA instead.*
*DROP SCHEMA IF EXISTS pxportal2 CASCADE;*
*CREATE SCHEMA pxportal2;*

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Need more info on PL/pgSQL compile listing
  2015-11-16 23:29 Need more info on PL/pgSQL compile listing Michael Moore <michaeljmoore@gmail.com>
@ 2015-11-17 00:02 ` Tom Lane <tgl@sss.pgh.pa.us>
  2015-11-17 00:36   ` Re: Need more info on PL/pgSQL compile listing Michael Moore <michaeljmoore@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2015-11-17 00:02 UTC (permalink / raw)
  To: Michael Moore <michaeljmoore@gmail.com>; +Cc: pgsql-sql

Michael Moore <michaeljmoore@gmail.com> 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Need more info on PL/pgSQL compile listing
  2015-11-16 23:29 Need more info on PL/pgSQL compile listing Michael Moore <michaeljmoore@gmail.com>
  2015-11-17 00:02 ` Re: Need more info on PL/pgSQL compile listing Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-11-17 00:36   ` Michael Moore <michaeljmoore@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Moore @ 2015-11-17 00:36 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

Thanks Tom,
do you know if there is any kind of a switch or command to make the
compiler give a more detailed message?

On Mon, Nov 16, 2015 at 4:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Michael Moore <michaeljmoore@gmail.com> 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
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-11-17 00:36 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 23:29 Need more info on PL/pgSQL compile listing Michael Moore <michaeljmoore@gmail.com>
2015-11-17 00:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-11-17 00:36   ` Michael Moore <michaeljmoore@gmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox