Commit Graph

11729 Commits

Author SHA1 Message Date
Barry Lind
dcfa89537a Updated the blob regression test to actually use the getBlob/getClob methods
and test them, in addition to testing the underlying LargeObject API methods.

 Modified Files:
 	jdbc/build.xml jdbc/org/postgresql/test/jdbc2/BlobTest.java
2003-08-15 18:45:11 +00:00
Barry Lind
5cad6813fb Fixed improper message length for the connection termination message 'X' when
using the V3 protocol.

 Modified Files:
 	jdbc1/AbstractJdbc1Connection.java
2003-08-15 18:36:58 +00:00
Tom Lane
432ca9116b Rewrite array_cmp to not depend on deconstruct_array. Should be a little
faster, but more importantly does not leak memory.  Still needs more work
though, per my recent note to pgsql-hackers.
2003-08-15 00:22:26 +00:00
Bruce Momjian
b72c1b9f63 Adjustment for unixware threading. 2003-08-14 21:24:38 +00:00
Bruce Momjian
bb0b73cd73 Mark unixware as having threaded support. 2003-08-14 21:14:17 +00:00
Tom Lane
4529d2cf27 Add missing quotes. 2003-08-14 18:56:41 +00:00
Tom Lane
80cedf9ba0 Someone moved PageOutput here from common.c, but forgot to move all
the #includes it depends on.
2003-08-14 18:49:42 +00:00
Tom Lane
dbb4dd29e9 Remove unnecessary #include's (see c.h). 2003-08-14 18:48:35 +00:00
Tom Lane
71b0fe5b2e Workaround for platforms that have getaddrinfo() without AI_NUMERICHOST.
We don't actually need the flag, so just #define it as zero in such cases.
2003-08-14 18:32:55 +00:00
Tom Lane
2b5f049f7c Handle double-quotes correctly in user names in ACL lists.
Christopher Kings-Lynne
2003-08-14 14:19:11 +00:00
Bruce Momjian
8e97f45f88 Document threading status.
Update to POSIX getpwuid_r() function.
2003-08-14 05:27:18 +00:00
Bruce Momjian
a4a31d3967 Adjust for compiler options for compiler bug.
Larry Rosenman
2003-08-13 23:59:49 +00:00
Tom Lane
c01641f8ae libpq failed to cope with COPY FROM STDIN if the command was issued
via extended query protocol, because it sends Sync right after Execute
without realizing that the command to be executed is COPY.  There seems
to be no reasonable way for it to realize that, either, so the best fix
seems to be to make the backend ignore Sync during copy-in mode.  Bit of
a wart on the protocol, but little alternative.  Also, libpq must send
another Sync after terminating the COPY, if the command was issued via
Execute.
2003-08-13 18:56:21 +00:00
Tom Lane
0be731ad44 Add PQexecPrepared() and PQsendQueryPrepared() functions, to allow
libpq users to perform Bind/Execute of previously prepared statements.
Per yesterday's discussion, this offers enough performance improvement
to justify bending the 'no new features during beta' rule.
2003-08-13 16:29:03 +00:00
Tom Lane
5be44fa453 Move MemoryContextCheck() call from bottom of PostgresMain loop to
just before CommitTransactionCommand().  This is a more sensible place
to put it since commit discards a lot of contexts, and we'd not find
out about stomps affecting only transaction-local contexts.
2003-08-13 16:16:23 +00:00
Bruce Momjian
c090b053fe I'm quite fond of doing VPATH builds, i.e. building outside the source
tree. This also catches lots of little Makefile bugs, so here's a small
patch for one of them (replacing an explicit reference to thread.c with
a reference to it as the first prerequsite of the rule makes make look
for it in the place where it was found (the source tree) rather than in
the build tree. (using GNU make 3.79.1)

John Gray
2003-08-13 03:12:04 +00:00
Tom Lane
9234591071 Include 'IPv4', 'IPv6', or 'Unix' in socket-creation failure messages,
in hopes of soothing fears of those with partial IPv6 support.  Still an
open question whether we should report EAFNOSUPPORT errors at all,
though.
2003-08-12 22:42:01 +00:00
Tom Lane
90ade5b775 Cope with NoData message from backend. Needed for case where
PQexecParams is used with a statement that doesn't return data.
2003-08-12 21:34:44 +00:00
Tom Lane
b6e5823eda Marginal hacks to move some processing out of the per-client-message
processing loop; avoids extra overhead when using parse/bind/execute
messages instead of single Query message.
2003-08-12 18:52:38 +00:00
Tom Lane
fcb90fdc95 Change some frequently-reached elog(DEBUG...) calls to ereport(DEBUG...)
for speed reasons.  (ereport falls out much more quickly when no output
is needed than elog does.)
2003-08-12 18:23:21 +00:00
Tom Lane
1c6702f6fc Avoid unnecessary work when stats collection is disabled. Tighten
search loop in pgstat_initstats.  Per report from Gavin Sherry.
2003-08-12 16:21:18 +00:00
Barry Lind
e3d97d7da2 Applied patch from Oliver Jowett to clean up the jdbc regression test build
Modified Files:
 	jdbc/build.xml
 	jdbc/org/postgresql/test/jdbc3/Jdbc3TestSuite.java
2003-08-11 23:42:04 +00:00
Tom Lane
302f1a86dc Rewriter and planner should use only resno, not resname, to identify
target columns in INSERT and UPDATE targetlists.  Don't rely on resname
to be accurate in ruleutils, either.  This fixes bug reported by
Donald Fraser, in which renaming a column referenced in a rule did not
work very well.
2003-08-11 23:04:50 +00:00
Barry Lind
c9fa2871f6 Applied patch from Oliver Jowett to better handle invalid input for getArray
(no longer throw an index out of range exception)

 Modified Files:
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
2003-08-11 21:33:50 +00:00
Barry Lind
1f96440d66 Applied patch from Oliver Jowett to clean up some aditional warning messages
from ant.

 Modified Files:
 	jdbc/build.xml
2003-08-11 21:27:52 +00:00
Barry Lind
17108e6c4f Applied patch from Oliver Jewett to fix a deprecation in newer versions of ant
Modified Files:
 	jdbc/build.xml
2003-08-11 21:25:01 +00:00
Barry Lind
c82bfea125 Applied patch from Oliver Jewett to clean up the testing README file
Modified Files:
 	jdbc/org/postgresql/test/README
2003-08-11 21:20:50 +00:00
Barry Lind
1ca4e700de Applied patch by Oliver Jowett to clean up some exception handling
Modified Files:
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/util/PSQLException.java
2003-08-11 21:18:47 +00:00
Barry Lind
d7c609f7c4 Applied patch from Oliver Jowett to improve a buffer sizing.
Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-08-11 21:12:00 +00:00
Barry Lind
fcbf1f1fdd Applied patch from Kim Ho to fix a regression against a 7.4 server. The result
of transaction isolation level changed from uppercase to lower case between 7.3 and 7.4.  In testing, a regression was also fixed in this area when talking to
a 7.2 server due to changes in how notice messages are processed in the current
code.

 Modified Files:
 	jdbc/build.xml jdbc/org/postgresql/core/BaseStatement.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
2003-08-11 20:54:55 +00:00
Tom Lane
88381ade63 Code cleanup inspired by recent resname bug report (doesn't fix the bug
yet, though).  Avoid using nth() to fetch tlist entries; provide a
common routine get_tle_by_resno() to search a tlist for a particular
resno.  This replaces a couple uses of nth() and a dozen hand-coded
search loops.  Also, replace a few uses of nth(length-1, list) with
llast().
2003-08-11 20:46:47 +00:00
Tom Lane
cae912d05b Do not link in libwsock32 on non-win32 platforms. Improve grammar
of thread-safety comments.
2003-08-11 18:07:38 +00:00
Peter Eisentraut
7078441af0 Translation updates 2003-08-11 15:19:58 +00:00
Tom Lane
ffafacc1f6 Repair potential deadlock created by recent changes to recycle btree
index pages: when _bt_getbuf asks the FSM for a free index page, it is
possible (and, in some cases, even moderately likely) that the answer
will be the same page that _bt_split is trying to split.  _bt_getbuf
already knew that the returned page might not be free, but it wasn't
prepared for the possibility that even trying to lock the page could
be problematic.  Fix by doing a conditional rather than unconditional
grab of the page lock.
2003-08-10 19:48:08 +00:00
Bruce Momjian
329a1b7270 I get the following warning when I compile src/bin/pg_id/pg_id.c:
gcc -pipe -g -Wall -Wmissing-prototypes -Wmissing-declarations
-I../../../src/include   -c -o pg_id.o pg_id.c -MMD
pg_id.c: In function `main':
pg_id.c:35: warning: unused variable `optarg'

The attached trivial patch fixes the warning by removing the variable.

Neil Conway
2003-08-09 01:25:46 +00:00
Bruce Momjian
cf3cc7576c This makes psql use the new pg_get_viewdef function. It also puts one
extra line break in to improve formatting.

Christopher Kings-Lynne
2003-08-09 01:21:54 +00:00
Bruce Momjian
46785776c4 Another pgindent run with updated typedefs. 2003-08-08 21:42:59 +00:00
Bruce Momjian
0e2b12bd96 pgindent fix for new typedefs. 2003-08-08 21:25:06 +00:00
Tom Lane
635d00ecea Avoid malloc(0). Although standard mallocs seem not to object,
some debugging malloc packages do.
2003-08-08 19:19:32 +00:00
Tom Lane
332c694085 Fix nasty little order-of-operations bug in _SPI_cursor_operation.
Per report from Mendola Gaetano.
2003-08-08 19:18:21 +00:00
Bruce Momjian
360162b172 Remove, no in /port. 2003-08-08 18:43:49 +00:00
Bruce Momjian
6a991845a3 sprompt not needed in libpq. 2003-08-08 16:32:45 +00:00
Tom Lane
870886affe Suppress unused-variable warnings when building without Asserts. 2003-08-08 14:39:45 +00:00
Tom Lane
f65643771b Conversion functions must be STRICT to prevent them from getting null inputs. 2003-08-08 14:31:12 +00:00
Peter Eisentraut
fbf1fd2650 Fix null checking of type decimal datums without indicator in Informix
mode.

from Dave Cramer
2003-08-08 13:17:58 +00:00
Peter Eisentraut
e39bc695d6 Be a little bit more careful about using sqlstate, in case libpq returned
NULL for it.
2003-08-08 13:16:20 +00:00
Peter Eisentraut
0bf70870db Translation updates by Dennis Björklund 2003-08-08 11:03:29 +00:00
Peter Eisentraut
acbef53d1f Remove postgres_ext.h inclusion -- not necessary. 2003-08-08 10:43:54 +00:00
Bruce Momjian
63c4d156e0 Move simple_prompt()/sprompt.c into /port. 2003-08-08 04:52:22 +00:00
Bruce Momjian
522b4937b3 Makefile cleanup. 2003-08-08 03:22:24 +00:00
Bruce Momjian
48af71423d Cleanup. 2003-08-08 03:18:40 +00:00
Bruce Momjian
71b9be4d56 Typo cleanup. 2003-08-08 03:09:56 +00:00
Bruce Momjian
86b07104dd Makefile cleanup. 2003-08-08 03:03:54 +00:00
Bruce Momjian
ba0d38fd89 More thread.c cleanup. 2003-08-08 03:00:31 +00:00
Bruce Momjian
30c63f460a More threading cleanups. 2003-08-08 02:55:08 +00:00
Bruce Momjian
e8dd31701b more thread.c consistency. 2003-08-08 02:48:24 +00:00
Bruce Momjian
e4cbb982b0 threads.c -> thread.c, be consistent. 2003-08-08 02:46:40 +00:00
Bruce Momjian
cce40d15d5 Remove space between function name and opening paren in pg_dump, for
clarity.
2003-08-08 01:21:02 +00:00
Tom Lane
f2b6bb42ab Fix floating-point timestamp comparisons to not go nuts if NaN is
encountered; per bug report from Christian van der Leeden 8/7/03.
Also, adjust larger/smaller routines (MAX/MIN) to share code with
comparisons for timestamp, interval, timetz.
2003-08-08 00:10:31 +00:00
Bruce Momjian
e060701f51 Clean up function header. 2003-08-07 23:43:32 +00:00
Tom Lane
33ab177a56 Don't assume that struct option is available just because we can find a
getopt_long().  This is more or less the same problem as we saw earlier
with getaddrinfo() and struct addrinfo, and for the same reason: random
user-added libraries might contain the subroutine, but there's no
guarantee we will find the matching header files.
2003-08-07 21:11:58 +00:00
Tom Lane
fea2ffa7d8 SCO_ACCEPT_BUG code didn't get updated for new SockAddr struct definition. 2003-08-07 19:37:13 +00:00
Tom Lane
ecbed6e1b9 create_unique_plan() should not discard existing output columns of the
subplan it starts with, as they may be needed at upper join levels.
See comments added to code for the non-obvious reason why.  Per bug report
from Robert Creager.
2003-08-07 19:20:24 +00:00
Tom Lane
d862045dfc Don't use HAVE_STRUCT_ADDRINFO as a guide to whether netdb.h defines
macros like AI_NUMERICHOST; instead, test the macros individually.
Should fix recent reports of trouble on AIX and Unixware.
2003-08-07 16:45:21 +00:00
Bruce Momjian
d8295603c8 Make table column type TEXT. 2003-08-07 16:37:31 +00:00
Bruce Momjian
697f9f09ed Add iteration option to thread test program. 2003-08-07 16:14:03 +00:00
Bruce Momjian
c7fda55cc6 Update pgindent readme. 2003-08-07 15:02:43 +00:00
Tom Lane
b830e933c0 Remove unnecessary use of multiple cat processes to feed psql; this
reduces the number of concurrent processes launched during parallel
regression tests, possibly avoiding failures such as exceeding a user's
max number of processes.  This essentially completes the reversion
of 1.27->1.28.
2003-08-07 14:36:31 +00:00
Bruce Momjian
78154363f9 Update typedef names for pgindent 7.4. 2003-08-07 05:18:14 +00:00
Bruce Momjian
00c11039d4 Update ecpg thread testing program to be more automated. 2003-08-07 05:12:00 +00:00
Bruce Momjian
042221db83 Include postgres_ext.h instead of postgres_fe.h. This allows ecpg
output C files to proper compile again.
2003-08-07 04:44:26 +00:00
Bruce Momjian
df5a58811b Add -lm for ecpg/pgtypeslib/Makefile link so -lm isn't required for ecpg
compiles.
2003-08-07 04:03:18 +00:00
Barry Lind
acf09c64b0 Sometimes the third time is the charm. Third try to fix the sql injection
vulnerability.  This fix completely removes the ability (hack) of being able
to bind a list of values in an in clause.  It was demonstrated that by allowing
that functionality you open up the possibility for certain types of
sql injection attacks.  The previous fix attempts all focused on preventing
the insertion of additional sql statements (the semi-colon problem:
xxx; any new sql statement here).  But that still left the ability to
change the where clause on the current statement or perform a subselect
which can circumvent applicaiton security logic and/or allow you to call
any stored function.

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-08-07 04:03:13 +00:00
Tom Lane
338aa57be0 Rename fields of DestReceiver to avoid collisions with (ill-considered)
macros in some platforms' sys/socket.h.
2003-08-06 17:46:46 +00:00
Tom Lane
d5f7d2c682 Adopt a random backoff algorithm for sleep delays when waiting for a
spinlock.  Per recent pghackers discussion.
2003-08-06 16:43:43 +00:00
Tom Lane
a6672880e1 Fix compiler-detected problem for Alphas: it seems strlen returns
something wider than int on that platform.  Also, remove bogus
assumption that sizeof("INT_MAX") has something to do with the maximum
number of digits in an int.
2003-08-06 15:54:06 +00:00
Barry Lind
11e9dcc549 Applied patch from kho@redhat.com to fix a problem with trying to use a fetch
when a cursor wasn't being used.

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
2003-08-06 05:53:13 +00:00
Bruce Momjian
149f01c4d4 Add ecpg thread testing file. 2003-08-06 02:19:51 +00:00
Tom Lane
630684d3a1 Improve documentation of ParseDateTime(). Reorder tests to prevent
writing one more value into return arrays than will fit.  This is
potentially a stack smash, though I do not think it is a problem in
current uses of the routine, since a failure return causes elog anyway.
2003-08-05 18:30:21 +00:00
Tom Lane
9d41073f04 Fix several places where fractional-second inputs were misprocessed
in HAVE_INT64_TIMESTAMP cases, including two potential stack smashes
when more than six fractional digits were supplied.  Per bug report
from Philipp Reisner.
2003-08-05 17:39:19 +00:00
Tom Lane
2f9c859ea1 Fix some copyright notices that weren't updated. Improve copyright tool
so it won't miss 'em again.
2003-08-04 23:59:41 +00:00
Bruce Momjian
98bf004421 Re-add USE_THREADS, used by ecpg. 2003-08-04 21:26:26 +00:00
Tom Lane
17d6721e0b Must print server's failure message before trying reconnect, not after. 2003-08-04 19:10:40 +00:00
Tom Lane
e627dd2db9 Fix pltcl and plpython to support STATEMENT triggers.
Joe Conway
2003-08-04 18:40:50 +00:00
Tom Lane
e8e1d4553c SSL_read/SSL_write do not approximate the return conventions of recv()
and send() very well at all; and in any case we can't use retval==0
for EOF due to race conditions.  Make the same fixes in the backend as
are required in libpq.
2003-08-04 17:58:14 +00:00
Tom Lane
39a9496d51 Fix some more problems with testing error returns from SSL. 2003-08-04 17:25:14 +00:00
Bruce Momjian
5c15cb4752 Fix thread handling in configure. 2003-08-04 16:48:03 +00:00
Tom Lane
963c1fa9d3 Minor cleanups in S_LOCK_TEST code. 2003-08-04 15:28:33 +00:00
Tom Lane
5f6401e2a2 HPUX's horology behavior is OS-dependent, not hardware-dependent. 2003-08-04 15:06:45 +00:00
Peter Eisentraut
fb19e2f41d Translation updates 2003-08-04 14:01:37 +00:00
Tom Lane
4c3c8c048d Remove --enable-recode feature, since it's been broken by IPv6 changes,
and seems to have too few users to justify maintaining.
2003-08-04 04:03:10 +00:00
Bruce Momjian
f3c3deb7d0 Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
Bruce Momjian
19f7ca78cc Fix for 2003 again. 2003-08-04 02:27:25 +00:00
Bruce Momjian
eb20aa9edb Update copyright script for 2003. 2003-08-04 02:22:37 +00:00
Tom Lane
010c6504cb Put back braces removed by pgindent (not really pgindent's fault). 2003-08-04 01:57:58 +00:00
Bruce Momjian
089003fb46 pgindent run. 2003-08-04 00:43:34 +00:00
Bruce Momjian
63354a0228 Remove extra paren in NOT_USED code, found by pgindent. 2003-08-04 00:26:49 +00:00
Tom Lane
455a55fc29 Tighten inline_function's test for overly complex parameters. This
should catch most situations where repeated inlining blows up the
expression complexity unreasonably, as in Joe Conway's recent example.
2003-08-03 23:46:37 +00:00
Tom Lane
c1c7b338ee Reconsider context for calling callback functions --- original idea
that they aren't part of error processing is clearly faulty.
2003-08-03 23:44:44 +00:00
Tom Lane
17bb563abd Comment out entries for IPv6 localhost connections, since they fail
on machines with no IPv6 support.
2003-08-01 23:40:10 +00:00
Tom Lane
5b545644cf Postmaster erroneously rejected SSL connections on IPv6. 2003-08-01 23:25:00 +00:00
Tom Lane
3b7c5aa548 Fix some unprotected references to AF_UNIX ... wouldn't compile on
platforms without AF_UNIX sockets.
2003-08-01 23:24:28 +00:00
Tom Lane
e490ee80e6 inet_recv() wasn't IPv6-ready. 2003-08-01 23:22:52 +00:00
Tom Lane
57c08791d1 Code review for sslmode patch: eliminate memory leak, avoid giving a
completely useless error message in 'allow' case, don't retry connection
at the sendauth stage (by then the server will either let us in or not,
no point in wasting cycles on another try in the other SSL state).
2003-08-01 21:27:27 +00:00
Tom Lane
13ac54d1ca Since HPUX now exists for Itanium, we should decouple the assumption
that OS=hpux is the same as CPU=hppa.  First steps at doing this.
With these patches, we still work on hppa with either gcc or HP's cc.
We might work on hpux/itanium with gcc, but I can't test it.  Definitely
will not work on hpux/itanium with non-gcc compiler, for lack of spinlock
code.
2003-08-01 19:12:52 +00:00
Tom Lane
75619cff56 Get the include ordering right for TCL includes vs whatever is coming
from --with-includes.
2003-08-01 19:01:49 +00:00
Michael Meskes
25b10fc1e6 Missed two places to replace union member. 2003-08-01 18:19:03 +00:00
Tom Lane
6520c666c1 Fix a few of the more blatantly unportable constructs in this file. 2003-08-01 18:10:43 +00:00
Tom Lane
3a1ed8761f Fix inconsistent static-vs-not-static declarations. 2003-08-01 18:03:57 +00:00
Tom Lane
38a412ec39 Fix compile warning. 2003-08-01 16:46:06 +00:00
Peter Eisentraut
ec506c12cd Russian translation updates by Serguei Mokhov 2003-08-01 16:19:14 +00:00
Peter Eisentraut
7843a44839 Use only two-part shared library version numbers, for better portability
and consistency.
2003-08-01 16:18:04 +00:00
Peter Eisentraut
95261c44d2 While having a parallel-make-safe genbki.sh is good, it's better not to
uselessly invoke it in parallel in the first place.
2003-08-01 16:12:32 +00:00
Peter Eisentraut
4f7df90db0 Make ecpg SQLSTATE-aware. Map existing SQLCODE assignments to SQLSTATEs,
rather than parsing the message.  Add some documentation about embedded
SQL.
2003-08-01 13:53:36 +00:00
Bruce Momjian
1ffc5b05a3 Update comments. 2003-08-01 13:48:58 +00:00
Bruce Momjian
5fbb42eb3f Update comments. 2003-08-01 13:48:25 +00:00
Michael Meskes
0584370728 Added missing TO keyword. 2003-08-01 11:25:55 +00:00
Michael Meskes
7a9c074cba - Added some Informix error codes in Informix mode.
- Added just another pgtypeslib function.
2003-08-01 08:21:04 +00:00
Bruce Momjian
83f62e9d29 cvs log used -b for head, not -rHEAD. 2003-08-01 05:52:44 +00:00
Marc G. Fournier
4895635da4 clean python out of Makefile 2003-08-01 04:24:57 +00:00
Marc G. Fournier
13a0e910cd remove python module, as its moved to http://www.pygresql.org 2003-08-01 04:19:06 +00:00
Tom Lane
30f665d745 Fix my own mistake in GUC variable annotation. 2003-08-01 01:23:11 +00:00
Tom Lane
c4cf7fb814 Adjust 'permission denied' messages to be more useful and consistent. 2003-08-01 00:15:26 +00:00
Tom Lane
1297126881 Fix mistaken error code assignments, per Peter's note 7/28/03. 2003-07-31 21:34:18 +00:00
Tom Lane
d7d7d7fa99 When using a temp installation, unset PGUSER and other variables we
might have inherited from the environment that would possibly cause
psql to fail to connect to the temp installation properly.  Per trouble
report from Markus Bertheau 7/1/03.
2003-07-31 19:20:41 +00:00
Tom Lane
8b1ea2f58b Cause library-preload feature to report error if specified initialization
function is not found.  Also, make all the PL libraries have initialization
functions with standard names.  Patch from Joe Conway.
2003-07-31 18:36:46 +00:00
Tom Lane
8488f25425 Upgrade parsing code for ACLs to be less hokey and more cognizant of
the actual logical structure and quoting rules being used.  Fixes bug
reported by Chris K-L on 7/8/03.
2003-07-31 17:21:57 +00:00
Bruce Momjian
f766b376f1 Add fflush of stdout when outputing query. 2003-07-31 04:23:40 +00:00
Tom Lane
52347b6637 Add pretty-printing variants of pg_get_viewdef and related functions.
Patch from Andreas Pflug.
2003-07-30 22:56:24 +00:00
Tom Lane
4b1c6695f1 Fix numeric_smaller, numeric_larger, float4smaller, float4larger,
float8smaller, float8larger (and thereby the MIN/MAX aggregates on these
datatypes) to agree with the datatypes' comparison operations as
regards NaN handling.  In all these datatypes, NaN is arbitrarily
considered larger than any normal value ... but MIN/MAX had not gotten
the word.  Per recent discussion on pgsql-sql.
2003-07-30 19:48:41 +00:00
Tom Lane
9ca5c754fb Cause ARRAY[] construct to return a NULL array, rather than raising an
error, if any input element is NULL.  This is not what we ultimately want,
but until arrays can have NULL elements, it will have to do.  Patch from
Joe Conway.
2003-07-30 19:02:18 +00:00
Tom Lane
5c7d04d24b When shutting down the regression test postmaster after 'make check',
wait for the postmaster to actually exit.  Otherwise running repeated
'make check's tends to misbehave, because we try to remove and recreate
the data directory while the old PM is still alive.
2003-07-30 17:08:47 +00:00
Tom Lane
892a51c367 Fix longstanding error in _bt_search(): should moveright at top of loop not
bottom.  Otherwise we fail to moveright when the root page was split while
we were "in flight" to it.  This is not a significant problem when the root
is above the leaf level, but if the root was also a leaf (ie, a single-page
index just got split) we may return the wrong leaf page to the caller,
resulting in failure to find a key that is in fact present.  Bug has existed
at least since 7.1, probably forever.
2003-07-29 22:18:38 +00:00
Tom Lane
5e3c09a114 Coerce unknown-literal-constant default values to the column type during
CREATE TABLE (or ALTER TABLE SET DEFAULT), rather than postponing it to
the time that the default is inserted into an INSERT command by the
rewriter.  This reverses an old decision that was intended to make the
world safe for writing
	f1 timestamp default 'now'
but in fact merely made the failure modes subtle rather than obvious.
Per recent trouble report and followup discussion.

initdb forced since there is a chance that stored default expressions
will change.
2003-07-29 17:21:27 +00:00
Tom Lane
f353f8e83b There is no reason to cast valuntil to timestamp, and a very good
reason not to: it fails for an 'invalid' abstime.  Per bug report
of today's date.
2003-07-29 14:17:37 +00:00
Tom Lane
a5e804df71 Use a process-specific temp file name, per Andreas Haumer. 2003-07-29 14:12:50 +00:00
Tom Lane
9c2a7c2269 Apply (a somewhat revised version of) Greg Mullane's patch to eliminate
heuristic determination of day vs month in date/time input.  Add the
ability to specify that input is interpreted as yy-mm-dd order (which
formerly worked, but only for yy greater than 31).  DateStyle's input
component now has the preferred spellings DMY, MDY, or YMD; the older
keywords European and US are now aliases for the first two of these.
Per recent discussions on pgsql-general.
2003-07-29 00:03:19 +00:00
Tom Lane
2baf4efe09 Code review for recent GUC changes --- try to make it less obvious that
these things were added at different times by different people ;-).
Includes Aizaz Ahmed's patch to remove duplicate array in help_config.c.
2003-07-28 19:31:32 +00:00
Tom Lane
aad71b40ca Add error stack traceback support for SQL-language functions. 2003-07-28 18:33:18 +00:00
Bruce Momjian
1c241545e3 There was enough code drift since this patch, that a couple of bugs
materialized.

New items have been added to GucContext and GucSource enums, but of
course they were not added to the corresponding GucContextName[] and
GucSourceName[] arrays in the patch. Here's a new patch to fix the
resulting bugs.

Joe Conway
2003-07-28 16:22:16 +00:00
Tom Lane
00941bf9ba Localizability improvement. 2003-07-28 06:27:06 +00:00
Tom Lane
b7489ac445 elog() is no longer a gettext trigger --- all remaining uses are considered
internal errors.
2003-07-28 00:25:21 +00:00
Tom Lane
02d79e765b Rename psql's VERBOSE variable to VERBOSITY, per suggestion from Bruce. 2003-07-28 00:14:43 +00:00
Tom Lane
81b5c8a136 A visit from the message-style police ... 2003-07-28 00:09:16 +00:00
Tom Lane
b556e8200e elog mop-up: bring some straggling fprintf(stderr)'s into the elog world. 2003-07-27 21:49:55 +00:00
Bruce Momjian
440953e6cd Tom, happier with the attached patch?
I'd have to disagree with regards to the memory leaks not being worth
a mention - any such leak can cause problems when the PostgreSQL
installation is either unattended, long-living andor has very high
connection levels. Half a kilobyte on start-up isn't negligible in
this light.

Regards, Lee.

Tom Lane writes:
 > Lee Kindness <lkindness@csl.co.uk> writes:
 > > Guys, attached is a patch to fix two memory leaks on start-up.
 >
 > I do not like the changes to miscinit.c.  In the first place, it is not
 > a "memory leak" to do a one-time allocation of state for a proc_exit
 > function.  A bigger complaint is that your proposed change introduces
 > fragile coupling between CreateLockFile and its callers, in order to
 > save no resources worth mentioning.  More, it introduces an assumption
 > that the globals directoryLockFile and socketLockFile don't change while
 > the postmaster is running.  UnlinkLockFile should unlink the file that
 > it was originally told to unlink, regardless of what happens to those
 > globals.
 >
 > If you are intent on spending code to free stuff just before the
 > postmaster exits, a better fix would be for UnlinkLockFile to free its
 > string argument after using it.

Lee Kindness
2003-07-27 19:39:13 +00:00
Tom Lane
e7f3645171 Fix some localizability issues with existing errcontext() calls. 2003-07-27 18:38:26 +00:00
Tom Lane
2d7a6a9ef2 Move ERRCODE_XXX macros into their own header file. 2003-07-27 18:37:52 +00:00
Tom Lane
e8db9b26d0 elog mop-up. 2003-07-27 17:10:07 +00:00
Tom Lane
b6a1d25b0a Error message editing in utils/adt. Again thanks to Joe Conway for doing
the bulk of the heavy lifting ...
2003-07-27 04:53:12 +00:00