pgsql: Add generate_subscripts, a series-generation function which

Started by Alvaro Herreraalmost 18 years ago4 messageshackers
Jump to latest
#1Alvaro Herrera
alvherre@postgresql.org

Log Message:
-----------
Add generate_subscripts, a series-generation function which generates an
array's subscripts.

Pavel Stehule, some editorialization by me.

Modified Files:
--------------
pgsql/doc/src/sgml:
array.sgml (r1.65 -> r1.66)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/array.sgml?r1=1.65&r2=1.66)
func.sgml (r1.433 -> r1.434)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/func.sgml?r1=1.433&r2=1.434)
pgsql/src/backend/utils/adt:
arrayfuncs.c (r1.143 -> r1.144)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/arrayfuncs.c?r1=1.143&r2=1.144)
pgsql/src/include/catalog:
pg_proc.h (r1.492 -> r1.493)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_proc.h?r1=1.492&r2=1.493)
pgsql/src/include/utils:
array.h (r1.66 -> r1.67)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/array.h?r1=1.66&r2=1.67)
pgsql/src/test/regress/expected:
arrays.out (r1.35 -> r1.36)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/arrays.out?r1=1.35&r2=1.36)
pgsql/src/test/regress/sql:
arrays.sql (r1.27 -> r1.28)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/arrays.sql?r1=1.27&r2=1.28)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#1)
Re: pgsql: Add generate_subscripts, a series-generation function which

alvherre@postgresql.org (Alvaro Herrera) writes:

Add generate_subscripts, a series-generation function which generates an
array's subscripts.

Why are these marked volatile in pg_proc? Surely they generate the
same outputs given the same inputs, and therefore qualify as immutable.

regards, tom lane

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#2)
Re: [COMMITTERS] pgsql: Add generate_subscripts, a series-generation function which

Tom Lane wrote:

alvherre@postgresql.org (Alvaro Herrera) writes:

Add generate_subscripts, a series-generation function which generates an
array's subscripts.

Why are these marked volatile in pg_proc? Surely they generate the
same outputs given the same inputs, and therefore qualify as immutable.

Hmm, true.

I'll change the four generate_series variants too -- they are marked
volatile as well.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#3)
Re: [COMMITTERS] pgsql: Add generate_subscripts, a series-generation function which

Alvaro Herrera <alvherre@commandprompt.com> writes:

I'll change the four generate_series variants too -- they are marked
volatile as well.

I don't think the system actually pays much attention to the volatility
marking of set-returning functions at the moment, so it wouldn't be too
surprising if they were all wrong :-(. Still, we may as well get the
catalog entries right for possible future use.

regards, tom lane