Commit Graph

12086 Commits

Author SHA1 Message Date
Tom Lane f8a769b47a Cause stats processes to detach from shared memory when started, so that
they do not prevent the postmaster from deleting the shmem segment during
a post-backend-crash restart cycle.  Per recent discussion.
2003-11-07 21:55:50 +00:00
Tom Lane 7e4a629492 zero_damaged_pages must absolutely NOT be marked GUC_DISALLOW_IN_FILE,
else it cannot be used to handle failures detected during WAL replay.
Fortunately this flag isn't actually enforced yet, but get it right.
2003-11-07 21:27:38 +00:00
Peter Eisentraut 96889392e9 Implement isolation levels read uncommitted and repeatable read as acting
like the next higher one.
2003-11-06 22:08:15 +00:00
Tom Lane e4044ba2d7 Fix for this problem:
regression=# select 1 from tenk1 ta cross join tenk1 tb for update;
ERROR:  no relation entry for relid 3

7.3 said "SELECT FOR UPDATE cannot be applied to a join", which was better
but still wrong, considering that 7.2 took the query just fine.  Fix by
making transformForUpdate() ignore JOIN and other special RTE types,
rather than trying to mark them FOR UPDATE.  The actual error message now
only appears if you explicitly name the join in FOR UPDATE.
2003-11-05 22:00:46 +00:00
Dave Cramer 622736aa4a Added missing methods 2003-11-05 11:57:53 +00:00
Peter Eisentraut 07eb9fb20b Add -O to really trigger compiler bug. 2003-11-05 07:42:31 +00:00
Peter Eisentraut 23c292688f Add detection of compiler bug. 2003-11-05 00:09:08 +00:00
Peter Eisentraut d28bacd897 Add note to update config.guess and config.sub at the start of beta. 2003-11-04 10:33:28 +00:00
Peter Eisentraut c119c554ed Improve message wording for spinlocks-missing compilation error. 2003-11-04 09:53:36 +00:00
Dave Cramer b720fa96fb patch for rs.previous and test case as well as patch for allowing server and port to be specified in test cases 2003-11-03 15:28:26 +00:00
Dave Cramer efea5da4fa accept url and fk action fix from Kris Jurka 2003-11-03 15:22:07 +00:00
Michael Meskes 90e53f0c16 Fixed potentially uninitialized memory bug in compatlib. 2003-11-03 14:44:28 +00:00
Tom Lane b402503fb6 Adjust data types in some of the UNION tests to avoid potentially
platform-dependent results, as per example from Larry Rosenman.
2003-11-02 22:35:26 +00:00
Tom Lane eeaf5f04ae Provide a way to run the parallel regression tests with a user-specified
limit on the number of simultaneous connections.  Andrew Dunstan, with
review by Tom Lane.
2003-11-02 21:56:15 +00:00
Peter Eisentraut 1af403e42d Complete options help and put it in less random order. 2003-11-02 12:55:24 +00:00
Peter Eisentraut 0543af2f12 Fix CFLAGS logic. 2003-11-01 20:45:30 +00:00
Peter Eisentraut f7e5e9d493 More whitespace fixes. Do people write the expected files by hand? 2003-11-01 03:18:20 +00:00
Peter Eisentraut 32ab99ba10 Fix hidden whitespace differences between expected and result files. 2003-11-01 03:07:07 +00:00
Tom Lane 4240d2bffd Update future-tense comments in README to present tense. Noted by
Neil Conway.
2003-10-31 22:48:08 +00:00
Peter Eisentraut bc010cd9ef Translation update 2003-10-31 22:14:15 +00:00
Tom Lane 8545482947 When a superuser does GRANT or REVOKE on an object he doesn't own,
process the command as though it were issued by the object owner.
This prevents creating weird scenarios in which the same privileges
may appear to flow from different sources, and ensures that a superuser
can in fact revoke all privileges if he wants to.  In particular this
means that the regression tests work when run by a superuser other than
the original bootstrap userid.  Per report from Larry Rosenman.
2003-10-31 20:00:49 +00:00
Tom Lane bcf4d35699 Minor cleanup of PQunescapeBytea(). Avoid unportable assumptions about
behavior of malloc and realloc when request size is 0.  Fix escape
sequence recognizer so that only valid 3-digit octal sequences are
treated as escape sequences ... isdigit() is not a correct test.
2003-10-31 17:43:10 +00:00
Jan Wieck 774f57038a Moved the recently added test for foreign key disabled by rewrite
rule into the rule.sql since it affects the latter if run in paralell.

Jan
2003-10-31 14:27:57 +00:00
Michael Meskes e6152300f1 If EOF is found inside a string/comment/etc. stop parsing. 2003-10-31 14:10:41 +00:00
Jan Wieck cc4baf4da3 Fix for possible referential integrity violation when a qualified ON INSERT
rule split the query into one INSERT and one UPDATE where the UPDATE
then hit's the just created row without modifying the key fields again.
In this special case, the new key slipped in totally unchecked.

Jan
2003-10-31 03:58:21 +00:00
Tom Lane e181001764 Small fix to Christopher's recent improvements --- underscore is not
a special character in regexes, but it is for LIKE, so NOT LIKE 'pg_%'
is incorrect.  Need NOT LIKE 'pg\_%'.
2003-10-31 03:58:15 +00:00
Tom Lane ede9b68e03 Use Tcl ByteArray objects to avoid unwanted character set translation
in libpgtcl's lo_read/lo_write commands.  Also, deal correctly with
failure return from lo_read().  ljb and Tom Lane.
2003-10-31 00:18:55 +00:00
Tom Lane e84487f67a Further work on tab completion code: arrange for system catalogs to be
offered for completion only when the input-so-far is at least 'pg_'.
This seems to be the best compromise behavior emerging from yesterday's
discussion.  While at it, refactor code to eliminate repetitive use of
nearly identical queries, which was exceedingly tedious to maintain.
Also const-ify code more thoroughly in hopes of moving constant data into
text segment, and remove unnecessary length limit on queries.
2003-10-30 21:37:38 +00:00
Tom Lane 3108b5db28 Allow the query for a plpgsql cursor to begin with '(' as well as 'SELECT'.
Per example from Kumar, 30-Oct-03.
2003-10-30 17:18:55 +00:00
Dave Cramer f4b4d7ce60 use the result set to set the fetchsize 2003-10-30 12:18:56 +00:00
Michael Meskes f590a5ea72 Applied patch by Dave Cramer to fix several bugs in compatlib. 2003-10-30 10:19:30 +00:00
Tom Lane f016c92ea4 Fix some corner cases in ACL manipulation: don't foul up on an empty
ACL array, and force languages to be treated as owned by the bootstrap
user ID.  (pg_language should have a lanowner column, but until it does
this will have to do as a workaround.)
2003-10-29 22:20:54 +00:00
Tom Lane a35deb5400 Give a useful error message if a RangeVar is encountered in an expression.
Per example from Ian Barwick, 28-Oct-03.
2003-10-29 18:10:15 +00:00
Tom Lane abec4cbf1f compact_fsm_storage() does need to handle the case where a relation's
FSM data has to be both moved down and compressed.  Per report from
Dror Matalon.
2003-10-29 17:36:57 +00:00
Dave Cramer 7ecb6ede28 Patches from Oliver Jowett to fix CursorFetchTest, 7.4 now does not automatically delete cursors 2003-10-29 02:39:10 +00:00
Tom Lane 15c6764bda Don't include "schema." in the set of possible tab completions once
"schema." has been typed.  This allows readline to complete subsequent
characters immediately if all relations in the target schema start with
the same prefix.  This actually worked before, but I unintentionally
broke it a few days ago.
Also, make completion schema-aware for GRANT, REVOKE, VACUUM.
2003-10-28 23:35:52 +00:00
Tom Lane 979b537522 Include -lkrb5 when needed for shlibs depending on libpq. Per report
from Johan Henselmans.
2003-10-28 21:55:58 +00:00
Tom Lane e554e2b090 Don't choke when the handler for a procedural language is located in
the pg_catalog schema.  Per bug report some months back from Jochem van Dieten.
2003-10-28 21:05:29 +00:00
Bruce Momjian 700f7f4227 Change Solaris tests to test for SHM_SHARE_MMU, per Tom. 2003-10-27 18:30:07 +00:00
Tom Lane f88c15991b Un-break Darwin port. 2003-10-27 07:42:34 +00:00
Michael Meskes 0262337ad3 Fixed bug with indicators when storage for the string is dynamically allocated. 2003-10-26 09:50:47 +00:00
Bruce Momjian d47e9bd023 'sun' => '__sun__' 2003-10-26 04:54:44 +00:00
Bruce Momjian 15f98a3e51 Test for 'sun' rather than 'solaris' for intimate shared memory. 2003-10-26 04:53:24 +00:00
Bruce Momjian 3c9a32d4a2 Fix two bugs in funcs.source that made the tutorial script fail.
Make a LOT of fixes to syscat.source to:

* Set search_path properly (and reset it)
* Add schema name to all results
* Add schema name to ORDER BY first
* Make checks for user-defined objects match reality
* format_type all type names
* Respect attisdropped
* Change !~ to 'not like' since it's more standard


Christopher Kings-Lynne
2003-10-26 04:51:51 +00:00
Bruce Momjian b80b384b78 Allow win32 client compiles with MSC.
Hiroshi Saito
2003-10-26 04:29:15 +00:00
Bruce Momjian 8b3414d247 Uppercase a few keywords in queries. 2003-10-26 02:53:45 +00:00
Bruce Momjian ce26858fac Update for m68k from Peter. 2003-10-26 01:41:10 +00:00
Bruce Momjian 72ecc222b7 Fix #elif typo. 2003-10-26 00:27:59 +00:00
Bruce Momjian 1fdbc8cc20 Update linux/mips port.
Add m68k to linux port.
2003-10-26 00:26:13 +00:00
Peter Eisentraut e9cd1c771f Get Tru64/cc to compile. Need to add -ieee so that it doesn't choke on
0.0/0.0.  That option appears to affect the regression test result as well.
The compiler documentation doesn't recommend -O4 for universal use, so
let's stick to the conservative -O (== -O2) by default.
2003-10-25 20:18:53 +00:00
Peter Eisentraut 8e8816c777 Translation update 2003-10-25 18:18:19 +00:00
Peter Eisentraut 002e7b3789 Translation updates 2003-10-25 18:03:21 +00:00
Peter Eisentraut 378f59904a Fix CFLAGS selection to actually work. Add test to detect whether gcc's
option -fno-strict-aliasing is available.
2003-10-25 15:32:11 +00:00
Bruce Momjian 6db0a6b035 Remove socket credentials defines not referenced. 2003-10-25 03:48:47 +00:00
Bruce Momjian e69b2f3b0e Remove weird test in ccsym 2003-10-24 21:28:52 +00:00
Bruce Momjian cded27cacd Don't reference pthread.h unless we have threads enabled, per Peter. 2003-10-24 20:48:10 +00:00
Peter Eisentraut 2034a87a53 Use AROPT, not hard-coded flags. 2003-10-24 20:31:43 +00:00
Peter Eisentraut b3be5e65e8 Translation updates 2003-10-24 12:07:56 +00:00
Tom Lane 0634c01e3a Add missing semicolon, per Johann Uhrmann.
Avoids warnings from newer bisons.
2003-10-22 16:43:42 +00:00
Tom Lane 6fbb14a174 Update the complex-datatype example to V1 function calling conventions,
and add binary send/receive functions.  Fix some other grottiness such
as failure to mark the C functions STRICT.
2003-10-21 22:51:14 +00:00
Tom Lane 2b23bf376b Fix built-in SQL-language functions to ensure that referenced names
are properly schema-qualified.

Christopher Kings-Lynne
2003-10-21 16:23:16 +00:00
Tom Lane 7eb67fc98b Cope with platforms that offer LONGLONG_MIN in place of the C99-spec
LLONG_MIN.  One example is AIX, per report from Andreas.
2003-10-21 15:34:34 +00:00
Tom Lane c9f8c2fd04 Revert to 7.3-and-before practice of only including <fcntl.h> in c.h
on Windows; per complaint from Andreas that it breaks AIX build.
2003-10-21 15:32:58 +00:00
Tom Lane 10add9d8ca Fix findLastBuiltinOid_V70() to deliver correct result when running
against a 7.0 server.

Christopher Kings-Lynne
2003-10-21 04:46:28 +00:00
Peter Eisentraut fd90da7f94 Update catalog version after information schema changes. 2003-10-20 21:39:37 +00:00
Tom Lane 3b64171edb Complain if pg_restore is given both -d and -f options; this suggests
the user is confused about whether -f is input or output file.
2003-10-20 21:05:12 +00:00
Tom Lane 1df7a455dd It is possible for ResolveNew to be used to insert a sublink into a
subquery that didn't previously have one.  We have traditionally made
the caller of ResolveNew responsible for updating the hasSubLinks flag
of the outermost query, but this fails to account for hasSubLinks in
subqueries.  Fix ResolveNew to handle this.  We might later want to
change the calling convention of ResolveNew so that it can fix the
outer query too, simplifying callers.  But I went with the localized
fix for now.  Per bug report from J Smith, 20-Oct-03.
2003-10-20 20:01:59 +00:00
Tom Lane 17841ddbbf Improve error reporting in parseTypeString(), motivated by confusing
behavior reported by Martin Marques.
2003-10-20 17:25:42 +00:00
Michael Meskes 3b72087bf6 Install dummy sqlda.h file since this is needed for compatibility. 2003-10-20 12:54:29 +00:00
Tom Lane 41e6e36719 When building shared libraries on HPUX with gcc, forcibly include -lgcc
to ensure any needed compiler support routines are included.  This is
arguably appropriate on *every* gcc platform, but for the moment I'll take
the conservative approach of only doing it on a platform where it's
provably useful.  Per complaint from Heiko Lehmann, 13-Feb-03, as well
as personal experience --- contrib/pgstattuple has never worked for me,
but it does now.
2003-10-20 01:34:33 +00:00
Tom Lane 6f169057de Save_r, Save_t should be static not global variables. 2003-10-19 23:43:51 +00:00
Tom Lane 9dfdbef345 Adjust libpq to avoid deadlock when both client and server want to send
data, and both have filled the transmission buffers.  One scenario where
this can happen was illustrated here:
http://archives.postgresql.org/pgsql-hackers/2003-04/msg00979.php
2003-10-19 21:36:41 +00:00
Michael Meskes d5353acbc3 Check for both Informix modes when parsing include files. 2003-10-19 13:22:33 +00:00
Peter Eisentraut 9d77708d83 Cleanup on --help-config: Now called --describe-config, no further options,
machine readable, without headers, not sorted.  Parameter descriptions
adjusted to fit first sentence + rest convention.
2003-10-18 22:59:09 +00:00
Tom Lane e341cdb085 Further work on information_schema. _pg_keyissubset() wasn't quite
fully search-path-proof yet; also, element_types view did not work for
parameters and result types of functions, because it didn't generate
the object_name for the function the same way the data_type_privileges
view does.  While at it, centralize dependencies on INDEX_MAX_KEYS/
FUNC_MAX_ARGS into a function returning setof int, so that it will be
easier to fix information_schema for nonstandard values of these
parameters.
2003-10-18 19:06:10 +00:00
Tom Lane eda80f09ff Repair interaction between IN-join processing and subselect pullup that
I inadvertently broke a few days ago (per report from Sean Thomas).
Add regression test case to try to catch any similar breakage in future.
2003-10-18 16:52:15 +00:00
Tom Lane c02036b1d8 Simplify loop test to avoid bug in AIX compiler, per Andreas. 2003-10-18 15:38:06 +00:00
Peter Eisentraut 9ea6d0fc80 Information schema fixes:
Use pg_get_constraintdef instead of pg_constraint.consrc
Use UNION ALL instread of UNION
Make use of regclass type for getting OID of system catalogs
Add schema qualifications where necessary
Fix typos
2003-10-18 12:53:35 +00:00
Tom Lane f2f7107024 Must free the pgParameterStatus chain in freePGconn(). My fault,
well spotted by Neil Conway.
2003-10-18 05:02:06 +00:00
Tom Lane bbba5080b5 Fix elog tab-insertion code to insert tabs only where wanted. 2003-10-17 16:49:03 +00:00
Peter Eisentraut 1b7ac7f130 Remove automatic '()' in other branch of UNION as well. 2003-10-17 11:52:06 +00:00
Tom Lane fe1b5034dd Adjust display of actual runtimes in EXPLAIN output to use three fractional
digits, and label it 'ms' not 'msec', for consistency with psql's \timing
display.  Per recent discussions.
2003-10-17 01:14:26 +00:00
Tom Lane fa2356a1ac Use pg_get_constraintdef() rather than pg_constraint.consrc; this is
a portion of a patch recently submitted by Christopher Kings-Lynne.
Applied by agreement that this is a bug fix.
2003-10-17 00:57:04 +00:00
Peter Eisentraut 44430dbc15 Fix bugs in referential_constraints view. 2003-10-16 23:46:17 +00:00
Peter Eisentraut 4a48c671d2 There should not be an automatic '()' after a function name when
tab-completing.
2003-10-16 23:45:29 +00:00
Tom Lane 52b59a7bec Set attstattarget to -1 for all system catalog columns. All but a few
of the entries used to be zero, which I think I had deliberately done in
the name of saving cycles during ANALYZE, but it was really a rather
foolish decision.  Some of the more complex views in information_schema
were getting really bad plans for lack of statistics on the columns they
were joining over.

I'm not forcing an initdb for this, but I think there will be one soon
anyway to repair some bugs in the information_schema views.
2003-10-16 22:52:22 +00:00
Tom Lane 64c1fc7257 Avoid division by zero in estimate_num_groups() when table has no rows. 2003-10-16 21:37:54 +00:00
Tom Lane 624292aa35 Ensure that all places that are complaining about exhaustion of shared
memory say 'out of shared memory'; some were doing that and some just
said 'out of memory'.  Also add a HINT about increasing max_locks_per_transaction
where relevant, per suggestion from Sean Chittenden.  (The former change
does not break the strings freeze; the latter does, but I think it's
worth doing anyway.)
2003-10-16 20:59:35 +00:00
Tom Lane 2ec74435cd Cause tab completion to do something moderately reasonable with mixed-case
identifiers --- it will now complete these correctly with double quoting.
Fix a few other issues in passing.
2003-10-16 20:03:09 +00:00
Tom Lane 90b2202975 Fix bad interaction between NOTIFY processing and V3 extended query
protocol, per report from Igor Shevchenko.  NOTIFY thought it could
do its thing if transaction blockState is TBLOCK_DEFAULT, but in
reality it had better check the low-level transaction state is
TRANS_DEFAULT as well.  Formerly it was not possible to wait for the
client in a state where the first is true and the second is not ...
but now we can have such a state.  Minor cleanup in StartTransaction()
as well.
2003-10-16 16:50:41 +00:00
Peter Eisentraut 3992f1c50b Translation updates 2003-10-15 10:00:20 +00:00
Peter Eisentraut e9b2b56c23 New translation 2003-10-15 09:49:07 +00:00
Peter Eisentraut 578774d5f5 Translation update 2003-10-15 09:45:34 +00:00
Peter Eisentraut dee5b779fa New translation 2003-10-15 09:39:04 +00:00
Tom Lane 77c1791a58 Use PQescapeString to ensure that tab-completion queries are not messed
up by quotes or backslashes in words that are being matched to database
names (per gripe from Ian Barwick, though I didn't use his patch).
Also fix possible memory leakage if _complete_with_query isn't run to
completion (not clear if that can happen or not, but be safe).
2003-10-14 22:47:12 +00:00
Bruce Momjian 2a0f1c08d5 Remove void* in MemSet until we understand the gcc 3.3.1 problem better. 2003-10-14 19:08:00 +00:00
Tom Lane d18ba3f452 pull_up_subqueries() should copy the subquery before starting to modify
it.  Not sure why I'd thought it would be a good idea to do differently
way back when, but Greg Stark exposed the folly of doing so ...
2003-10-13 23:48:16 +00:00
Bruce Momjian 4a39057e59 Back out makeNode() patch to fix gcc 3.3.1 warning. 2003-10-13 22:47:15 +00:00
Peter Eisentraut 27318d8873 Translation update 2003-10-13 21:38:37 +00:00
Tom Lane 87299583a5 Determine max_connections first, then see how large shared_buffers can
be made, to avoid corner cases where max_connections ends up unreasonably
small because shared_buffers is hogging too much shmem space.  Per pghackers
discussion about a week ago.  Also, fix the copy-newlines problem in a
more robust way, by using COPY FROM filename instead of COPY FROM STDIN;
per a suggestion from Peter.
2003-10-13 21:06:44 +00:00