Re: pg_dump of regression (again)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: pg_dump of regression (again)
Date: 2000-09-14 15:44:29
Message-ID: 14094.968946269@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> Continuing to try to use format_type to output all types, I get the
> following in the regression database:

> CREATE AGGREGATE newavg (
> BASETYPE = integer,
> SFUNC = int4_accum,
> STYPE = "numeric[]",
> INITCOND = '{0,0,0}',
> FINALFUNC = numeric_avg
> );

> where the original source was:

> CREATE AGGREGATE newavg (
> sfunc = int4_accum, basetype = int4,
> stype = _numeric,
> finalfunc = numeric_avg,
> initcond1 = '{0,0,0}'
> );

> The problem is the "numeric[]" type.

numeric[] is a correct display of the type (and more intelligible than
_numeric IMHO), but quoting it is not correct. If you are feeding the
output of format_type through something that believes it's quoting a
single identifier, you are going to have lots of problems. It looks
to me like format_type will supply quotes when needed, so you shouldn't
add more.

Unfortunately, this won't work anyway for CREATE AGGREGATE, because I'm
pretty sure the parser only accepts simple identifiers and literals as
arguments in the list of keyword = value items. The type-declaration
parser isn't invoked here, mainly because the grammar doesn't know
anything about the semantics of the individual keyword items. So you
have to give the raw type name, no fancy fandangoes ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-09-14 15:45:27 Re: Dumping views as views?
Previous Message Thomas Lockhart 2000-09-14 15:30:25 Re: Indexing of LIKE queries is broken in current sources