Re: Stored Procedure warnings - Mailing list pgsql-general

From Tom Lane
Subject Re: Stored Procedure warnings
Date
Msg-id 12020.963367285@sss.pgh.pa.us
Whole thread Raw
In response to Stored Procedure warnings  (ryan <ryan@bel.bc.ca>)
List pgsql-general
ryan <ryan@bel.bc.ca> writes:
> be=# CREATE FUNCTION freeip ( int4 ) RETURNS inet AS '
> be'# (SELECT ip FROM allips WHERE net = $1)
> be'#   EXCEPT
> be'#  (SELECT ipaddr FROM ips WHERE ipaddr <<
> be'#    (SELECT net FROM nets WHERE netid = $1))
> be'# order by ip'
> be-# LANGUAGE 'sql';
> NOTICE:  _outNode: don't know how to print type 703
> NOTICE:  _outNode: don't know how to print type 703
> NOTICE:  _outNode: don't know how to print type 703
> NOTICE:  _outNode: don't know how to print type 703
> CREATE

It's fairly harmless ... I deduce that you are running the postmaster
with some fairly high -d setting, or you wouldn't see it at all.

The underlying problem here is that EXCEPT is implemented in a
bizarre way in which the second SELECT isn't run through the
parse analysis phase right away.  If you have parsetree dumping
turned on then the dumper encounters "raw" unanalyzed node types
that it doesn't know how to print.  No big deal, really.

We could extend the dumping code to know about more of the raw node
types, but IMHO the real problem is that EXCEPT is done the way it is.
It's on my hit list for 7.2...

            regards, tom lane

pgsql-general by date:

Previous
From: "Cesar A. K. Grossmann"
Date:
Subject: Complex checking with SQL
Next
From: Chris Bitmead
Date:
Subject: Re: psql and Gnu readline