CVS log for pgsql/src/backend/utils/init/Attic/flatfiles.c

[BACK] Up to [PostgreSQL CVS Repository] / pgsql / src / backend / utils / init

Request diff between arbitrary revisions - Display revisions graphically


Keyword substitution: kv
Default branch: MAIN


Revision 1.40
Tue Sep 1 02:54:51 2009 UTC (16 years ago) by alvherre
Branches: MAIN
CVS tags: HEAD
FILE REMOVED
Changes since revision 1.39: +1 -1 lines
Remove flatfiles.c, which is now obsolete.

Recent commits have removed the various uses it was supporting.  It was a
performance bottleneck, according to bug report #4919 by Lauris Ulmanis; seems
it slowed down user creation after a billion users.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Aug 31 02:23:22 2009 UTC (16 years ago) by tgl
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +1 -26 lines
Track the current XID wrap limit (or more accurately, the oldest unfrozen
XID) in checkpoint records.  This eliminates the need to recompute the value
from scratch during database startup, which is one of the two remaining
reasons for the flatfile code to exist.  It should also simplify life for
hot-standby operation.

To avoid bloating the checkpoint records unreasonably, I switched from
tracking the oldest database by name to tracking it by OID.  This turns
out to save cycles in general (everywhere but the warning-generating
paths, which we hardly care about) and also helps us deal with the case
that the oldest database got dropped instead of being vacuumed.  The prior
coding might go for a long time without updating the wrap limit in that case,
which is bad because it might result in a lot of useless autovacuum activity.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sat Aug 29 19:26:51 2009 UTC (16 years ago) by tgl
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +1 -6 lines
Remove the use of the pg_auth flat file for client authentication.
(That flat file is now completely useless, but removal will come later.)

To do this, postpone client authentication into the startup transaction
that's run by InitPostgres.  We still collect the startup packet and do
SSL initialization (if needed) at the same time we did before.  The
AuthenticationTimeout is applied separately to startup packet collection
and the actual authentication cycle.  (This is a bit annoying, since it
means a couple extra syscalls; but the signal handling requirements inside
and outside a transaction are sufficiently different that it seems best
to treat the timeouts as completely independent.)

A small security disadvantage is that if the given database name is invalid,
this will be reported to the client before any authentication happens.
We could work around that by connecting to database "postgres" instead,
but consensus seems to be that it's not worth introducing such surprising
behavior.

Processing of all command-line switches and GUC options received from the
client is now postponed until after authentication.  This means that
PostAuthDelay is much less useful than it used to be --- if you need to
investigate problems during InitPostgres you'll have to set PreAuthDelay
instead.  However, allowing an unauthenticated user to set any GUC options
whatever seems a bit too risky, so we'll live with that.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Wed Aug 12 20:53:30 2009 UTC (16 years ago) by tgl
Branches: MAIN
CVS tags: REL8_5_ALPHA1_BRANCH, REL8_5_ALPHA1
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +4 -25 lines
Allow backends to start up without use of the flat-file copy of pg_database.

To make this work in the base case, pg_database now has a nailed-in-cache
relation descriptor that is initialized using hardwired knowledge in
relcache.c.  This means pg_database is added to the set of relations that
need to have a Schema_pg_xxx macro maintained in pg_attribute.h.  When this
path is taken, we'll have to do a seqscan of pg_database to find the row
we need.

In the normal case, we are able to do an indexscan to find the database's row
by name.  This is made possible by storing a global relcache init file that
describes only the shared catalogs and their indexes (and therefore is usable
by all backends in any database).  A new backend loads this cache file,
finds its database OID after an indexscan on pg_database, and then loads
the local relcache init file for that database.

This change should effectively eliminate number of databases as a factor
in backend startup time, even with large numbers of databases.  However,
the real reason for doing it is as a first step towards getting rid of
the flat files altogether.  There are still several other sub-projects
to be tackled before that can happen.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Thu Jan 1 17:23:51 2009 UTC (16 years, 8 months ago) by momjian
Branches: MAIN
CVS tags: REL8_4_STABLE, REL8_4_RC2, REL8_4_RC1, REL8_4_BETA2, REL8_4_BETA1, REL8_4_4, REL8_4_3, REL8_4_2, REL8_4_1, REL8_4_0
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +2 -2 lines
Update copyright for 2009.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Jun 12 09:12:31 2008 UTC (17 years, 2 months ago) by heikki
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +13 -13 lines
Refactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation
forks. XLogOpenRelation() and the associated light-weight relation cache in
xlogutils.c is gone, and XLogReadBuffer() now takes a RelFileNode as argument,
instead of Relation.

For functions that still need a Relation struct during WAL replay, there's a
new function called CreateFakeRelcacheEntry() that returns a fake entry like
XLogOpenRelation() used to.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Mon May 12 00:00:52 2008 UTC (17 years, 3 months ago) by alvherre
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +4 -1 lines
Restructure some header files a bit, in particular heapam.h, by removing some
unnecessary #include lines in it.  Also, move some tuple routine prototypes and
macros to htup.h, which allows removal of heapam.h inclusion from some .c
files.

For this to work, a new header file access/sysattr.h needed to be created,
initially containing attribute numbers of system columns, for pg_dump usage.

While at it, make contrib ltree, intarray and hstore header files more
consistent with our header style.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Mon Apr 21 00:26:46 2008 UTC (17 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +8 -7 lines
Allow float8, int8, and related datatypes to be passed by value on machines
where Datum is 8 bytes wide.  Since this will break old-style C functions
(those still using version 0 calling convention) that have arguments or
results of these types, provide a configure option to disable it and retain
the old pass-by-reference behavior.  Likewise, provide a configure option
to disable the recently-committed float4 pass-by-value change.

Zoltan Boszormenyi, plus configurability stuff by me.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Mar 26 21:10:39 2008 UTC (17 years, 5 months ago) by alvherre
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +2 -1 lines
Move the HTSU_Result enum definition into snapshot.h, to avoid including
tqual.h into heapam.h.  This makes all inclusion of tqual.h explicit.

I also sorted alphabetically the includes on some source files.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Tue Mar 25 22:42:45 2008 UTC (17 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +5 -4 lines
Simplify and standardize conversions between TEXT datums and ordinary C
strings.  This patch introduces four support functions cstring_to_text,
cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and
two macros CStringGetTextDatum and TextDatumGetCString.  A number of
existing macros that provided variants on these themes were removed.

Most of the places that need to make such conversions now require just one
function or macro call, in place of the multiple notational layers that used
to be needed.  There are no longer any direct calls of textout or textin,
and we got most of the places that were using handmade conversions via
memcpy (there may be a few still lurking, though).

This commit doesn't make any serious effort to eliminate transient memory
leaks caused by detoasting toasted text objects before they reach
text_to_cstring.  We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few
places where it was easy, but much more could be done.

Brendan Jurd and Tom Lane

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Jan 1 19:45:53 2008 UTC (17 years, 8 months ago) by momjian
Branches: MAIN
CVS tags: REL8_3_STABLE, REL8_3_RC2, REL8_3_RC1, REL8_3_9, REL8_3_8, REL8_3_7, REL8_3_6, REL8_3_5, REL8_3_4, REL8_3_3, REL8_3_2, REL8_3_11, REL8_3_10, REL8_3_1, REL8_3_0
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +2 -2 lines
Update copyrights in source tree to 2008.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Thu Nov 15 21:14:40 2007 UTC (17 years, 9 months ago) by momjian
Branches: MAIN
CVS tags: REL8_3_BETA4, REL8_3_BETA3
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +24 -24 lines
pgindent run for 8.3.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Oct 15 15:11:29 2007 UTC (17 years, 10 months ago) by tgl
Branches: MAIN
CVS tags: REL8_3_BETA2
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +2 -14 lines
Include NOLOGIN roles in the 'flat' password file.  In the original
coding this was seen as useless, but the problem with not including them
is that the error message will often be something about authentication
failure, rather than the more helpful one about 'role is not permitted
to log in'.  Per discussion.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Wed Aug 1 22:45:08 2007 UTC (18 years, 1 month ago) by tgl
Branches: MAIN
CVS tags: REL8_3_BETA1
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +9 -1 lines
Support an optional asynchronous commit mode, in which we don't flush WAL
before reporting a transaction committed.  Data consistency is still
guaranteed (unlike setting fsync = off), but a crash may lose the effects
of the last few transactions.  Patch by Simon, some editorialization by Tom.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Tue Jun 12 17:16:52 2007 UTC (18 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +9 -2 lines
Add some comments about the safety of accessing rolpassword without using
the normal heap_getattr() machinery.  Per Greg Stark.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Fri Apr 6 04:21:43 2007 UTC (18 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +3 -3 lines
Support varlena fields with single-byte headers and unaligned storage.

This commit breaks any code that assumes that the mere act of forming a tuple
(without writing it to disk) does not "toast" any fields.  While all available
regression tests pass, I'm not totally sure that we've fixed every nook and
cranny, especially in contrib.

Greg Stark with some help from Tom Lane

Revision 1.24: download - view: text, markup, annotated - select for diffs
Fri Jan 5 22:19:43 2007 UTC (18 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -2 lines
Update CVS HEAD for 2007 copyright.  Back branches are typically not
back-stamped for this.

Revision 1.15.2.2: download - view: text, markup, annotated - select for diffs
Sun Nov 5 23:40:38 2006 UTC (18 years, 10 months ago) by tgl
Branches: REL8_1_STABLE
CVS tags: REL8_1_9, REL8_1_8, REL8_1_7, REL8_1_6, REL8_1_21, REL8_1_20, REL8_1_19, REL8_1_18, REL8_1_17, REL8_1_16, REL8_1_15, REL8_1_14, REL8_1_13, REL8_1_12, REL8_1_11, REL8_1_10
Diff to: previous 1.15.2.1: preferred, colored; branchpoint 1.15: preferred, colored; next MAIN 1.16: preferred, colored
Changes since revision 1.15.2.1: +25 -4 lines
Fix recently-identified PITR recovery hazard: the base backup could contain
stale relcache init files (pg_internal.init), and there is no mechanism for
updating them during WAL replay.  Easiest solution is just to delete the init
files at conclusion of startup, and let the first backend started in each
database take care of rebuilding the init file.  Simon Riggs and Tom Lane.

Back-patched to 8.1.  Arguably this should be fixed in 8.0 too, but it would
require significantly more code since 8.0 has no handy startup-time scan of
pg_database to piggyback on.  Manual solution of the problem is possible
in 8.0 (just delete the pg_internal.init files before starting WAL replay),
so that may be a sufficient answer.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sun Nov 5 23:40:31 2006 UTC (18 years, 10 months ago) by tgl
Branches: MAIN
CVS tags: REL8_2_STABLE, REL8_2_RC1, REL8_2_BETA3, REL8_2_9, REL8_2_8, REL8_2_7, REL8_2_6, REL8_2_5, REL8_2_4, REL8_2_3, REL8_2_2, REL8_2_17, REL8_2_16, REL8_2_15, REL8_2_14, REL8_2_13, REL8_2_12, REL8_2_11, REL8_2_10, REL8_2_1, REL8_2_0
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +25 -4 lines
Fix recently-identified PITR recovery hazard: the base backup could contain
stale relcache init files (pg_internal.init), and there is no mechanism for
updating them during WAL replay.  Easiest solution is just to delete the init
files at conclusion of startup, and let the first backend started in each
database take care of rebuilding the init file.  Simon Riggs and Tom Lane.

Back-patched to 8.1.  Arguably this should be fixed in 8.0 too, but it would
require significantly more code since 8.0 has no handy startup-time scan of
pg_database to piggyback on.  Manual solution of the problem is possible
in 8.0 (just delete the pg_internal.init files before starting WAL replay),
so that may be a sufficient answer.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sun Nov 5 22:42:09 2006 UTC (18 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +16 -20 lines
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios.  We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases.  Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId.  Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done.  Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database.  initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs.  Heikki Linnakangas, Simon Riggs, and Tom Lane.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Fri Jul 14 14:52:25 2006 UTC (19 years, 1 month ago) by momjian
Branches: MAIN
CVS tags: REL8_2_BETA2, REL8_2_BETA1
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +1 -3 lines
Remove 576 references of include files that were not needed.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Thu Jul 13 16:49:18 2006 UTC (19 years, 1 month ago) by momjian
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +3 -1 lines
Allow include files to compile own their own.

Strip unused include files out unused include files, and add needed
includes to C files.

The next step is to remove unused include files in C files.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Jul 10 16:20:51 2006 UTC (19 years, 2 months ago) by alvherre
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +15 -15 lines
Improve vacuum code to track minimum Xids per table instead of per database.
To this end, add a couple of columns to pg_class, relminxid and relvacuumxid,
based on which we calculate the pg_database columns after each vacuum.

We now force all databases to be vacuumed, even template ones.  A backend
noticing too old a database (meaning pg_database.datminxid is in danger of
falling behind Xid wraparound) will signal the postmaster, which in turn will
start an autovacuum iteration to process the offending database.  In principle
this is only there to cope with frozen (non-connectable) databases without
forcing users to set them to connectable, but it could force regular user
database to go through a database-wide vacuum at any time.  Maybe we should
warn users about this somehow.  Of course the real solution will be to use
autovacuum all the time ;-)

There are some additional improvements we could have in this area: for example
the vacuum code could be smarter about not updating pg_database for each table
when called by autovacuum, and do it only once the whole autovacuum iteration
is done.

I updated the system catalogs documentation, but I didn't modify the
maintenance section.  Also having some regression tests for this would be nice
but it's not really a very straightforward thing to do.

Catalog version bumped due to system catalog changes.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Thu May 4 16:07:29 2006 UTC (19 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +35 -11 lines
Rethink the locking mechanisms used for CREATE/DROP/RENAME DATABASE.
The former approach used ExclusiveLock on pg_database, which being a
cluster-wide lock meant only one of these operations could proceed at
a time; worse, it also blocked all incoming connections in ReverifyMyDatabase.
Now that we have LockSharedObject(), we can use locks of different types
applied to databases considered as objects.  This allows much more
flexible management of the interlocking: two CREATE DATABASEs need not
block each other, and need not block connections except to the template
database being used.  Similarly DROP DATABASE doesn't block unrelated
operations.  The locking used in flatfiles.c is also much narrower in
scope than before.  Per recent proposal.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sun Mar 5 15:58:46 2006 UTC (19 years, 6 months ago) by momjian
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +2 -2 lines
Update copyright for 2006.  Update scripts.

Revision 1.15.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 22 18:23:24 2005 UTC (19 years, 9 months ago) by momjian
Branches: REL8_1_STABLE
CVS tags: REL8_1_5, REL8_1_4, REL8_1_3, REL8_1_2, REL8_1_1
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +5 -5 lines
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory.  Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).

Backpatch to 8.1.X.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Nov 22 18:17:25 2005 UTC (19 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +5 -5 lines
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory.  Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).

Backpatch to 8.1.X.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Oct 15 02:49:33 2005 UTC (19 years, 10 months ago) by momjian
Branches: MAIN
CVS tags: REL8_1_0RC1, REL8_1_0BETA4, REL8_1_0
Branch point for: REL8_1_STABLE
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +103 -90 lines
Standard pgindent run for 8.1.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Aug 11 21:11:46 2005 UTC (20 years ago) by tgl
Branches: MAIN
CVS tags: REL8_1_0BETA3, REL8_1_0BETA2, REL8_1_0BETA1
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +13 -8 lines
Autovacuum loose end mop-up.  Provide autovacuum-specific vacuum cost
delay and limit, both as global GUCs and as table-specific entries in
pg_autovacuum.  stats_reset_on_server_start is now OFF by default,
but a reset is forced if we did WAL replay.  XID-wrap vacuums do not
ANALYZE, but do FREEZE if it's a template database.  Alvaro Herrera

Revision 1.13: download - view: text, markup, annotated - select for diffs
Thu Jul 28 22:27:02 2005 UTC (20 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +3 -7 lines
Make use of new list primitives list_append_unique and list_concat_unique
where applicable.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Jul 4 04:51:50 2005 UTC (20 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +12 -24 lines
Arrange for the postmaster (and standalone backends, initdb, etc) to
chdir into PGDATA and subsequently use relative paths instead of absolute
paths to access all files under PGDATA.  This seems to give a small
performance improvement, and it should make the system more robust
against naive DBAs doing things like moving a database directory that
has a live postmaster in it.  Per recent discussion.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Wed Jun 29 20:34:15 2005 UTC (20 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +25 -21 lines
More cleanup on roles patch.  Allow admin option to be inherited through
role memberships; make superuser/createrole distinction do something
useful; fix some locking and CommandCounterIncrement issues; prevent
creation of loops in the membership graph.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue Jun 28 22:16:45 2005 UTC (20 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +145 -103 lines
Fix up problems in write_auth_file and parsing of the auth file.
In particular, make hba.c cope with zero-length tokens, which it
never did properly before.  Also, enforce rolcanlogin.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Tue Jun 28 05:09:02 2005 UTC (20 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +261 -279 lines
Replace pg_shadow and pg_group by new role-capable catalogs pg_authid
and pg_auth_members.  There are still many loose ends to finish in this
patch (no documentation, no regression tests, no pg_dump support for
instance).  But I'm going to commit it now anyway so that Alvaro can
make some progress on shared dependencies.  The catalog changes should
be pretty much done.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Fri Jun 17 22:32:47 2005 UTC (20 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +70 -1 lines
Two-phase commit.  Original patch by Heikki Linnakangas, with additional
hacking by Alvaro Herrera and Tom Lane.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Jun 6 17:01:24 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +4 -4 lines
Remove the mostly-stubbed-out-anyway support routines for WAL UNDO.
That code is never going to be used in the foreseeable future, and
where it's more than a stub it's making the redo routines harder to
read.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Apr 14 20:03:26 2005 UTC (20 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +4 -5 lines
Completion of project to use fixed OIDs for all system catalogs and
indexes.  Replace all heap_openr and index_openr calls by heap_open
and index_open.  Remove runtime lookups of catalog OID numbers in
various places.  Remove relcache's support for looking up system
catalogs by name.  Bulky but mostly very boring patch ...

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Apr 14 01:38:20 2005 UTC (20 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +7 -7 lines
First phase of project to use fixed OIDs for all system catalogs and
indexes.  Extend the macros in include/catalog/*.h to carry the info
about hand-assigned OIDs, and adjust the genbki script and bootstrap
code to make the relations actually get those OIDs.  Remove the small
number of RelOid_pg_foo macros that we had in favor of a complete
set named like the catname.h and indexing.h macros.  Next phase will
get rid of internal use of names for looking up catalogs and indexes;
but this completes the changes forcing an initdb, so it looks like a
good place to commit.
Along the way, I made the shared relations (pg_database etc) not be
'bootstrap' relations any more, so as to reduce the number of hardwired
entries and simplify changing those relations in future.  I'm not
sure whether they ever really needed to be handled as bootstrap
relations, but it seems to work fine to not do so now.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Feb 26 18:43:33 2005 UTC (20 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +5 -15 lines
Finish up the flat-files project: get rid of GetRawDatabaseInfo() hack
in favor of looking at the flat file copy of pg_database during backend
startup.  This should finally eliminate the various corner cases in which
backend startup fails unexpectedly because it isn't able to distinguish
live and dead tuples in pg_database.  Simplify locking on pg_database
to be similar to the rules used with pg_shadow and pg_group, and eliminate
FlushRelationBuffers operations that were used only to reduce the odds
of failure of GetRawDatabaseInfo.
initdb forced due to addition of a trigger to pg_database.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Feb 20 22:02:19 2005 UTC (20 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +13 -13 lines
Use SnapshotNow instead of SnapshotSelf for reading the catalogs
during flat-file writing.  The only difference is that SnapshotSelf
would consider tuples of the 'current command' within the current
transaction as valid, where SnapshotNow wouldn't.  We can eliminate
the need for this with one extra CommandCounterIncrement call before
we start reading the catalogs.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Feb 20 04:45:59 2005 UTC (20 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +76 -89 lines
Flat file cleanup phase 2: make it work for pg_group.  The flat group
file now identifies group members by usesysid not name; this avoids
needing to depend on SearchSysCache which we can't use during startup.
(The old representation was entirely broken anyway, since we did not
regenerate the file following RENAME USER.)  It's only a 95% solution
because if the group membership list is big enough to be toasted out
of line, we cannot read it during startup.  I think this will do for
the moment, until we have time to implement the planned pg_role
replacement for pg_group.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sun Feb 20 02:22:00 2005 UTC (20 years, 6 months ago) by tgl
Branches: MAIN
Add code to prevent transaction ID wraparound by enforcing a safe limit
in GetNewTransactionId().  Since the limit value has to be computed
before we run any real transactions, this requires adding code to database
startup to scan pg_database and determine the oldest datfrozenxid.
This can conveniently be combined with the first stage of an attack on
the problem that the 'flat file' copies of pg_shadow and pg_group are
not properly updated during WAL recovery.  The code I've added to
startup resides in a new file src/backend/utils/init/flatfiles.c, and
it is responsible for rewriting the flat files as well as initializing
the XID wraparound limit value.  This will eventually allow us to get
rid of GetRawDatabaseInfo too, but we'll need an initdb so we can add
a trigger to pg_database.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

PostgreSQL CVSweb <webmaster@postgresql.org>