pgsql: Adjust naming of indexes and their columns per recent discussion.

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Adjust naming of indexes and their columns per recent discussion.
Дата
Msg-id 20091223023525.B3F5A753FB7@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Adjust naming of indexes and their columns per recent discussion.

Index expression columns are now named after the FigureColname result for
their expressions, rather than always being "pg_expression_N".  Digits are
appended to this name if needed to make the column name unique within the
index.  (That happens for regular columns too, thus fixing the old problem
that CREATE INDEX fooi ON foo (f1, f1) fails.  Before exclusion indexes
there was no real reason to do such a thing, but now maybe there is.)

Default names for indexes and associated constraints now include the column
names of all their columns, not only the first one as in previous practice.
(Of course, this will be truncated as needed to fit in NAMEDATALEN.  Also,
pkey indexes retain the historical behavior of not naming specific columns
at all.)

An example of the results:

regression=# create table foo (f1 int, f2 text,
regression(# exclude (f1 with =, lower(f2) with =));
NOTICE:  CREATE TABLE / EXCLUDE will create implicit index "foo_f1_lower_exclusion" for table "foo"
CREATE TABLE
regression=# \d foo_f1_lower_exclusion
Index "public.foo_f1_lower_exclusion"
 Column |  Type   | Definition
--------+---------+------------
 f1     | integer | f1
 lower  | text    | lower(f2)
btree, for table "public.foo"

Modified Files:
--------------
    pgsql/src/backend/bootstrap:
        bootparse.y (r1.101 -> r1.102)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/bootstrap/bootparse.y?r1=1.101&r2=1.102)
    pgsql/src/backend/catalog:
        index.c (r1.326 -> r1.327)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/index.c?r1=1.326&r2=1.327)
        toasting.c (r1.21 -> r1.22)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/toasting.c?r1=1.21&r2=1.22)
    pgsql/src/backend/commands:
        indexcmds.c (r1.188 -> r1.189)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/indexcmds.c?r1=1.188&r2=1.189)
    pgsql/src/backend/nodes:
        copyfuncs.c (r1.454 -> r1.455)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.454&r2=1.455)
        equalfuncs.c (r1.376 -> r1.377)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c?r1=1.376&r2=1.377)
        outfuncs.c (r1.375 -> r1.376)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.375&r2=1.376)
    pgsql/src/backend/parser:
        gram.y (r2.697 -> r2.698)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y?r1=2.697&r2=2.698)
        parse_target.c (r1.174 -> r1.175)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_target.c?r1=1.174&r2=1.175)
        parse_utilcmd.c (r2.34 -> r2.35)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_utilcmd.c?r1=2.34&r2=2.35)
    pgsql/src/include/catalog:
        index.h (r1.78 -> r1.79)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/index.h?r1=1.78&r2=1.79)
    pgsql/src/include/commands:
        defrem.h (r1.98 -> r1.99)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/defrem.h?r1=1.98&r2=1.99)
    pgsql/src/include/nodes:
        parsenodes.h (r1.419 -> r1.420)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/parsenodes.h?r1=1.419&r2=1.420)
    pgsql/src/include/parser:
        parse_target.h (r1.44 -> r1.45)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/parse_target.h?r1=1.44&r2=1.45)
    pgsql/src/test/regress/expected:
        alter_table.out (r1.118 -> r1.119)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/alter_table.out?r1=1.118&r2=1.119)
        foreign_key.out (r1.49 -> r1.50)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/foreign_key.out?r1=1.49&r2=1.50)
        inherit.out (r1.30 -> r1.31)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/inherit.out?r1=1.30&r2=1.31)
    pgsql/src/test/regress/output:
        constraints.source (r1.46 -> r1.47)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/output/constraints.source?r1=1.46&r2=1.47)

В списке pgsql-committers по дате отправления:

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Disallow comments on columns of relation types other than tables,
Следующее
От: momjian@postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: Rename pg_dump.c TypeInfo variable tinfo to tyinfo, for clarity.