methods: they all invoke UpdateStats() since they have computed the
number of heap tuples, so I created a function in catalog/index.c that
each AM now calls.
collector messages, per recent discussion on pgsql-patches. This
actually required quite a few changes -- for example,
"databaseid != InvalidOid" was used to check whether a slot in the
backend entry table was initialized, but that no longer works since
the slot might be initialized prior to receiving the BESTART message
which contains the database id. We now use procpid > 0 to indicate
that a slot is non-empty.
Other changes:
- various comment improvements and cleanups
- there's no need to zero-out the entire activity buffer in
pgstat_add_backend(), we can just set activity[0] to '\0'.
- remove the counting of the # of connections to a database; this
was not used anywhere
One change in behavior I wasn't sure about: previously, the code
would create a hash table entry for a database as soon as any message
was received whose header referenced that database. Now, we only
create hash table entries as needed (so for example BESTART won't
create a database hash table entry, since it doesn't need to
access anything in the per-db hash table). It would be easy enough
to retain the old behavior, but AFAICS it is not required.
memset() or MemSet() to a char *. For one, memset()'s first argument is
a void *, and further void * can be implicitly coerced to/from any other
pointer type.
< * Add session start time and last statement time to pg_stat_activity
> * -Add session start time and last statement time to pg_stat_activity
134c134
< * Add the client IP address and port to pg_stat_activity
> * -Add the client IP address and port to pg_stat_activity
* Add session start time to pg_stat_activity
* Add the client IP address and port to pg_stat_activity
Original patch from Magnus Hagander, code review by Neil Conway. Catalog
version bumped. This patch sends the client IP address and port number in
every statistics message; that's not ideal, but will be fixed up shortly.
and VACUUM: in the interval between adding a new page to the relation
and formatting it, it was possible for VACUUM to come along and decide
it should format the page too. Though not harmful in itself, this would
cause data loss if a third transaction were able to insert tuples into
the vacuumed page before the original extender got control back.
before we check commit/abort status. Formerly this was done in some paths
but not all, with the result that a transaction might be considered
committed for some purposes before it became committed for others.
Per example found by Jan Wieck.
< Currently locale can only be set during initdb.
> Currently locale can only be set during initdb. No global tables have
> locale-aware columns. However, the database template used during
> database creation might have locale-aware indexes. The indexes would
> need to be reindexed to match the new locale.
interaction between ld, readline, termcap, and psql. The symptom is psql
failing with this error on startup:
symbol lookup error: /usr/lib64/libreadline.so.4: undefined symbol: BC
I'm still trying to find the best way to solve this, but in the mean time
I'm reverting the patch in order to unbreak FC3.
> * Prevent to_char() on interval from returning meaningless values
>
> For example, to_char('1 month', 'mon') is meaningless. Basically,
> most date-related parameters to to_char() are meaningless for
> intervals because interval is not anchored to a date.
>
> * Allow to_char() on interval values to accumulate the highest unit
> requested
>
> o to_char(INTERVAL '1 hour 5 minutes', 'MI') => 65
> o to_char(INTERVAL '43 hours 20 minutes', 'MI' ) => 2600
> o to_char(INTERVAL '43 hours 20 minutes', 'WK:DD:HR:MI') => 0:1:19:20
> o to_char(INTERVAL '3 years 5 months','MM') => 41
>
> Some special format flag would be required to request such
> accumulation. Such functionality could also be added to EXTRACT.
> Prevent accumulation that crosses the month/day boundary because of
> the uneven number of days in a month.
>
which is neither needed by nor related to that header. Remove the bogus
inclusion and instead include the header in those C files that actually
need it. Also fix unnecessary inclusions and bad inclusion order in
tsearch2 files.
associated with a hashtable is allocated in that hashtable's private
context, so that hash_destroy only has to destroy the context and not
do any retail pfree's; and tighten the inner loop of hash_seq_search.