these macros fail in if/else cases:
#define X \
{ \
... \
}
{
if (...)
X;
else
...
}
with proper setup:
#define X \
do { \
... \
} while (0)
it works fine.
(why bother dropping individual objects in a just-created database?)
as well as dangerous (as the code stands, the drops will be issued in
the wrong database, namely the one you were originally connected to).
never overwrite adjacent pages with copied data, even if page header
and/or item pointers are already corrupt. Change inspired by trouble
report from Alvaro Herrera.
environment strings need to be moved around, do so when called from
initial startup (main.c), not in init_ps_status. This eliminates the
former risk of invalidating saved environment-string pointers, since
no code has yet had a chance to grab any such pointers when main.c
is running.
in .:/home/postgres/testversion/bin:/opt/perl5.6.1/bin:/home/postgres/bin:/usr/local/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/upgrade/bin:/opt/CC/bin:/opt/langtools/bin:/opt/graphics/phigs/bin:/opt/java/bin:/bin:/opt/imake/bin:/opt/hparray/bin:/opt/aCC/bin:/opt/lrom/bin:/usr/local/nmh/bin:. (I suppose the only common case for this is '.').
per suggestion from Peter. Simplify several APIs by transmitting the
original argv location directly from main.c to ps_status.c, instead of
passing it down through several levels of subroutines.
Mask both typmod subfields for INTERVAL to avoid setting the high bit,
per dire warning from Tom Lane.
Clear tmask for DTK_ISO_TIME case to avoid time zone troubles.
Symptom reported by Tom Lane.
Clean up checking for valid time zone info in output routine.
This should now work for both SQL99 and Unix-style time zones.
Put in explicit check for INTERVAL() typmod rounding to avoid accumulating
cruft in the lower bits. Not sure that this helps, but we'll need to do
something. The symptom is visible with a query like
select interval(2) '10000 days 01:02:03.040506';
Regression tests are patched to repair the Tom Lane symptom, and all pass.