Commit Graph

21597 Commits

Author SHA1 Message Date
Teodor Sigaev 73f47aa0cd Fix stupid bug with sizeof 2005-12-06 18:22:33 +00:00
Tom Lane a615acf555 Arrange for read-only accesses to SLRU page buffers to take only a shared
lock, not exclusive, if the desired page is already in memory.  This can
be demonstrated to be a significant win on the pg_subtrans cache when there
is a large window of open transactions.  It should be useful for pg_clog
as well.  I didn't try to make GetMultiXactIdMembers() use the code, as
that would have taken some restructuring, and what with the local cache
for multixact contents it probably wouldn't really make a difference.
Per my recent proposal.
2005-12-06 18:10:06 +00:00
Tom Lane 953208a34c In a nestloop inner indexscan, it's OK to use pushed-down baserestrictinfo
clauses even if it's an outer join.  This is a corner case since such
clauses could only arise from weird OUTER JOIN ON conditions, but worth
fixing.  Per example from Ron at cheapcomplexdevices.com.
2005-12-06 16:50:36 +00:00
Tom Lane 974c5a8730 ecpg/pgtypeslib seems to need snprintf.c pulled in, too. 2005-12-06 05:26:21 +00:00
Tom Lane 0d2aad85d8 Put undef's before extern declarations that need 'em, per Andrew Dunstan. 2005-12-06 05:13:46 +00:00
Bruce Momjian ef31c2bf2e Add comment on why pg *printf functions are used unconditionally on
Win32.

Backpatch to 8.1.X.
2005-12-06 04:53:02 +00:00
Tom Lane e0e7589169 Make Win32 build use our port/snprintf.c routines, instead of depending
on libintl which may or may not provide what we need.  Make a few marginal
cleanups to ensure this works.  Andrew Dunstan and Tom Lane.
2005-12-06 02:29:04 +00:00
Tom Lane 1daac8e165 Document return-value conventions used by this implementation, per
suggestion from Bruce.
2005-12-05 21:57:00 +00:00
Teodor Sigaev e8c81e179e Improve word parser.
- improve file and path recognition
 - fix misspeling
 - improve tag recognition
2005-12-05 18:13:22 +00:00
Tom Lane 8cb4e4f6bd Add regression test to see if the min/max values of int8 convert correctly. 2005-12-05 04:13:38 +00:00
Tom Lane 3311c7669a Fix a rather sizable number of problems in our homegrown snprintf, such as
incorrect implementation of argument reordering, arbitrary limit of output
size for sprintf and fprintf, willingness to access more bytes than "%.Ns"
specification allows, wrong formatting of LONGLONG_MIN, various field-padding
bugs and omissions.  I believe it now accurately implements a subset of
the Single Unix Spec requirements (remaining unimplemented features are
documented, too).  Bruce Momjian and Tom Lane.
2005-12-05 02:39:38 +00:00
Bruce Momjian 99552287e1 Update:
< 	  Win32 API, and we have to make sure MinGW handles it.
> 	  Win32 API, and we have to make sure MinGW handles it.  Another
> 	  option is to wait for the MinGW project to fix it, or use the
> 	  code from the LibGW32C project as a guide.
2005-12-04 21:16:51 +00:00
Bruce Momjian 8752479dfc Add:
> 	o Add long file support for binary pg_dump output
>
> 	  While Win32 supports 64-bit files, the MinGW API does not,
> 	  meaning we have to build an fseeko replacement on top of the
> 	  Win32 API, and we have to make sure MinGW handles it.
2005-12-04 04:33:18 +00:00
Bruce Momjian bedb5fc309 Add:
> * Add SPI_gettypmod() to return the typemod for a TupleDesc
2005-12-04 04:14:43 +00:00
Bruce Momjian 49bbff0f8d Add for autovacuum:
> 	o Consider logging activity either to the logs or a system view
2005-12-04 04:02:55 +00:00
Bruce Momjian 10e3d224e0 Add configure flag to allow libedit to be preferred over GNU readline:
--with-libedit-preferred  prefer BSD Libedit over GNU Readline
2005-12-04 03:52:29 +00:00
Tom Lane e4a9229d55 Treat procedural languages as owned by the bootstrap superuser, rather
than owned by nobody.  This results in cleaner display of language ACLs,
since the backend's aclchk.c uses the same convention.  AFAICS there is
no practical difference but it's nice to avoid emitting SET SESSION
AUTHORIZATION; also this will make it easier to transition pg_dump to
some future version in which we may include an explicit ownership column
in pg_language.  Per gripe from David Begley.
2005-12-03 21:06:18 +00:00
Tom Lane 6d4bcda38c Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX.
Per example from Dirk Pirschel.
2005-12-03 20:16:31 +00:00
Bruce Momjian d20901a39b Allow to_char(interval) and to_char(time) to use AM/PM specifications.
Map them to a single day, so '30 hours' is 'AM'.

Have to_char(interval) and to_char(time) use "HH", "HH12" as 12-hour
intervals, rather than bypass and print the full interval hours.  This
is neeeded because to_char(time) is mapped to interval in this function.
Intervals should use "HH24", and document suggestion.

Allow "D" format specifiers for interval/time.
2005-12-03 16:45:06 +00:00
Bruce Momjian eb339c7840 Item removed:
< * Add function to return the thread safety status of libpq and ecpg
2005-12-03 13:03:41 +00:00
Tom Lane a98871b7ac Tweak indexscan machinery to avoid taking an AccessShareLock on an index
if we already have a stronger lock due to the index's table being the
update target table of the query.  Same optimization I applied earlier
at the table level.  There doesn't seem to be much interest in the more
radical idea of not locking indexes at all, so do what we can ...
2005-12-03 05:51:03 +00:00
Tom Lane 1cf65140d0 Fix obsolete description of -h option, per Andreas Schmidt. 2005-12-02 23:13:46 +00:00
Tom Lane 6f5efe3d16 Fix obsolete comment. 2005-12-02 22:06:07 +00:00
Tom Lane d780f07ac1 Adjust scan plan nodes to avoid getting an extra AccessShareLock on a
relation if it's already been locked by execMain.c as either a result
relation or a FOR UPDATE/SHARE relation.  This avoids an extra trip to
the shared lock manager state.  Per my suggestion yesterday.
2005-12-02 20:03:42 +00:00
Bruce Momjian 5ab2598875 Remove idea of increasing NUMERIC length:
< * Change NUMERIC to enforce the maximum precision, and increase it
> * Change NUMERIC to enforce the maximum precision
2005-12-02 17:39:44 +00:00
Michael Meskes 5106aff99a Added special handling of CONNECTION variable that is used by ECPG instead of given to the backend. 2005-12-02 15:03:57 +00:00
Bruce Momjian 9322a04759 Add calcluation of bitmap storage capacity.
<   be cleared when a heap tuple is expired.  Another idea is to maintain
<   a bitmap of heap pages where all rows are visible to all backends,
<   and allow index lookups to reference that bitmap to avoid heap
<   lookups, perhaps the same bitmap we might add someday to determine
<   which heap pages need vacuuming.
>   be cleared when a heap tuple is expired.
>
>   Another idea is to maintain a bitmap of heap pages where all rows
>   are visible to all backends, and allow index lookups to reference
>   that bitmap to avoid heap lookups, perhaps the same bitmap we might
>   add someday to determine which heap pages need vacuuming.  Frequently
>   accessed bitmaps would have to be stored in shared memory.  One 8k
>   page of bitmaps could track 512MB of heap pages.
2005-12-02 04:28:19 +00:00
Bruce Momjian cf17131767 Remove comment on errno=0 lines, but add mention to port/strtol.c function. 2005-12-02 02:49:11 +00:00
Tom Lane de1dfc1209 Rearrange code in ExecInitBitmapHeapScan so that we don't initialize the
child plan nodes until we have acquired lock on the relation to scan.
The relative order of initialization of plan nodes isn't real important in
other cases, but it's critical here because one is supposed to lock a
relation before its indexes, not vice versa.  The original coding was at
least vulnerable to deadlock against DROP INDEX, and perhaps worse things.
2005-12-02 01:29:55 +00:00
Bruce Momjian 113ece8f3d Add all heap page rows visible bitmap idea:
<   the heap.  One way to allow this is to set a bit to index tuples
>   the heap.  One way to allow this is to set a bit on index tuples
<   be cleared when a heap tuple is expired.
<
>   be cleared when a heap tuple is expired.  Another idea is to maintain
>   a bitmap of heap pages where all rows are visible to all backends,
>   and allow index lookups to reference that bitmap to avoid heap
>   lookups, perhaps the same bitmap we might add someday to determine
>   which heap pages need vacuuming.
2005-12-01 22:30:43 +00:00
Bruce Momjian 915fb7f687 Add MERGE TODO.detail:
>   [merge]
378a380
>   [merge]
2005-12-01 22:12:35 +00:00
Bruce Momjian f28bdd95c1 Add merge TODO.detail item. 2005-12-01 22:12:06 +00:00
Bruce Momjian 24e1a04591 Split out MERGE and REPLACE/UPSERT items.
< * Add MERGE command that does UPDATE/DELETE, or on failure, INSERT (rules,
<   triggers?)
> * Add SQL-standard MERGE command, typically used to merge two tables
>
>   This is similar to UPDATE, then for unmatched rows, INSERT.
>   Whether concurrent access allows modifications which could cause
>   row loss is implementation independent.
>
> * Add REPLACE or UPSERT command that does UPDATE, or on failure, INSERT
2005-12-01 22:07:59 +00:00
Bruce Momjian 8c8c0108e8 Add comment to pg_atoi. 2005-12-01 21:16:13 +00:00
Bruce Momjian 0e6b1528b7 Comment "errno = 0" in a more generic way. 2005-12-01 21:11:58 +00:00
Tom Lane ace17c1d82 Retry in FileRead and FileWrite if Windows returns ERROR_NO_SYSTEM_RESOURCES.
Also add a retry for Unixen returning EINTR, which hasn't been reported
as an issue but at least theoretically could be.  Patch by Qingqing Zhou,
some minor adjustments by me.
2005-12-01 20:24:18 +00:00
Bruce Momjian 277b2ea328 Add comments about why errno is set to zero. 2005-12-01 20:06:37 +00:00
Tom Lane 814acfcc3a Check for overflow in strtol() while parsing datetime inputs.
Michael Fuhr.
2005-12-01 17:56:34 +00:00
Neil Conway cab40818ea Fix typo in PL/PgSQL documentation, per Chris KL. 2005-12-01 10:36:57 +00:00
Alvaro Herrera 7415e083e4 Refactor some bits in aclchk.c in order to reduce code duplication. 2005-12-01 02:03:01 +00:00
Tom Lane 164442fe7f Rearrange code in pg_atoi() to avoid assuming that isspace() cannot
change errno.  No reported bugs here, but why take a chance?
2005-11-30 23:10:08 +00:00
Tom Lane bae3fefd4a Tweak choose_bitmap_and() heuristics in the light of example provided in bug
#2075: consider an index redundant if any of its index conditions were already
used, rather than if all of them were.  Also, make the selectivity comparison
a bit fuzzy, so that very small differences in estimated selectivities don't
skew the results.
2005-11-30 17:10:19 +00:00
Michael Meskes 150131d9d9 - Made several variables "const char *" instead of "char *" as proposed by Qingqing Zhou <zhouqq@cs.toronto.edu>.
- Replaced all strdup() calls by ECPGstrdup().
- Set ecpg library version to 5.2.
- Set ecpg version to 4.2.1.
2005-11-30 12:49:49 +00:00
Bruce Momjian 339fbbb9a0 Update for 8.2:
< #A hyphen, "-", marks changes that will appear in the upcoming 8.1 release.#
> #A hyphen, "-", marks changes that will appear in the upcoming 8.2 release.#
2005-11-29 02:02:40 +00:00
Bruce Momjian 8ed7065c7b Item removed, looping always required:
< * Remove Win32 rename/unlink looping if unnecessary
2005-11-29 02:01:52 +00:00
Alvaro Herrera 19fecee06e Document PGXS' REGRESS feature. 2005-11-29 01:46:54 +00:00
Tom Lane 9a39423436 Fix EXPLAIN and EXECUTE commands to pass portal parameters through to
the executor.  This allows, for example, JDBC clients to use '?' bound
parameters in these commands.  Per gripe from Virag Saksena.
2005-11-29 01:25:50 +00:00
Tom Lane 4ab76b1c20 Tweak hash join code to use an additional heuristic for deciding whether
it's worth probing the outer relation for emptiness before building the
hash table.  To wit, if we're rescanning a join previously performed,
remember whether we found it nonempty the previous time, and don't bother
with the probe if it was nonempty.  This buys back the performance lost
in examples like Mario Weilguni's.
2005-11-28 23:46:03 +00:00
Bruce Momjian ee4aa3021e Improve documentation for COALESCE and NULLIF. Add references for NVL
and IFNULL.

Backpatch to 8.1.X.
2005-11-28 23:18:48 +00:00
Tom Lane 200545039c Come to think of it, the backend doesn't use -lz either. 2005-11-28 22:43:30 +00:00