Обсуждение: pgsql-server/ ontrib/tablefunc/tablefunc.c oc/ ...

Поиск
Список
Период
Сортировка

pgsql-server/ ontrib/tablefunc/tablefunc.c oc/ ...

От
tgl@svr1.postgresql.org (Tom Lane)
Дата:
CVSROOT:    /cvsroot
Module name:    pgsql-server
Changes by:    tgl@svr1.postgresql.org    04/02/03 13:34:04

Modified files:
    contrib/tablefunc: tablefunc.c
    doc/src/sgml   : backup.sgml installation.sgml perform.sgml
                     plpgsql.sgml runtime.sgml
    doc/src/sgml/ref: postgres-ref.sgml postmaster.sgml
    src/backend/access/nbtree: nbtree.c nbtsort.c
    src/backend/commands: vacuumlazy.c
    src/backend/executor: execQual.c nodeAgg.c nodeHash.c
                          nodeIndexscan.c nodeMaterial.c nodeSort.c
    src/backend/optimizer/path: costsize.c
    src/backend/optimizer/plan: planner.c subselect.c
    src/backend/optimizer/util: pathnode.c
    src/backend/tcop: postgres.c
    src/backend/utils/adt: ri_triggers.c
    src/backend/utils/init: globals.c
    src/backend/utils/misc: guc.c postgresql.conf.sample
    src/backend/utils/mmgr: portalmem.c
    src/backend/utils/sort: tuplesort.c tuplestore.c
    src/bin/psql   : tab-complete.c
    src/include/access: nbtree.h
    src/include    : miscadmin.h
    src/include/utils: tuplesort.h
    src/pl/plpgsql/src: pl_exec.c

Log message:
    Rename SortMem and VacuumMem to work_mem and maintenance_work_mem.
    Make btree index creation and initial validation of foreign-key constraints
    use maintenance_work_mem rather than work_mem as their memory limit.
    Add some code to guc.c to allow these variables to be referenced by their
    old names in SHOW and SET commands, for backwards compatibility.


Re: pgsql-server/ ontrib/tablefunc/tablefunc.c oc/ ...

От
Christopher Kings-Lynne
Дата:
> Log message:
>     Rename SortMem and VacuumMem to work_mem and maintenance_work_mem.
>     Make btree index creation and initial validation of foreign-key constraints
>     use maintenance_work_mem rather than work_mem as their memory limit.
>     Add some code to guc.c to allow these variables to be referenced by their
>     old names in SHOW and SET commands, for backwards compatibility.

Does this mean that if you go ALTER USER/SET sort_mem TO xxx, it will
set the variable work_mem=xxx in their pg_shadow row?

Chris


Re: pgsql-server/ ontrib/tablefunc/tablefunc.c oc/ ...

От
Tom Lane
Дата:
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>> Add some code to guc.c to allow these variables to be referenced by their
>> old names in SHOW and SET commands, for backwards compatibility.

> Does this mean that if you go ALTER USER/SET sort_mem TO xxx, it will
> set the variable work_mem=xxx in their pg_shadow row?

My first answer was "no, the pg_shadow row will still mention sort_mem,
but that will be accepted as meaning work_mem later on when you log in
as that user."

However, looking more closely, AlterUserSet converts option names to
canonical spelling before storing them, which means it Just Works:

regression=# create user foo;
CREATE USER
regression=# alter user foo set sort_mem = 999;
ALTER USER
regression=# select * from pg_shadow where usename = 'foo';
 usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil |   useconfig
---------+----------+-------------+----------+-----------+--------+----------+----------------
 foo     |      100 | f           | f        | f         |        |          | {work_mem=999}
(1 row)


Dang, sometimes nice things actually fall out of the code ...

            regards, tom lane