Commit Graph

4140 Commits

Author SHA1 Message Date
Tom Lane ffbeafb19a Constant expressions that appear in ORDER BY, GROUP BY, DISTINCT ON
lists should be reverse-compiled into targetlist index numbers, because
that's the only interpretation the parser allows for a constant in these
clauses.  (Ergo, the only way they could have gotten into the list in
the first place is to have come from the targetlist; so this should always
work.)  Per problem report from Peter E.
2001-04-15 03:14:18 +00:00
Tom Lane f9094c44c0 Prevent generation of invalid plans for RIGHT or FULL joins with multiple
join clauses.  The mergejoin executor wants all the join clauses to appear
as merge quals, not as extra joinquals, for these kinds of joins.  But the
planner would consider plans in which partially-sorted input paths were
used, leading to only some of the join clauses becoming merge quals.
This is fine for inner/left joins, not fine for right/full joins.
2001-04-15 00:48:17 +00:00
Bruce Momjian 25efda227d Add debug_query_string global variable for pgmonitor and debugging use. 2001-04-14 19:11:45 +00:00
Tom Lane 83c94a886c Another try at making numeric MODULO operator produce the right answer.
Although it was now using the right equation, it was making bogus choices
of the precision to compute intermediate results to.  I'm not sure this
is really right even yet, but it's better than before ...
2001-04-14 02:10:57 +00:00
Tom Lane f10596c3ec Fix comment that Vadim found confusing. 2001-04-05 16:55:21 +00:00
Vadim B. Mikheev 3092869233 StartupXLOG(): initialize XLogCtl->Insert to new page if there is
no room for a record on last log page.
2001-04-05 09:34:32 +00:00
Tom Lane 6faf150a30 Fix/cleanup DLLLIBS handling for Cygwin port. If it works it's to
Jason Tishler's credit, if it's broken it's my fault ...
2001-04-04 21:15:56 +00:00
Vadim B. Mikheev 278aa680fc Have to lock buffer while changing page' LSN.
Thanks to Tom.
2001-04-04 15:43:25 +00:00
Vadim B. Mikheev 1d9819d69e Log sequence creation (to initialize magic number on recovery). 2001-04-03 21:58:00 +00:00
Tom Lane 1c68f27877 Correct bogus mktime() calls. 2001-04-03 18:05:53 +00:00
Tom Lane 08bf4d797b Check for failure of malloc() and realloc() when allocating space for
VFD entries.  On platforms where dereferencing a null pointer doesn't
lead to coredump, it's possible that this omission could have led to
unpleasant behavior like deleting the wrong file.
2001-04-03 04:07:02 +00:00
Tom Lane 6cc6f18d15 open(2) flags saved for re-opening a virtual file should probably not
include O_CREAT.
2001-04-03 02:31:52 +00:00
Tom Lane 503c80d2a0 Restore pre-7.1 behavior of allowing DROP of a table whose underlying
physical file has disappeared.  There is no really good reason why
relcache should be opening the underlying file at all, AFAICS.
In any case we needn't raise a hard error here.
2001-04-02 23:30:04 +00:00
Tom Lane 244fd47124 _mdfd_getrelnfd() should include kernel error code in failure message. 2001-04-02 23:20:24 +00:00
Tom Lane e18f5011aa Complain if the same column name is inherited from multiple parents
with different default values, unless the child table redeclares the
column with an explicit default.  This was judged to be the approach
least likely to cause unpleasant surprises.
2001-04-02 18:30:49 +00:00
Bruce Momjian 97c04fad82 Disable creation of indexes on system tables. 2001-04-02 14:34:25 +00:00
Tom Lane ba8b844f5a Remove duplicate definition of DLLLIBS, per gripe from Fred Yankowski. 2001-04-02 03:21:23 +00:00
Tom Lane 5967dbd082 Tom Ivar Helbekkmo <tih@kpnQwest.no> says that dynamic linking works
now on VAX NetBSD.  Hence, remove #ifdef'd disable tests.
2001-04-02 03:08:30 +00:00
Tom Lane 2ef99ee708 Planner wasn't correctly handling adjustment of tuple_fraction for the
case of LIMIT in a sub-select.
2001-04-01 22:37:19 +00:00
Tom Lane 648c09181e Re-allow specification of a new default value for an inherited column
in CREATE TABLE, but give a warning notice.  Clean up inconsistent
handling of defaults and NOT NULL flags from multiply-inherited columns.
Per pghackers discussion 28-Mar through 30-Mar.
2001-03-30 20:50:36 +00:00
Peter Eisentraut e692b0130b Rename 'random_seed' back to 'seed'. 2001-03-29 19:03:57 +00:00
Tom Lane f155cc82ec Quick hack to fix Oliver Elphick's problem with subselects in an
inheritance query: make duplicate copies of subplans in adjust_inherited_attrs.
When we redesign querytrees we really gotta do something about this
issue of whether querytrees are read-only and can share substructure
or not.
2001-03-27 18:02:19 +00:00
Tom Lane fa0f2c6577 Repair pgindent damage to comments. 2001-03-27 17:12:34 +00:00
Bruce Momjian 341cb70044 The following patch updates the FAQ_AIX and makes C++ code work with
more recent versions of the IBM C++ compiler (now called VisualAge C++).
The C++ part was previously broken (g++ and xlC), thus this is zero risk.
Only AIX specific parts are touched (1 Makefile.shlib line (link with $(COMPILER
) instead
of $(CC) and one shell script line (parameter -C to nm to not demangle C++ symbo
ls for
.exp file)).

I thus ask you to please apply this patch before release.

With or without this patch RC1 on AIX 4.3.2 RS6000 passes "gmake check" for both
 the native
compiler vac.C 5.0.1 and gcc 2.95.2 :-)

Andreas
2001-03-27 14:56:20 +00:00
Tom Lane ff71301806 Spell __volatile__ correctly. 2001-03-27 01:16:24 +00:00
Bruce Momjian 33881e4f68 Add period to message. 2001-03-26 17:00:54 +00:00
Bruce Momjian 099b60b352 Change message to _the_ administrator. There is only one administrative
account.

	This connection has been terminated by the administrator.
2001-03-26 16:59:38 +00:00
Tom Lane ccd415c63f Fix unportable assumptions about alignment of local char[n] variables. 2001-03-25 23:23:59 +00:00
Tom Lane 00713cb7cb Fix code that incorrectly assumed a 'char foo[N]' local variable would
be aligned on a word boundary.  Per report from Steve Nicolai.
2001-03-25 00:45:20 +00:00
Tom Lane e458ebfd21 When using 'long long int' for int64 type, check to see if the compiler
accepts nnnLL syntax for long long constants.  If so, decorate the CRC64
constants with LL to avoid warnings and/or erroneous results from certain
non-standards-compliant compilers.
2001-03-23 18:42:12 +00:00
Tom Lane 32924c1c90 Mark exception and assert global variables as DLLIMPORT, so that plpgsql
can be compiled with asserts enabled on Windoze.
2001-03-23 18:26:01 +00:00
Bruce Momjian 7cf952e7b4 Fix comments that were mis-wrapped, for Tom Lane. 2001-03-23 04:49:58 +00:00
Tom Lane b32cac8055 Fix Joubert's complaint that int8-sized numeric literals are mishandled
on Alpha (because parser mistakenly assumes that a nonoverflow result
from strtol means the value will fit into int4).  A scan for other uses
of strtol and strtoul found a couple other places with the same mistake;
fix them too.  The changes are all conditional on HAVE_LONG_INT_64 to
avoid complaints from compilers that think x != x is a silly test
(cf. pg_atoi).
2001-03-22 17:41:47 +00:00
Bruce Momjian 0686d49da0 Remove dashes in comments that don't need them, rewrap with pgindent. 2001-03-22 06:16:21 +00:00
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Vadim B. Mikheev ab36582a19 Check bufHdr->cntxDirty and call StartBufferIO in BufferSync()
*before* acquiring shlock on buffer context. This way we should be
protected against conflicts with FlushRelationBuffers.
(Seems we never do excl lock and then StartBufferIO for the same
buffer, so there should be no deadlock here, - but we'd better
check this very soon).
2001-03-21 10:13:29 +00:00
Bruce Momjian 85c0c73267 Fix 'ps' WAIT status display bug on setproctitle() platforms, cleared by
Tom Lane.
2001-03-20 22:31:54 +00:00
Tom Lane 68bc848766 Tweak out-of-memory error messages to include the request size, so that
it's easier to tell whether a bug report is talking about progressive
memory exhaustion or a wacko requested chunk size.
2001-03-19 22:29:39 +00:00
Tom Lane 184fb14b90 Make regular-expression error messages a tad less obscure,
per gripe from Josh Berkus.
2001-03-19 22:27:46 +00:00
Tom Lane af6e88a9cf Remove NEXTXID xlog record type to avoid three-way deadlock risk.
NEXTXID isn't really necessary, per previous discussion in pghackers,
but I mulishy insisted we should put it in anyway.  Mea culpa.
2001-03-18 20:18:59 +00:00
Tom Lane ddc5bc958a When we add 'waiting' to the ps_status display, there should be a
space in front of it.  Improve comments a little.
2001-03-18 20:13:13 +00:00
Tom Lane 934126b518 Considering the BeOS port didn't compile without IPC_STAT and shm_nattch,
I'm betting the QNX4 port does not either ...
2001-03-18 18:32:02 +00:00
Tom Lane 4bd983bf34 Patches from Cyril Velter to make shared-memory-conflict-detection code
work in BeOS port.
2001-03-18 18:22:08 +00:00
Tom Lane ae293d33cf Make sure ControlFile logId/logSeg don't go backwards (barely possible given a
slow backend, if we update unconditionally as the code did before).
2001-03-18 00:30:27 +00:00
Tom Lane 5a38af7fd8 Rearrange XLogFileInit so that control-file spinlock is not held while filling
the new log file with zeroes, only while renaming it into place.  This should
prevent problems with 'stuck spinlock' errors under heavy load.
2001-03-17 20:54:13 +00:00
Tom Lane 9d645fd84c Support syncing WAL log to disk using either fsync(), fdatasync(),
O_SYNC, or O_DSYNC (as available on a given platform).  Add GUC parameter
to control sync method.
Also, add defense to XLogWrite to prevent it from going nuts if passed
a target write position that's past the end of the buffers so far filled
by XLogInsert.
2001-03-16 05:44:33 +00:00
Tom Lane 7f02049137 Give a more reasonable error message for a bad attribute name applied
to a join or subselect alias ... cf. Oliver Elphick's complaint 13-Mar.
2001-03-14 23:55:33 +00:00
Tom Lane 7fdaf78ed0 Reduce amount of memory used per tuple for after-event triggers. This
is still a memory leak, but a little less bad than it was.
2001-03-14 21:50:32 +00:00
Tom Lane c9f26d7af6 COPY should handle after-insert triggers the same as execMain.c does.
I'm not sure that it's really necessary to save insert events when there
are only after update or delete triggers, but certainly it's wrong for
COPY to behave differently from an INSERT query.
2001-03-14 21:47:50 +00:00
Tom Lane cfab4f6541 Use SEP_CHAR consistently in forming XLOG pathnames. 2001-03-14 20:23:04 +00:00
Tom Lane 7ebbf20763 Remove obsolete PowerPC-specific hack for comparisons to DBL_MIN
(per recent discussion with Tatsuo).  Hopefully the compilers with
that old bug are all long gone.
2001-03-14 20:12:10 +00:00
Bruce Momjian 9de4b77cee 'waiting' status display had extra space, removed.
Change the administrator to 'an' administrator.
2001-03-14 18:24:34 +00:00
Tom Lane 5dd04603b9 Don't go belly-up if fork() fails for a routine checkpoint subprocess.
Just try again later.
2001-03-14 17:58:46 +00:00
Tom Lane 286d1fc382 Fix numeric modulo operator for case of fractional right argument. 2001-03-14 16:50:37 +00:00
Bruce Momjian 2e7835f7f8 New shutdown wording:
This connection has been terminated by the administrator
2001-03-14 15:14:35 +00:00
Hiroshi Inoue ebffbb42ac ifdef out reindex stuff in VACUUM for safety. 2001-03-14 08:40:57 +00:00
Tom Lane 1b87e24c4a Change xlog page-header format to include StartUpID. Use the SUI to
detect case that next page in log came from an older run than the prior
page.  This avoids the necessity to re-zero the log after recovery from
a crash, which is good because we need not risk destroying valuable log
information.
This forces another initdb since yesterday :-(.  Need to get that log
reset utility done...
2001-03-13 20:32:37 +00:00
Tom Lane 4d14fe0048 XLOG (and related) changes:
* Store two past checkpoint locations, not just one, in pg_control.
  On startup, we fall back to the older checkpoint if the newer one
  is unreadable.  Also, a physical copy of the newest checkpoint record
  is kept in pg_control for possible use in disaster recovery (ie,
  complete loss of pg_xlog).  Also add a version number for pg_control
  itself.  Remove archdir from pg_control; it ought to be a GUC
  parameter, not a special case (not that it's implemented yet anyway).

* Suppress successive checkpoint records when nothing has been entered
  in the WAL log since the last one.  This is not so much to avoid I/O
  as to make it actually useful to keep track of the last two
  checkpoints.  If the things are right next to each other then there's
  not a lot of redundancy gained...

* Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs
  on alternate bytes.  Polynomial borrowed from ECMA DLT1 standard.

* Fix XLOG record length handling so that it will work at BLCKSZ = 32k.

* Change XID allocation to work more like OID allocation.  (This is of
  dubious necessity, but I think it's a good idea anyway.)

* Fix a number of minor bugs, such as off-by-one logic for XLOG file
  wraparound at the 4 gig mark.

* Add documentation and clean up some coding infelicities; move file
  format declarations out to include files where planned contrib
  utilities can get at them.

* Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or
  every CHECKPOINT_TIMEOUT seconds, whichever comes first.  It is also
  possible to force a checkpoint by sending SIGUSR1 to the postmaster
  (undocumented feature...)

* Defend against kill -9 postmaster by storing shmem block's key and ID
  in postmaster.pid lockfile, and checking at startup to ensure that no
  processes are still connected to old shmem block (if it still exists).

* Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency
  stop, for symmetry with postmaster and xlog utilities.  Clean up signal
  handling in bootstrap.c so that xlog utilities launched by postmaster
  will react to signals better.

* Standalone bootstrap now grabs lockfile in target directory, as added
  insurance against running it in parallel with live postmaster.
2001-03-13 01:17:06 +00:00
Tom Lane b246510ccc Avoid O(N^2) behavior in deferredTriggerAddEvent() for large numbers of
tuples inserted/deleted/updated in a single transaction.  On my machine,
this reduced the time to delete 80000 tuples in a foreign-key-referencing
table from ~15min to ~8sec.
2001-03-12 23:02:00 +00:00
Tom Lane 2cfc8fcb5d FATAL errors should cause exit with nonzero status if we are not running
under the postmaster --- specifically, if we are a standalone backend
running under the initdb script, this is critical!
2001-03-10 04:21:51 +00:00
Hiroshi Inoue 8fff96f1cb hold interupts during LockWaitCancel(). 2001-03-09 06:36:32 +00:00
Tom Lane d73e9df087 A subplan invoked within an aggregate function's argument should
be allowed to receive ungrouped variables of the current query level.
Curious that no one reported this bug before...
2001-03-08 01:49:01 +00:00
Tom Lane 572fda2711 Modify wchar conversion routines to not fetch the next byte past the end
of a counted input string.  Marinos Yannikos' recent crash report turns
out to be due to applying pg_ascii2wchar_with_len to a TEXT object that
is smack up against the end of memory.  This is the second just-barely-
reproducible bug report I have seen that traces to some bit of code
fetching one more byte than it is allowed to.  Let's be more careful
out there, boys and girls.
While at it, I changed the code to not risk a similar crash when there
is a truncated multibyte character at the end of an input string.  The
output in this case might not be the most reasonable output possible;
if anyone wants to improve it further, step right up...
2001-03-08 00:24:34 +00:00
Tom Lane b109b03fea Repair a number of places that didn't bother to check whether PageAddItem
succeeds or not.  Revise rtree page split algorithm to take care about
making a feasible split --- ie, will the incoming tuple actually fit?
Failure to make a feasible split, combined with failure to notice the
failure, account for Jim Stone's recent bug report.  I suspect that
hash and gist indices may have the same type of bug, but at least now
we'll get error messages rather than silent failures if so.  Also clean
up rtree code to use Datum rather than char* where appropriate.
2001-03-07 21:20:26 +00:00
Peter Eisentraut f1ad18d49a Add missing include. 2001-03-01 19:03:44 +00:00
Tom Lane 778a21ca94 Tweak portal (cursor) code so that it will not call the executor again
when user does another FETCH after reaching end of data, or another
FETCH backwards after reaching start.  This is needed because some plan
nodes are not very robust about being called again after they've already
returned NULL; for example, MergeJoin will crash in some states but not
others.  While the ideal approach would be for them all to handle this
correctly, it seems foolish to assume that no such bugs would creep in
again once cleaned up.  Therefore, the most robust answer is to prevent
the situation from arising at all.
2001-02-27 22:07:34 +00:00
Tatsuo Ishii df247b821d Massive commits for SunOS4 port. 2001-02-27 08:13:31 +00:00
Tatsuo Ishii 919ace07d5 Fix vacuum analyze error.
vacuum analyze on pg_type fails if bogus entries remain in pg_operator.
Here is a sample script to reproduce the problem.

drop table t1;
create table t1(i int);
drop function foo(t1,t1);
create function foo(t1,t1) returns bool as 'select true' language 'sql';
create operator = (
	leftarg = t1,
	rightarg = t1,
	commutator = =,
	procedure = foo
	);
drop table t1;
vacuum analyze;
2001-02-27 07:07:00 +00:00
Tom Lane 9c9936587c Implement COMMIT_SIBLINGS parameter to allow pre-commit delay to occur
only if at least N other backends currently have open transactions.  This
is not a great deal of intelligence about whether a delay might be
profitable ... but it beats no intelligence at all.  Note that the default
COMMIT_DELAY is still zero --- this new code does nothing unless that
setting is changed.
Also, mark ENABLEFSYNC as a system-wide setting.  It's no longer safe to
allow that to be set per-backend, since we may be relying on some other
backend's fsync to have synced the WAL log.
2001-02-26 00:50:08 +00:00
Tom Lane 496ea7a876 At least on HPUX, select with delay.tv_sec = 0 and delay.tv_usec = 1000000
does not lead to a one-second delay, but to an immediate EINVAL failure.
This causes CHECKPOINT to crash with s_lock_stuck much too quickly :-(.
Fix by breaking down the requested wait div/mod 1e6.
2001-02-24 22:42:45 +00:00
Tom Lane f1e0044ba3 When under postmaster, bogus arguments should cause proc_exit(0) not
proc_exit(1).  Unless you think a system-wide restart is an appropriate
response to bogus PGOPTIONS, that is.
2001-02-24 02:04:51 +00:00
Tom Lane e74ce0a566 As long as we're fixing this space calculation, let's actually do it
right.  We should MAXALIGN the individual items because we'll
allocate them individually, not as an array.
2001-02-23 20:12:37 +00:00
Bruce Momjian 81b48493aa Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Is there one LOCKMETHODCTL for every backend?  I thought there was only
> one of them.
>>
>> You're right, that line is erroneous; it should read
>>
>> size += MAX_LOCK_METHODS * MAXALIGN(sizeof(LOCKMETHODCTL));
>>
>> Not a significant error but it should be changed for clarity ...
2001-02-23 18:28:46 +00:00
Hiroshi Inoue 94b61fbc58 Resolve a compile error. 2001-02-23 09:31:52 +00:00
Hiroshi Inoue 34822e517a Reindex of shared system indexes must be overwrite mode. 2001-02-23 09:26:14 +00:00
Tatsuo Ishii 5735c4cf3d Enhanced UTF-8/SJIS mapping generator, contributed by
Eiji Tokuya" <e-tokuya@Mail.Sankyo-Unyu.co.jp>
2001-02-23 08:44:33 +00:00
Bruce Momjian a95ac415f7 More comment cleanups. 2001-02-22 23:20:06 +00:00
Bruce Momjian 82fc51e0b3 More comment improvements. 2001-02-22 23:02:33 +00:00
Bruce Momjian 4f6c49fef0 Clean up index/btree comments/macros, as approved. 2001-02-22 21:48:49 +00:00
Bruce Momjian 660ca3e01c Change /*---- commants to /* where appropriate. pgindent will tighten
up the comments later.
2001-02-22 18:39:20 +00:00
Hiroshi Inoue 50e3c60b95 Avoid 'FATAL: out of free buffers: time to abort !" error
during WAL recovery.  Recovery failure is always serious.
2001-02-22 08:59:40 +00:00
Tom Lane 4dba6814a3 Correct bogus output formatting of timeofday() function. A number of
microseconds < 100000 should be displayed as, eg, 13.000126, not 13.126.
2001-02-21 22:03:00 +00:00
Tom Lane be92ad49e0 Change case-folding of keywords to conform to SQL99 and fix misbehavior
in Turkish locale.  Keywords are now checked under pure ASCII case-folding
rules ('A'-'Z'->'a'-'z' and nothing else).  However, once a word is
determined not to be a keyword, it will be case-folded under the current
locale, same as before.  See pghackers discussion 20-Feb-01.
2001-02-21 18:53:47 +00:00
Tatsuo Ishii fa877ed8ee Safe guard in case of imporper data is provided to elog()
in multi-byte build.
2001-02-21 06:05:23 +00:00
Peter Eisentraut cb6edf9d56 Make sure -L and -I's for our source tree are always before system include
or library directories on the command line.
2001-02-20 19:20:30 +00:00
Tom Lane d18c1d1f51 Truncate incoming username and database name to NAMEDATALEN-1 characters
so that we don't reject overlength names unnecessarily.
2001-02-20 01:34:40 +00:00
Tom Lane 414f94f262 Change plpgsql's GET DIAGNOSTICS statement to use SQL99-compatible
syntax.  Fix the RESULT_OID case, which never worked.  Add documentation.
2001-02-19 19:49:53 +00:00
Peter Eisentraut 215b90d3d7 Allow extract() to accept the same field selectors as date_part(), not just
the ones specified by SQL.
2001-02-18 18:06:10 +00:00
Tom Lane 57e0847180 Change default commit_delay to zero, update documentation. 2001-02-18 04:50:43 +00:00
Tom Lane 33cc5d8a4d Change s_lock to not use any zero-delay select() calls; these are just a
waste of cycles on single-CPU machines, and of dubious utility on multi-CPU
machines too.
Tweak s_lock_stuck so that caller can specify timeout interval, and
increase interval before declaring stuck spinlock for buffer locks and XLOG
locks.
On systems that have fdatasync(), use that rather than fsync() to sync WAL
log writes.  Ensure that WAL file is entirely allocated during XLogFileInit.
2001-02-18 04:39:42 +00:00
Tom Lane 58c4ab9d62 Remove bogus set_ps_display call --- changing displayed status here is
either wrong or unnecessary in most cases, and on systems where setting
status takes a kernel call, the overhead of setting status three times
per command rather than two is annoying.
2001-02-18 04:28:31 +00:00
Tom Lane b634118af9 Add current seek position to FDDEBUG output for FileRead,
FileWrite, FileSeek.
2001-02-17 01:00:04 +00:00
Tom Lane 1ad93b7e45 Defend against starting a non-MULTIBYTE-enabled backend in a database
with encoding other than SQL_ASCII.  Per recent discussion in pghackers.
2001-02-16 18:50:40 +00:00
Tom Lane 13cc7eb3e2 Clean up two rather nasty bugs in operator selection code.
1. If there is exactly one pg_operator entry of the right name and oprkind,
oper() and related routines would return that entry whether its input type
had anything to do with the request or not.  This is just premature
optimization: we shouldn't return the single candidate until after we verify
that it really is a valid candidate, ie, is at least coercion-compatible
with the given types.

2. oper() and related routines only promise a coercion-compatible result.
Unfortunately, there were quite a few callers that assumed the returned
operator is binary-compatible with the given datatype; they would proceed
to call it without making any datatype coercions.  These callers include
sorting, grouping, aggregation, and VACUUM ANALYZE.  In general I think
it is appropriate for these callers to require an exact or binary-compatible
match, so I've added a new routine compatible_oper() that only succeeds if
it can find an operator that doesn't require any run-time conversions.
Callers now call oper() or compatible_oper() depending on whether they are
prepared to deal with type conversion or not.

The upshot of these bugs is revealed by the following silliness in PL/Tcl's
selftest: it creates an operator @< on int4, and then tries to use it to
sort a char(N) column.  The system would let it do that :-( (and evidently
has done so since 6.3 :-( :-().  The result in this case was just a silly
sort order, but the reverse combination would've provoked coredump from
trying to dereference integers.  With this fix you get more reasonable
behavior:
pltcl_test=# select * from T_pkey1 order by key1, key2 using @<;
ERROR:  Unable to identify an operator '@<' for types 'bpchar' and 'bpchar'
        You will have to retype this query using an explicit cast
2001-02-16 03:16:58 +00:00
Tom Lane b29f68f611 Take OUTER JOIN semantics into account when estimating the size of join
relations.  It's not very bright, but at least it now knows that
A LEFT JOIN B must produce at least as many rows as are in A ...
2001-02-16 00:03:08 +00:00
Tom Lane 6da3b76a94 Add some notes about memory management of RI plans. 2001-02-15 21:57:43 +00:00
Tom Lane db3ac67d8f Update comments about memory management. 2001-02-15 21:47:08 +00:00
Tom Lane 5c2abb960d Update notes about memory context scheme. 2001-02-15 21:38:26 +00:00
Tom Lane 059e361481 Although we can't support out-of-line TOAST storage in indexes (yet),
compressed storage works perfectly well.  Might as well have a coherent
strategy for applying it, rather than the haphazard store-what-you-get
approach that was in the code before.  The strategy I've set up here is
to attempt compression of any compressible index value exceeding
BLCKSZ/16, or about 500 bytes by default.
2001-02-15 20:57:01 +00:00
Tom Lane 39b9c9f221 Reduce default selectivity estimates for geometric operators; it seems
the old ones were not small enough to ensure r-tree and gist indexes would
get picked when available.  These numbers are totally bogus anyway, but
in the absence of any real estimation technique, we'd like to select
indexes when available ...
2001-02-15 17:55:17 +00:00
Tom Lane 83b4ab53ad Update a couple of obsolete comments. 2001-02-15 17:46:40 +00:00
Tatsuo Ishii 5c90733558 Unicode <-> SJIS new mapping tables (based on CP932.TXT) contributed by
Eiji Tokuya" <e-tokuya@Mail.Sankyo-Unyu.co.jp>
2001-02-15 01:56:29 +00:00
Tom Lane de434c2d5f Arrange for ORDER BY an expression on a UNION/INTERSECT/EXCEPT result,
such as
    SELECT f1 FROM foo UNION SELECT ... ORDER BY upper(f1)
to draw
'ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of the result columns'
rather than the uninformative 'f1 not found' we were producing before.
Eventually this should actually work, but that looks much too hard to try
to implement in late beta...
2001-02-15 01:10:28 +00:00
Tom Lane c7d2ce7bc6 Repair problems with duplicate index names generated when CREATE TABLE
specifies redundant UNIQUE conditions.
2001-02-14 23:32:38 +00:00
Tom Lane 4a66f9dd54 Change scoping of table and join refnames to conform to SQL92: a JOIN
clause with an alias is a <subquery> and therefore hides table references
appearing within it, according to the spec.  This is the same as the
preliminary patch I posted to pgsql-patches yesterday, plus some really
grotty code in ruleutils.c to reverse-list a query tree with the correct
alias name depending on context.  I'd rather not have done that, but unless
we want to force another initdb for 7.1, there's no other way for now.
2001-02-14 21:35:07 +00:00
Vadim B. Mikheev 7e04843ba7 Comments about GetFreeXLBuffer().
GetFreeXLBuffer(): use Insert->LgwrResult instead of private LgwrResult
copy if it's more fresh (attempt to avoid acquiring info_lck/lgwr_lck).
2001-02-13 20:40:25 +00:00
Bruce Momjian 7582bd91cb Please apply the following patch to fix AIX and IRIX timestamp behavior
as previously discussed.

It makes AIX and IRIX not use DST for dates before 1970.

The following expected files need to be removed from the regression tests,
they contain wrong results and are not needed any more.

src/test/regress/expected/horology-1947-PDT.out
src/test/regress/expected/tinterval-1947-PDT.out
src/test/regress/expected/abstime-1947-PDT.out

Zeugswetter Andreas
2001-02-13 14:32:52 +00:00
Vadim B. Mikheev 35273825dc Removed abort() in XLogFileOpen. 2001-02-13 08:44:09 +00:00
Philip Warner 0e39c8ac78 Added some comments to setval, setval_is_called and do_setval 2001-02-13 01:57:12 +00:00
Tom Lane f7a839bc2b Clean up portability problems in regexp package: change all routine
definitions from K&R to ANSI C style, and fix broken assumption that
int and long are the same datatype.  This repairs problems observed
on Alpha with regexps having between 32 and 63 states.
2001-02-13 00:02:36 +00:00
Tom Lane dd580f188e Suppress compiler warning on Alpha. 2001-02-12 21:03:03 +00:00
Tom Lane aa88e59ade Rearrange order of operations in heap_create_with_catalog so that if
two transactions create the same table name concurrently, the one that
fails will complain about unique index pg_class_relname_index, rather than
about pg_type_typname_index which'll confuse most people.  Free side
benefit: pg_class.reltype is correctly linked to the pg_type entry now.
It's been zero in all but the preloaded pg_class entries since who knows
when.
2001-02-12 20:07:21 +00:00
Bruce Momjian d8c4cb740c Cleanup 2001-02-12 18:46:40 +00:00
Bruce Momjian 281b7d84fc Add // -> /* */ mapping to pgindent. 2001-02-12 18:30:53 +00:00
Bruce Momjian 00f4fd2689 poit -> point. 2001-02-12 12:52:02 +00:00
Tom Lane 68590993ea Improve error message when startup or shutdown proc fails. 2001-02-11 23:12:28 +00:00
Tatsuo Ishii 8f17e53f0e Move pg_encoding_mblen() from common.c to wchar.c. 2001-02-11 01:59:22 +00:00
Tatsuo Ishii f54c02d2eb conv.c did not compile anymore. Fix wrong header file inclusion. 2001-02-11 01:56:58 +00:00
Peter Eisentraut 2660803697 Only look for bison as YACC; other yaccs need to be selected explicitly.
When no suitable YACC is configured, supply useful informational messages
to users.  (Same way flex has been handled for a while.)
2001-02-10 22:31:42 +00:00
Tom Lane d08741eab5 Restructure the key include files per recent pghackers discussion: there
are now separate files "postgres.h" and "postgres_fe.h", which are meant
to be the primary include files for backend .c files and frontend .c files
respectively.  By default, only include files meant for frontend use are
installed into the installation include directory.  There is a new make
target 'make install-all-headers' that adds the whole content of the
src/include tree to the installed fileset, for use by people who want to
develop server-side code without keeping the complete source tree on hand.
Cleaned up a whole lot of crufty and inconsistent header inclusions.
2001-02-10 02:31:31 +00:00
Tom Lane b1e4cfa5f6 This hasn't been used for anything for a long time... 2001-02-09 19:26:45 +00:00
Tom Lane 7fdca53711 When updating a tuple containing compressed-in-line fields, do not
decompress the existing fields unnecessarily.
2001-02-09 17:30:03 +00:00
Tom Lane dfbd5d6532 plpgsql's private copy of xlateSqlType was out of sync. Again. This
is clearly not maintainable, so dike it out in favor of calling the real
version in the backend's gram.y.
2001-02-09 03:26:28 +00:00
Tom Lane 897a895d32 When launching a child backend, take care to close file descriptors for
any other client connections that may exist (which would only happen if
another client is currently in the authentication cycle).  This avoids
wastage of open descriptors in a child.  It might also explain peculiar
behaviors like not closing connections when expected, since the kernel
will probably not signal EOF as long as some other backend is randomly
holding open a reference to the connection, even if the client went away
long since ...
2001-02-08 00:35:10 +00:00
Vadim B. Mikheev 608ddb7503 FixBTree flag still exists and may be used to turn
runtime recovery OFF.
2001-02-07 23:36:22 +00:00
Vadim B. Mikheev c19dadbf08 Runtime btree recovery is now ON by default. 2001-02-07 23:35:33 +00:00
Tom Lane 6b52dc7491 Repair postmaster memory leakage during password authentication. 2001-02-07 23:31:38 +00:00
Tom Lane 080af3db80 Need to specify DYNAMIC_PATH flag to shl_load, else HPUX's dld will not
honor library search path that we so carefully installed into the
executable ...
2001-02-07 17:59:58 +00:00
Peter Eisentraut c86c379787 If the first argument is --version or --help, skip the root check. 2001-02-06 17:00:01 +00:00
Vadim B. Mikheev 21d08bc1f6 PageAddItem in overwrite mode: must *NOT* check itemid' flag if
OffsetNumber == MaxOffsetNumber + 1 - there may be garbage there!
2001-02-06 06:24:00 +00:00
Tom Lane 85c17dbff8 Out-of-bounds memory allocation request sizes should be treated as just
elog(ERROR) not an Assert trap, since we've downgraded out-of-memory to
elog(ERROR) not a fatal error.  Also, change the hard boundary from 256Mb
to 1Gb, just so that anyone who's actually got that much memory to spare
can play with TOAST objects approaching a gigabyte.
2001-02-06 01:53:53 +00:00
Peter Eisentraut 0d3c767bb5 Dump/display 'timestamp' as 'timestamp with time zone', to make room for a
future 'timestamp without time zone', which SQL claims is equivalent to
plain 'timestamp'.
2001-02-05 17:35:04 +00:00
Tom Lane 503f042cd7 Fix inappropriate attempt to push down qual clauses into a view that
has UNION/INTERSECT/EXCEPT operations.  Per bug report from Ferrier.
2001-02-03 21:17:52 +00:00
Peter Eisentraut 67849c84d6 Use elog() instead of exit() for fatal scanner errors. 2001-02-03 20:13:05 +00:00
Vadim B. Mikheev b18c09ee3a Runtime tree recovery is implemented, just testing is left -:) 2001-02-02 19:49:15 +00:00
Bruce Momjian b60c57da2d Apply patches for QNX from Maurizio 2001-02-02 18:21:59 +00:00
Vadim B. Mikheev dca0762efc Couple additional functions to fix tree at runtime.
Need in one more function to handle "my bits moved..."
case. FixBTree is still FALSE.
2001-01-31 01:08:36 +00:00
Vadim B. Mikheev 598a12722a Call _bt_fixroot() from _bt_insertonpg. 2001-01-29 07:28:17 +00:00
Tom Lane 0d54d6ac44 Clean up handling of tuple descriptors so that result-tuple descriptors
allocated by plan nodes are not leaked at end of query.  This doesn't
really matter for normal queries, but it sure does for queries invoked
repetitively inside SQL functions.  Clean up some other grotty code
associated with tupdescs, and fix a few other memory leaks exposed by
tests with simple SQL functions.
2001-01-29 00:39:20 +00:00
Peter Eisentraut dc7a0009f0 Add permission check for CHECKPOINT. 2001-01-27 10:19:52 +00:00
Tom Lane 80caa741ab Fix failure to create sequences for more than one SERIAL column in a
table.
2001-01-27 07:23:48 +00:00
Tom Lane a6f0adbe38 Looks like I broke cases involving combinations of deferred update/delete
triggers ... oops ... but the regress tests should have covered this ...
2001-01-27 05:16:58 +00:00
Tom Lane f44639e1bf Don't crash if subquery appears multiple times in jointree. This should
not happen anyway, but let's try not to get completely confused if it does
(due to rewriter bugs or whatever).
2001-01-27 04:42:32 +00:00
Tom Lane 352871ac93 Repair bug reported by Huxton, 1/24/01. We need to include a rule's
original table ('OLD' table) in its join tree if OLD is referenced by
either the rule action, the rule qual, or the original query qual that
will be added to the rule action.  However, we only want one instance
of the original table to be included; so beware of the possibility that
the rule action already has a jointree entry for OLD.
2001-01-27 04:40:59 +00:00
Tom Lane c9c8d53d80 Refuse to try to attach a condition to a NOTIFY or other utility statement,
rather than coredumping (as prior 7.1 code did) or silently dropping the
condition (as 7.0 did).  This is annoying but there doesn't seem to be
any good way to fix it, short of a major querytree restructuring.
2001-01-27 01:44:20 +00:00
Tom Lane c1a63c944d Suppress coredump when EXPLAINing query that is rewritten to include
a NOTIFY.
2001-01-27 01:41:19 +00:00
Tom Lane 1dc3051088 Re-read Unix-socket lock file every so often (every CheckPoint interval,
actually) to ensure that its file access time doesn't get old enough to
tempt a /tmp directory cleaner to remove it.  Still another reason we
should never have put the sockets in /tmp in the first place ...
2001-01-27 00:05:31 +00:00
Tom Lane b78d1bed07 Change float8-to-int8 conversion to round to nearest, rather than
truncating to integer.  Remove regress test that checks whether
4567890123456789 can be converted to float without loss; since that's
52 bits, it's on the hairy edge of failing with IEEE float8s, and indeed
rint seems to give platform-dependent results for it.
2001-01-26 22:50:26 +00:00
Tom Lane f433d0d3cd Special case in ProcSleep() wasn't sufficiently general: must check to
see if we shouldn't block whenever we insert ourselves anywhere before
the end of the queue, not only at the front.
2001-01-26 18:23:12 +00:00
Vadim B. Mikheev c6e6d292bc First step in attempt to fix tree at runtime: create upper levels
and new root page if old root one was splitted but new root page
wasn't created.
New code is protected by FixBTree bool flag setted to FALSE, so
nothing should be affected by this untested approach.
2001-01-26 01:24:31 +00:00
Tom Lane 211f5afd40 Whoops, forgot to do ProcLockWakeup() after deadlock checker
rearranges wait queues.
2001-01-25 03:45:50 +00:00
Tom Lane a05eae029a Re-implement deadlock detection and resolution, per design notes posted
to pghackers on 18-Jan-01.
2001-01-25 03:31:16 +00:00
Bruce Momjian 623bf843d2 Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group. 2001-01-24 19:43:33 +00:00
Peter Eisentraut 718fc7e0d1 Fix bogus pattern for STRING. 2001-01-24 19:01:31 +00:00
Bruce Momjian 7df3bb50f0 Add all possible config file options. 2001-01-24 18:37:31 +00:00
Bruce Momjian 3347fbad79 Put back old config contents until I am finished. 2001-01-24 15:57:49 +00:00
Bruce Momjian 0843ec088c Add "idle in transaction" status message 2001-01-24 15:53:59 +00:00
Bruce Momjian ab37224426 Fix formatting of db crash. 2001-01-24 14:32:32 +00:00
Bruce Momjian 3f0f30d1a1 Add comment for getpwid() safety. 2001-01-24 05:24:43 +00:00
Bruce Momjian 843657b066 attached is take-2 of a patch which fixes a bug related
to the use of getpwuid when running in standalone mode.
this patch allocates some persistent storage (using
strdup) to store the username obtained with getpwuid
in src/backend/main/main.c.  this is necessary because
later on, getpwuid is called again (in ValidateBinary).

the man pages for getpwuid on SCO OpenServer, FreeBSD,
and Darwin all have words to this effect (this is from
the SCO OpenServer man page):

  Note
  ====
  All information is contained in a static area, so it must
  be copied if it is to be saved. Otherwise, it may be
  overwritten on subsequent calls to these routines.

in particular, on my platform, the storage used to hold
the pw_name from the first call is overwritten such that
it looks like an empty username.  this causes a problem
later on in SetSessionUserIdFromUserName.

i'd assume this isn't a problem on most platforms because
getpwuid is called with the same UID both times, and the
same thing ends up happening to that static storage each
time.  however, that's not guaranteed, and is _not_ what
happens on my platform (at least :).

this is for the version of 7.1 available via anon cvs as
of Tue Jan 23 15:14:00 2001 PST:
  .../src/backend/main/main.c,v 1.37 2000/12/31 18:04:35 tgl Exp

-michael thornburgh, zenomt@armory.com
2001-01-24 03:50:06 +00:00
Hiroshi Inoue a8b275e76d Removed a dangerours DropRelationBuffers() call. 2001-01-24 00:36:17 +00:00
Tom Lane 997ee51631 Make functional index copy attstorage from the column data type, rather
than forcing 'plain'.  This probably does not matter right now, but I
think it needs to be consistent with the regular (not-functional) index
case, where attstorage is copied from the underlying table.  Clean up
some other dead and infelicitous code too.
2001-01-24 00:06:07 +00:00
Tom Lane c654c69c05 Narrow scope of critical section, per discussion 1/19/01. 2001-01-23 23:32:45 +00:00
Tom Lane 4e27b308e2 Do _bt_wrtbuf() outside critical section, per discussion with Vadim 1/19. 2001-01-23 23:29:22 +00:00
Tom Lane f69ff0c4bd Give 'a_expr ::= a_expr Op' production a slightly lower precedence than
Op, so that the sequence 'a_expr Op Op a_expr' will be parsed as
a_expr Op (Op a_expr) not (a_expr Op) Op a_expr as formerly.  In other
words, prefer treating user-defined operators as prefix operators to
treating them as postfix operators, when there is an ambiguity.
Also clean up a couple of other infelicities in production priority
assignment --- for example, BETWEEN wasn't being given the intended
priority, but that of AND.
2001-01-23 22:39:08 +00:00
Peter Eisentraut 3de8407ea7 Remove useless leftover global variable Ps_status_buffer. 2001-01-23 20:33:29 +00:00
Tom Lane 786f1a59cd Fix all the places that called heap_update() and heap_delete() without
bothering to check the return value --- which meant that in case the
update or delete failed because of a concurrent update, you'd not find
out about it, except by observing later that the transaction produced
the wrong outcome.  There are now subroutines simple_heap_update and
simple_heap_delete that should be used anyplace that you're not prepared
to do the full nine yards of coping with concurrent updates.  In
practice, that seems to mean absolutely everywhere but the executor,
because *noplace* else was checking.
2001-01-23 04:32:23 +00:00
Tom Lane b686fb5bf1 Remove no-longer-needed restriction against referencing system
attributes in a FieldSelect node --- all the places that manipulate
these work just fine with system attribute numbers.  OK, it's a new
feature, so shoot me ...
2001-01-23 02:32:26 +00:00
Bruce Momjian 7e533da492 Rename int4 to int32 in a few places. 2001-01-23 01:48:17 +00:00
Tom Lane 728b0aa290 Improve realloc() per idea from Karel Zak --- if chunk to be enlarged is
at end of its block, maybe we can enlarge it in-place.
2001-01-23 01:01:36 +00:00
Tom Lane e9c936ff38 Remove rangechecks on errno; just call strerror unconditionally. This
eliminates a raft of portability issues, including whether sys_nerr
exists, whether the platform has any valid negative errnos, etc.  The
downside is minimal: errno shouldn't ever contain an invalid value anyway,
and if it does, reasonably modern versions of strerror will not choke.
This rangecheck idea seemed good at the time, but it's clearly a net loss,
and I apologize to all concerned for having ever put it in.
2001-01-22 23:28:52 +00:00
Tom Lane e84c429062 Clean up lockmanager data structures some more, in preparation for planned
rewrite of deadlock checking.  Lock holder objects are now reachable from
the associated LOCK as well as from the owning PROC.  This makes it
practical to find all the processes holding a lock, as well as all those
waiting on the lock.  Also, clean up some of the grottier aspects of the
SHMQueue API, and cause the waitProcs list to be stored in the intuitive
direction instead of the nonintuitive one.  (Bet you didn't know that
the code followed the 'prev' link to get to the next waiting process,
instead of the 'next' link.  It doesn't do that anymore.)
2001-01-22 22:30:06 +00:00
Tom Lane c9fe128316 Clean up per-tuple memory leaks in trigger firing and plpgsql
expression evaluation.
2001-01-22 00:50:07 +00:00
Bruce Momjian b8f23aff82 Back out patch for BLOB operations until approval. 2001-01-21 03:50:25 +00:00
Bruce Momjian c655935217 Hello,
here is the patch attached which do check in each BLOB operation, if we are
in transaction, and raise an error otherwise. This will prevent such mistakes.

--
Sincerely Yours,
Denis Perchine
2001-01-21 03:49:14 +00:00
Tom Lane 023a48b811 Deal with C++ incompatibility of sys_nerr declaration by taking it out
of c.h altogether, and putting it into the only places that use it
(elog.c and exc.c), instead.  Modify these routines to check for a
NULL or empty-string return from strerror, too, since some platforms
define strerror to return empty string for unknown errors (what a useless
definition that is ...).  Clean up some cruft in ExcPrint while at it.
2001-01-21 00:59:26 +00:00
Tom Lane 1a02edae60 Give a good error message for what's likely to be a common syntax error,
namely omitting the alias clause for a sub-SELECT in FROM.
2001-01-20 17:37:52 +00:00
Peter Eisentraut 19cba0cc1b Add missing piece of BitString support to node output functions. Expand
and remove IsA_Value macro.
2001-01-20 00:15:59 +00:00
Tom Lane 6ce0ed2813 Make critical sections (elog->crash) and interrupt holdoff sections
into distinct concepts, per recent discussion on pghackers.
2001-01-19 22:08:47 +00:00
Bruce Momjian 75815c3100 cleanup. 2001-01-19 21:09:57 +00:00
Bruce Momjian 27aaf9df7e Remove ; and add \n to ASM code. 2001-01-19 20:39:16 +00:00
Tom Lane 86a2c2595b Suppress compiler warning in MULTIBYTE code. 2001-01-19 06:57:25 +00:00
Tom Lane bdb72d8765 Suppress compiler warning in MULTIBYTE case. 2001-01-19 06:54:57 +00:00
Tom Lane c78e19544e Suppress unused-variable warning in non-Assert compilations. 2001-01-19 06:50:23 +00:00
Vadim B. Mikheev 0a12767004 Comment out xlrec in xact_redo - no support for file unlinking on
commit yet.
2001-01-18 18:33:45 +00:00
Hiroshi Inoue 89ac643964 Fix some leaks(was my fault). 2001-01-18 07:29:04 +00:00
Thomas G. Lockhart 6acdebbd3a Fix up "Postgres-style" time interval representation when fields have
mixed-signs. Previous effort left way too many minus signs, and was at
 least as broken as the one before that :(
Clean up "ISO-style" time interval representation to omit zero fields if
 there is at least one non-zero field. Supress some leading plus signs
 when not necessary for clarity.
Replace every #ifdef __CYGWIN__ block with a cleaner TIMEZONE_GLOBAL macro
 defined in datetime.h.
2001-01-18 07:22:43 +00:00
Tom Lane b06fbc7ad2 Fix performance issue with qualifications on VIEWs: outer query should
try to push restrictions on the view down into the view subquery,
so that they can become indexscan quals or what-have-you rather than
being applied at the top level of the subquery.  7.0 and before were
able to do this, though in a much klugier way, and I'd hate to have
anyone complaining that 7.1 is stupider than 7.0 ...
2001-01-18 07:12:37 +00:00
Hiroshi Inoue 53ebb2286d Change LockClassinfoForUpdate() to retry mark4update() in case
the tuple is already uodated. (If LockClassinfoForUpdate() is
thought to be useful).
2001-01-18 04:01:42 +00:00
Bruce Momjian 978c03f9cf attached is a patch that makes SysV semaphore emulation
using POSIX semaphores more robust on Darwin 1.2/Mac OS X
Public Beta.  this is for the version of 7.1 available
via anon cvs as of Jan 14 2001 14:00 PST.

since the semaphores and shared memory created by this
emulator are shared with the backends via fork(), their
persistent names are not necessary.  removing their
names with shm_unlink() and sem_unlink() after creation
obviates the need for any "ipcclean" function.  further,
without these changes, the shared memory (and, therefore,
the semaphores) will not be re-initialized/re-created after
the first execution of the postmaster, until reboot
or until some (non-existent) ipcclean function is executed.

this patch does the following:

   1) if the shared memory segment "SysV_Sem_Info" already
      existed, it is cleaned up.  it shouldn't be there anyways.

   2) the real indicator for whether the shared memory/semaphore
      emulator has been initialized is if "SemInfo" has been
      initialized.  the shared memory and semaphores must be
      initialized regardless of whether there was a garbage shared
      memory segment lying around.

   3) the shared memory segment "SysV_Sem_Info" is created with "O_EXCL"
      to catch the case where two postmasters might be starting
      simultaneously, so they don't both end up with the same shared
      memory (one will fail).  note that this can't be done with the
      semaphores because Darwin 1.2 has a bug where attempting to
      open an existing semaphore with "O_EXCL" set will ruin the
      semaphore until the next reboot.

   4) the shared memory segment "SysV_Sem_Info" is unlinked after
      it is created.  it will then exist without a name until the
      postmaster and all backend children exit.
   5) all semaphores are unlinked after they are created.  they'll
      then exist without names until the postmaster and all backend
      children exit.

-michael thornburgh, zenomt@armory.com
2001-01-17 22:11:19 +00:00
Bruce Momjian 5088f0748a Change lcons(x, NIL) to makeList(x) where appropriate. 2001-01-17 17:26:45 +00:00
Thomas G. Lockhart 8e9840383c Change comparisons of tm->tm_isdst from "nonzero" to "greater than zero".
Not sure why some were this way, and others were already correct, but it
 seems to have been like this for several years.
This caused problems on a few damaged platforms like AIX and IRIX which do
 not support DST calculations for years before 1970.
Thanks to Andreas Zeugswetter <ZeugswetterA@wien.spardat.at> for finding
 the problem.
2001-01-17 16:46:56 +00:00
Bruce Momjian 26e0321191 Move structure comments from the top block down to the line entries for
this file to match all the other files, and to be clearer.
2001-01-17 06:41:31 +00:00
Tom Lane 4c4f305b15 Remove bogus backslashes in sed command. 2001-01-16 22:48:34 +00:00
Tom Lane dae52bf3ec Oops, I had managed to break query-cancel-while-waiting-for-lock. 2001-01-16 20:59:34 +00:00
Tom Lane 64e6c60897 Rename fields of lock and lockholder structures to something a tad less
confusing, and clean up documentation.
2001-01-16 06:11:34 +00:00
Tom Lane 3db4056e22 Fix problems with parentheses around sub-SELECT --- for the last time,
I hope.  I finally realized that we were going at it backwards: when
there are excess parentheses, they need to be treated as part of the
sub-SELECT, not as part of the surrounding expression.  Although either
choice yields an unambiguous grammar, only this way produces a grammar
that is LALR(1).  With the old approach we were guaranteed to fail on
either 'SELECT (((SELECT 2)) + 3)' or
'SELECT (((SELECT 2)) UNION SELECT 2)' depending on which way we
resolve the initial shift/reduce conflict.  With the new way, the same
reduction track can be followed in both cases until we have advanced
far enough to know whether we are done with the sub-SELECT or not.
2001-01-15 20:36:36 +00:00
Tom Lane efd6cade83 Tweak heap_update/delete so that we do not hold the buffer context lock
on the old tuple's page while we are doing TOAST pushups.
2001-01-15 05:29:19 +00:00
Tom Lane 0b5d194aaa Minor coding cleanups. 2001-01-14 22:21:54 +00:00
Tom Lane a904181a46 Another go-round on making GetRawDatabaseInfo behave as well as it can,
given the fundamental restriction of not looking at transaction commit
data in pg_log.  Use code that is actually based on tqual.c rather than
ad-hoc tests.  Also write the tuple fetch loop using standard access
macros rather than ad-hoc code.
2001-01-14 22:21:05 +00:00