pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
adding fields to pg_database
6+ messages / 3 participants
[nested] [flat]

* adding fields to pg_database
@ 2006-04-11 17:54  Markus Schiltknecht <markus@bluegap.ch>
  0 siblings, 1 reply; 6+ messages in thread

From: Markus Schiltknecht @ 2006-04-11 17:54 UTC (permalink / raw)
  To: pgsql-hackers

Hi,

I'm trying to add fields to pg_database in the system catalog. As long
as I add fixed-size fields before the VAR LENGTH ones, that's all fine.

But adding a VAR LENGTH (text) field initdb fails at: copying template1
to template0. The child process 'postgres' fails with signal 11. Strange
enough I suspect the segfault to occure at program termination (?). That
is just after the following initdb commands have been executed:


...

"REVOKE CREATE,TEMPORARY ON DATABASE template1 FROM public;\n",
"REVOKE CREATE,TEMPORARY ON DATABASE template0 FROM public;\n",

/*
 * Finally vacuum to clean up dead rows in pg_database
 */
"VACUUM FULL pg_database;\n",


I've only added the fields in include/catalog/pg_database.h. Do I need
to fiddle other places?

Regards

Markus





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: adding fields to pg_database
@ 2006-04-11 18:07  Jonah H. Harris <jonah.harris@gmail.com>
  parent: Markus Schiltknecht <markus@bluegap.ch>
  0 siblings, 2 replies; 6+ messages in thread

From: Jonah H. Harris @ 2006-04-11 18:07 UTC (permalink / raw)
  To: Markus Schiltknecht <markus@bluegap.ch>; +Cc: pgsql-hackers

On 4/11/06, Markus Schiltknecht <markus@bluegap.ch> wrote:
> I've only added the fields in include/catalog/pg_database.h. Do I need
> to fiddle other places?

Make sure you updated Natts_pg_database, the bootstrap DATA line, and
the stuff in src/backend/commands/dbcommands.c.

Other than that I don't know what's totally related to pg_database
itself as I haven't changed it in a long time.


--
Jonah H. Harris, Database Internals Architect
EnterpriseDB Corporation
732.331.1324



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: adding fields to pg_database
@ 2006-04-11 18:12  Markus Schiltknecht <markus@bluegap.ch>
  parent: Jonah H. Harris <jonah.harris@gmail.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Markus Schiltknecht @ 2006-04-11 18:12 UTC (permalink / raw)
  To: Jonah H. Harris <jonah.harris@gmail.com>; +Cc: pgsql-hackers

On Tue, 2006-04-11 at 14:07 -0400, Jonah H. Harris wrote:
> Make sure you updated Natts_pg_database, the bootstrap DATA line, and
> the stuff in src/backend/commands/dbcommands.c.

dbcommands.c was the missing peace, thank you!

Markus





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: adding fields to pg_database
@ 2006-04-11 18:15  Jonah H. Harris <jonah.harris@gmail.com>
  parent: Markus Schiltknecht <markus@bluegap.ch>
  0 siblings, 0 replies; 6+ messages in thread

From: Jonah H. Harris @ 2006-04-11 18:15 UTC (permalink / raw)
  To: Markus Schiltknecht <markus@bluegap.ch>; +Cc: pgsql-hackers

On 4/11/06, Markus Schiltknecht <markus@bluegap.ch> wrote:
> dbcommands.c was the missing peace, thank you!

No problemo :)

--
Jonah H. Harris, Database Internals Architect
EnterpriseDB Corporation
732.331.1324



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: adding fields to pg_database
@ 2006-04-11 18:25  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jonah H. Harris <jonah.harris@gmail.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Tom Lane @ 2006-04-11 18:25 UTC (permalink / raw)
  To: Jonah H. Harris <jonah.harris@gmail.com>; +Cc: Markus Schiltknecht <markus@bluegap.ch>; pgsql-hackers

"Jonah H. Harris" <jonah.harris@gmail.com> writes:
> On 4/11/06, Markus Schiltknecht <markus@bluegap.ch> wrote:
>> I've only added the fields in include/catalog/pg_database.h. Do I need
>> to fiddle other places?

> Make sure you updated Natts_pg_database, the bootstrap DATA line, and
> the stuff in src/backend/commands/dbcommands.c.

Good ways to answer this sort of question are:

1. Grep for references to some of the existing fields in the same catalog.

2. Look at the CVS diff for previous commits that added fields to the
same catalog.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: adding fields to pg_database
@ 2006-04-11 18:39  Jonah H. Harris <jonah.harris@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Jonah H. Harris @ 2006-04-11 18:39 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Markus Schiltknecht <markus@bluegap.ch>; pgsql-hackers

On 4/11/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Good ways to answer this sort of question are:
>
> 1. Grep for references to some of the existing fields in the same catalog.
>
> 2. Look at the CVS diff for previous commits that added fields to the
> same catalog.

True, true.

--
Jonah H. Harris, Database Internals Architect
EnterpriseDB Corporation
732.331.1324



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2006-04-11 18:39 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-11 17:54 adding fields to pg_database Markus Schiltknecht <markus@bluegap.ch>
2006-04-11 18:07 ` Jonah H. Harris <jonah.harris@gmail.com>
2006-04-11 18:12   ` Markus Schiltknecht <markus@bluegap.ch>
2006-04-11 18:15     ` Jonah H. Harris <jonah.harris@gmail.com>
2006-04-11 18:25   ` Tom Lane <tgl@sss.pgh.pa.us>
2006-04-11 18:39     ` Jonah H. Harris <jonah.harris@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox