Re: how to add a new column in pg_proc table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: how to add a new column in pg_proc table
Дата
Msg-id 4218.1106671175@sss.pgh.pa.us
обсуждение исходный текст
Ответ на how to add a new column in pg_proc table  (noman naeem <doublevision_17@yahoo.com>)
Ответы Re: how to add a new column in pg_proc table  (noman naeem <doublevision_17@yahoo.com>)
Список pgsql-hackers
noman naeem <doublevision_17@yahoo.com> writes:
> I keep on getting errors.It be very helpful if some
> one can guide me regarding the basic steps for adding
> a column in the pg_proc table...

The odds are that you didn't correctly update either pg_proc.h itself,
the preset pg_attribute rows for it in pg_attribute.h (both versions!),
or you just forgot to adjust the number-of-attributes for pg_proc in
pg_class.h.

In pg_proc.h, remember that you have to fix the struct declaration,
the #defines for attribute numbers, plus adjust all the built-in entries
(that last is a *real* PITA...)

Not to mention adjust code that uses or updates pg_proc, particularly
catalog/pg_proc.c.

One other nonobvious gotcha is that varlength fields must be physically
positioned after all fixed-width fields, because the C code tends to
assume that it can get at fixed-width fields by struct overlay.

I'd suggest looking at the last patch that added a field to pg_proc for
guidelines and to make sure you did not miss anything:

2004-01-06 18:55  tgl
* doc/src/sgml/catalogs.sgml, src/backend/bootstrap/bootstrap.c,src/backend/catalog/pg_aggregate.c,
src/backend/catalog/pg_proc.c,src/backend/commands/functioncmds.c,
src/backend/nodes/copyfuncs.c,src/backend/nodes/equalfuncs.c,src/backend/parser/gram.y,src/backend/utils/adt/sets.c,
src/backend/utils/fmgr/fmgr.c,src/include/catalog/catversion.h,src/include/catalog/pg_attribute.h,
src/include/catalog/pg_class.h,src/include/catalog/pg_proc.h,src/include/nodes/nodes.h,src/include/nodes/parsenodes.h,
src/pl/plperl/plperl.c,src/pl/plpgsql/src/pl_comp.c,src/pl/plpython/plpython.c,src/pl/tcl/pltcl.c: Apply the core parts
ofDennis Bjorklund'spatch to allow function parameters to be declared with names. pg_proc has a column to store names,
andCREATE FUNCTION can insertdata into it, but that's all as yet.  I need to do more work on thepg_dump and plpgsql
portionsof the patch before committing those,but I thought I'd get the bulky changes in before the tree driftsunder me.
initdb forced due to pg_proc change.
 
        regards, tom lane


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: how to set password while loging into database