Commit Graph

5698 Commits

Author SHA1 Message Date
Tom Lane ff5456feae Add code to provide useful dynamic-linking error messages on OS X. 2003-04-13 01:19:06 +00:00
Tom Lane ae02cf3c44 Guard against macro versions of isblank(). 2003-04-12 22:28:33 +00:00
Tatsuo Ishii 35a0995992 Fix encoding conversion function bug.
See following posting for more details.

Subject: Re: [HACKERS] [BUGS] Bug #943: Server-Encoding from EUC_TW to UTF-8 doesn't
From: Tatsuo Ishii <t-ishii@sra.co.jp>
To: michael.enke@wincor-nixdorf.com, pgsql-bugs@postgresql.org
Cc: pgsql-hackers@postgresql.org
Date: Sat, 12 Apr 2003 10:51:45 +0900 (JST)
2003-04-12 07:53:57 +00:00
Tom Lane 5674460bb0 Fix error recovery for SSL_read/SSL_write calls. 2003-04-10 23:03:08 +00:00
Tom Lane da2060e5fd Remove premature attempt to constant-fold type coercion expressions.
While usually safe, this fails if the coercion function needs the
query snapshot to be set already.  Per example from Nigel Andrews.
2003-04-10 02:47:46 +00:00
Tom Lane 730840c9b6 First phase of work on array improvements. ARRAY[x,y,z] constructor
expressions, ARRAY(sub-SELECT) expressions, some array functions.
Polymorphic functions using ANYARRAY/ANYELEMENT argument and return
types.  Some regression tests in place, documentation is lacking.
Joe Conway, with some kibitzing from Tom Lane.
2003-04-08 23:20:04 +00:00
Tom Lane 20f8480927 Mark TimeScales constants as double to avoid integer overflow in some compilers. 2003-04-08 17:02:04 +00:00
Tom Lane dbb7503660 Remove extraneous semicolons. 2003-04-08 16:57:45 +00:00
Jan Wieck cd203f3395 Avoid primary key lookup (and lock) if foreign key does not change
on UPDATE.

This get's rid of the long standing annoyance that updating a row
that has foreign keys locks all the referenced rows even if the
foreign key values do not change.

The trick is to actually do a check identical to NO ACTION after an
eventually done UPDATE in the SET DEFAULT case. Since a SET DEFAULT
operation should have moved referencing rows to a new "home", a following
NO ACTION check can only fail if the column defaults of the referencing
table resulted in the key we actually deleted. Thanks to Stephan.

Jan
2003-04-07 20:30:38 +00:00
Tom Lane afe1185cf0 Remove unnecessary dt2local() call. 2003-04-07 15:04:03 +00:00
Peter Eisentraut cb1d036acb Generate pg_config.h.in by autoheader. Separate out manually editable
parts.  Standardize spelling of comments in pg_config.h.
2003-04-06 22:45:23 +00:00
Bruce Momjian 3a8f67d091 Fix compile problem with Win32 macro used inside another macro. 2003-04-05 19:54:12 +00:00
Bruce Momjian d46e643822 Add Win32 path handling for / vs. \ and drive letters. 2003-04-04 20:42:13 +00:00
Bruce Momjian 9bad936f67 Handle cp, rm, and exec for Win32. 2003-04-04 20:40:45 +00:00
Tom Lane d685417fbb Avoid repeated computation of the constants date2j(1970, 1, 1) and
date2j(2000, 1, 1).  Should make for some marginal speed improvement
in date/time operations.
2003-04-04 04:50:44 +00:00
Tom Lane 3b4ca4c0d9 Code review for pg_stat_get_backend_activity_start patch --- fix
return type, make protection condition agree with recent change to
pg_stat_get_backend_activity, clean up documentation.
2003-04-04 03:03:54 +00:00
Tom Lane a385186ff7 Remove zero_damaged_pages from postgresql.conf.sample; the only way to
find out about it is to read the documentation that tells you how
dangerous it is.  Add default_transaction_read_only to documentation;
seems to have been overlooked in patch that added read-only transactions.
Clean up check_guc comparison script, which has been suffering bit rot.
2003-04-03 23:32:47 +00:00
Tom Lane f1fb9e0097 Prevent EXPLAIN (without ANALYZE) SELECT ... INTO from creating an INTO
table.  Needed due to recent change that makes us call ExecutorStart
even when not planning to carry out the query.
2003-04-03 22:35:48 +00:00
Tom Lane 14e6823c7c Don't re-invent the strchr() wheel. 2003-04-03 21:50:23 +00:00
Tom Lane 61c9ea0f3c Fix load_user/load_group to not leave dangling pointers around if the
config files are present on one pass and not present on a later pass.
2003-04-03 21:25:02 +00:00
Tom Lane 906dce0464 Repair incorrect checking of grouped/ungrouped variables in the presence
of unnamed joins; per pghackers discussion 31-Mar-03.
2003-04-03 18:04:09 +00:00
Tom Lane ec54a6efcf Fix buffer overrun in to_ascii(), per report from Guido Notari. 2003-04-02 21:07:59 +00:00
Tom Lane 794162bb1a Fix convSockAddr6to4(): eliminate bogus assumptions about byte ordering,
remove useless SockAddr_ntop() call.  Per report from Andreas Pflug.
2003-04-02 20:00:21 +00:00
Tom Lane d6f1aa9760 Fix platform-dependent failure introduced by recent to_char changes
(ye good olde uninitialized-local-variable).
2003-04-02 02:33:52 +00:00
Tom Lane 1d650da2e5 This is a derived file and should never have been added to CVS. 2003-04-02 00:58:08 +00:00
Tom Lane 1da6eb7fda Whack getaddrinfo() patch around until it works, more or less, on
machines without IPv6.  Or at least it works on HPUX 10.20 ...
2003-04-02 00:49:28 +00:00
Tom Lane f8a15f632d Add missing semicolon. 2003-04-01 23:42:55 +00:00
Bruce Momjian 50be3e5efe The following patch cleans up the deferred trigger mechanism. There is
an unneeded memory context and some variables that are not used anymore.
It's pretty trivial and the regression tests pass fine.  There's no
change in functionality, only deletion of unused code.  I left an empty
function because maybe I'll need it for nested transactions.

Alvaro Herrera
2003-03-31 20:47:51 +00:00
Tom Lane 7cd30e1590 TestConfiguration returns int, not bool. This mistake is relatively
harmless on signed-char machines but would lead to core dump in the
deadlock detection code if char is unsigned.  Amazingly, this bug has
been here since 7.1 and yet wasn't reported till now.  Thanks to Robert
Bruccoleri for providing the opportunity to track it down.
2003-03-31 20:32:29 +00:00
Bruce Momjian 5e1c330227 Properly document default value of log_min_error_statement in postgresql.conf. 2003-03-30 21:38:02 +00:00
Peter Eisentraut 82a91eb54e Simplify the socket handling code by supplying a replacement getaddrinfo()
function if the OS doesn't provide one.
2003-03-29 11:31:52 +00:00
Bruce Momjian bf7ca0a769 [ Backpatch to 7.3.X.]
SSL_read/write can error needing ERROR_WANT_READ or ERROR_WANT_WRITE.
2003-03-29 05:00:15 +00:00
Bruce Momjian 0184db50a0 [ Backpatch to 7.3.X.]
typing error in src/backend/libpq/be-secure.c ???

Long Description
In src/backend/libpq/be-secure.c: secure_write
on SSL_ERROR_WANT_WRITE call secure_read instead
secure_write again. May be is this a typing error?

Sergey N. Yatskevich (syatskevich@n21lab.gosniias.msk.ru)
2003-03-29 03:56:44 +00:00
Tom Lane fd42262836 Add code to apply some simple sanity checks to the header fields of a
page when it's read in, per pghackers discussion around 17-Feb.  Add a
GUC variable zero_damaged_pages that causes the response to be a WARNING
followed by zeroing the page, rather than the normal ERROR; this is per
Hiroshi's suggestion that there needs to be a way to get at the data
in the rest of the table.
2003-03-28 20:17:13 +00:00
Tom Lane 1bd159e4e9 Fix bogus coding of SET DEFAULT ri triggers ... or at least make it less
bogus than it was.  Per bug report from Adrian Pop.
2003-03-27 19:25:40 +00:00
Bruce Momjian 6f2d02d306 Fix syntax error in to_char fixes --- was defining variable in main code
block, ala C++.
2003-03-27 17:10:55 +00:00
Bruce Momjian 4b0b8dadd2 Add new files. 2003-03-27 16:53:15 +00:00
Bruce Momjian 54f7338fa1 This patch implements holdable cursors, following the proposal
(materialization into a tuple store) discussed on pgsql-hackers earlier.
I've updated the documentation and the regression tests.

Notes on the implementation:

- I needed to change the tuple store API slightly -- it assumes that it
won't be used to hold data across transaction boundaries, so the temp
files that it uses for on-disk storage are automatically reclaimed at
end-of-transaction. I added a flag to tuplestore_begin_heap() to control
this behavior. Is changing the tuple store API in this fashion OK?

- in order to store executor results in a tuple store, I added a new
CommandDest. This works well for the most part, with one exception: the
current DestFunction API doesn't provide enough information to allow the
Executor to store results into an arbitrary tuple store (where the
particular tuple store to use is chosen by the call site of
ExecutorRun). To workaround this, I've temporarily hacked up a solution
that works, but is not ideal: since the receiveTuple DestFunction is
passed the portal name, we can use that to lookup the Portal data
structure for the cursor and then use that to get at the tuple store the
Portal is using. This unnecessarily ties the Portal code with the
tupleReceiver code, but it works...

The proper fix for this is probably to change the DestFunction API --
Tom suggested passing the full QueryDesc to the receiveTuple function.
In that case, callers of ExecutorRun could "subclass" QueryDesc to add
any additional fields that their particular CommandDest needed to get
access to. This approach would work, but I'd like to think about it for
a little bit longer before deciding which route to go. In the mean time,
the code works fine, so I don't think a fix is urgent.

- (semi-related) I added a NO SCROLL keyword to DECLARE CURSOR, and
adjusted the behavior of SCROLL in accordance with the discussion on
-hackers.

- (unrelated) Cleaned up some SGML markup in sql.sgml, copy.sgml

Neil Conway
2003-03-27 16:51:29 +00:00
Bruce Momjian 7a3e7b64ac to_char fixes, Karel Zak 2003-03-27 16:35:31 +00:00
Tom Lane bf576cc014 GetTupleForTrigger must use outer transaction's command counter for time
qual checking, not GetCurrentCommandId.  Per test case from Steve Wolfe.
2003-03-27 14:33:11 +00:00
Peter Eisentraut 5e5c5cd31a Merge documentation into one book. (Build with "make html".) Replace
vague cross-references with real links.
2003-03-25 16:15:44 +00:00
Tom Lane 6ba159f9cf Ignore SIGXFSZ (if platform has it), so that ulimit violations work like
disk-full conditions instead of provoking a backend crash.  Per suggestion
from Frederic Surleau.
2003-03-24 22:40:14 +00:00
Tom Lane fddc2d94ce Modify keys_are_unique optimization to release buffer pins before it
returns NULL.  This avoids out-of-buffers failures during many-way
indexscans, as in Shraibman's complaint of 21-Mar.
2003-03-24 21:42:33 +00:00
Bruce Momjian 346182ca92 Add comment to postgresql.conf:
#search_path = '$user,public'   # schema names
2003-03-24 20:39:10 +00:00
Bruce Momjian 8670e3588f Prevent multiple queries in a single string into a single transaction
when autocommit is off, and document grouping when autocommit is on.
2003-03-24 18:33:52 +00:00
Tom Lane 0489783011 Adjust amrescan code so that it's allowed to call index_rescan with a
NULL key pointer, indicating that the existing scan key should be reused.
This behavior isn't used yet but will be needed for my planned fix to
the keys_are_unique code.
2003-03-23 23:01:03 +00:00
Tom Lane 8d9e025e7f Instead of storing pg_statistic stavalues entries as text strings, store
them as arrays of the internal datatype.  This requires treating the
stavalues columns as 'anyarray' rather than 'text[]', which is not 100%
kosher but seems to work fine for the purposes we need for pg_statistic.
Perhaps in the future 'anyarray' will be allowed more generally.
2003-03-23 05:14:37 +00:00
Tom Lane efeffae245 Tweak selectivity and related routines to cope with domains. Per report
from Andreas Pflug.
2003-03-23 01:49:02 +00:00
Tom Lane 9323cb0aab Department of second thoughts: probably shouldn't use nth() to get the
appropriate targetlist entry out of the subquery.  Use an explicit search
like we do everywhere else.
2003-03-22 17:11:25 +00:00
Bruce Momjian ed11ccf4d4 Fix comment-only query to return Null result set, rather than nothing.
Cleans up blank query handling to be more consistent.
2003-03-22 04:23:34 +00:00