Commit Graph

11810 Commits

Author SHA1 Message Date
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
Bruce Momjian 38fb906f93 > Joe Conway <mail@joeconway.com> writes:
>>ISTM that "source" is worth knowing.
>
> Hm, possibly.  Any other opinions?

This version has the seven fields I proposed, including "source". Here's
an example that shows why I think it's valuable:

regression=# \x
Expanded display is on.
regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | on
context | user
vartype | bool
source  | default
min_val |
max_val |

regression=# update pg_settings set setting = 'off' where name =
'enable_seqscan';
-[ RECORD 1 ]---
set_config | off

regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | off
context | user
vartype | bool
source  | session
min_val |
max_val |

regression=# alter user postgres set enable_seqscan to 'off';
ALTER USER

(log out and then back in again)

regression=# \x
Expanded display is on.
regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | off
context | user
vartype | bool
source  | user
min_val |
max_val |

In the first case, enable_seqscan is set to its default value. After
setting it to off, it is obvious that the value has been changed for the
session only. In the third case, you can see that the value has been set
specifically for the user.

Joe Conway
2003-07-27 04:35:54 +00:00
Bruce Momjian 9ae6905520 This is a totally trivial patch for something that was a very minor nit that
annoyed me the other day while I was documenting my current project. It
makes pg_dump use the same layout for types as for tables, by putting "\n\t"
before the first field and "\n" before the final ");"

Can't really justify this too much except to say I had an itch and I
scratched it ;-)

Andrew Dunstan
2003-07-27 03:47:22 +00:00
Bruce Momjian 9df48371c2 here are the patches for psql on Win32:
psql4win32.patch  - changes in the psql source code
  psql-ref.patch    - changes in the documentation psql-ref.sgml
                      (for new builtin variable WIN32_CONSOLE)

To apply them use "patch -p 1" in the root directory of the
postgres source directory.

These patches fix the following problems of psql on Win32
(all changes only have effect #ifdef WIN32):

  a) Problem:  Static library libpq.a did not work
     Solution: Added WSAStartup() in fe-connect.c

  b) Problem:  Secret Password was echoed by psql
     Solution: Password echoing disabled in sprompt.c

  c) Problem:  8bit characters were displayed/interpreted wrong in psql
               This is due to the fact that the Win32 "console" uses a
               different encoding than the rest of the Windows system
     Solution: Introduced a new psql variable WIN32_CONSOLE
               When set with "\set WIN32_console", the function OemToChar()
               is applied after reading input and CharToOem() before
               displaying Output

Christoph Dalitz
2003-07-27 03:32:26 +00:00
Bruce Momjian e7fe89d57d This makes the initcap function compatible with Oracle 9i, it has been
tested on both redhat 8 and FreebSD.
--
Mike Nolan
2003-07-27 03:16:20 +00:00
Bruce Momjian 1e5a16cc9c The deferred trigger queue pushing to disk patch pointed out
that the regression tests for foreign keys didn't seem to test
a deferred constraint that was not satisified by a later
statement and was not made immediate by set constraints,
so here's a simple added test with a single invalid insert and
a commit.

Stephan Szabo
2003-07-27 03:13:17 +00:00
Bruce Momjian 1be17f1f26 >>You can alias $0, similar to the argument variables. And, I confirmed
>>that you cannot change the value, similar to the argument variables:
>
> Perhaps you shouldn't mark it isconst; then it would actually have some
> usefulness (you could use it directly as a temporary variable to hold
> the intended result).  I can't see much value in aliasing it if it's
> const, either.

OK; the only change in this version is "isconst = false;". Now you can
use $0 as a result placeholder if desired. E.g.:

create or replace function tmp(anyelement, anyelement) returns anyarray as '
declare
  v_ret alias for $0;
  v_el1 alias for $1;
  v_el2 alias for $2;
begin
  v_ret := ARRAY[v_el1, v_el2];
  return v_ret;
end;
' language 'plpgsql';

create table f(f1 text, f2 text, f3 int, f4 int);
insert into f values ('a','b',1,2);
insert into f values ('z','x',3,4);

select tmp(f1,f2) from f;
select tmp(f3,f4) from f;


Joe Conway
2003-07-26 23:58:23 +00:00
Bruce Momjian abc7f73273 Have SSL text print only when SSL mode is enabled. 2003-07-26 15:22:22 +00:00
Bruce Momjian 74ca686796 I corecting date_trunc('quarter',...) and friends because orig version
doing '2003-07-30' -> '2003-04-01', '2003-11-30' ->'2003-07-01'

B?jthe Zolt?n
2003-07-26 15:17:36 +00:00
Bruce Momjian 397831e103 At long last I put together a patch to support 4 client SSL negotiation
modes (and replace the requiressl boolean). The four options were first
spelled out by Magnus Hagander <mha@sollentuna.net> on 2000-08-23 in email
to pgsql-hackers, archived here:

http://archives.postgresql.org/pgsql-hackers/2000-08/msg00639.php

My original less-flexible patch and the ensuing thread are archived at:

http://dbforums.com/t623845.html

Attached is a new patch, including documentation.

To sum up, there's a new client parameter "sslmode" and environment
variable "PGSSLMODE", with these options:

sslmode   description
-------   -----------
disable   Unencrypted non-SSL only
allow     Negotiate, prefer non-SSL
prefer    Negotiate, prefer SSL (default)
require   Require SSL

The only change to the server is a new pg_hba.conf line type,
"hostnossl", for specifying connections that are not allowed to use SSL
(for example, to prevent servers on a local network from accidentally
using SSL and wasting cycles). Thus the 3 pg_hba.conf line types are:

pg_hba.conf line types
----------------------
host       applies to either SSL or regular connections
hostssl    applies only to SSL connections
hostnossl  applies only to regular connections

These client and server options, the postgresql.conf ssl = false option,
and finally the possibility of compiling with no SSL support at all,
make quite a range of combinations to test. I threw together a test
script to try many of them out. It's in a separate tarball with its
config files, a patch to psql so it'll announce SSL connections even in
absence of a tty, and the test output. The test is especially informative
when run on the same tty the postmaster was started on, so the FATAL:
errors during negotiation are interleaved with the psql client output.

I saw Tom write that new submissions for 7.4 have to be in before midnight
local time, and since I'm on the east coast in the US, this just makes it
in before the bell. :)

Jon Jensen
2003-07-26 13:50:02 +00:00
Tom Lane 5f2499d5af Update to match error editing. 2003-07-26 00:02:02 +00:00
Tom Lane 3b04893ffc Error message editing in src/pl. The plpython module could use another
look ... I'm not real certain which errors are strictly internal and which
are likely to be provoked by users.
2003-07-25 23:37:31 +00:00
Bruce Momjian ad73f6b86f Update copyrights to 2003.
print.c: Add one more line to pager calculation to account for the prompt.
help.c: Call PageOutput with correct number of lines within slashUsage
        Add one to line count in helpSQL to account for "Available help:" line.
        Make copyright match COPYRIGHT file. (Just "1994")

Greg Sabino Mullane
2003-07-25 21:48:45 +00:00
Bruce Momjian 57748fc25d > Having read the list, and noticed the message about table inheritance I
> thought that I would see if I could come up with a simple solution, and
> have my first delve into the code for PostgreSQL.
>
> Attached is a diff against 7.3.3 source, of changes to describe.c for
> psql. This should print out a list of parent tables in a similar style
> to that of the index listing. I have done some testing on my side and it
> all seems fine, can some other people have a quick look? What do people
> think? Useful?

Nick Barr
2003-07-25 21:42:26 +00:00
Tom Lane b92d055b56 Recent patch to dump nondefault attstorage settings broke pg_dump for
dropped columns.  Fix by using LEFT JOIN rather than straight join
between pg_attribute and pg_type.  Also, use pg_type.oid as input to
format_type, so that we don't get a failure on deleted types of deleted
columns (this may be a change we ought to backpatch to 7.3....).
2003-07-25 21:02:52 +00:00
Tom Lane 689eb53e47 Error message editing in backend/utils (except /adt). 2003-07-25 20:18:01 +00:00
Bruce Momjian 9fecf302f7 Seems my check constraint change did break stuff.
Alias the appropriate columns back to their original name.

Fixed formatting of a few other places as I went along (indenting)
--
Rod Taylor <rbt@rbt.ca>
2003-07-25 19:37:21 +00:00
Bruce Momjian 187e865174 > Rod Taylor <rbt@rbt.ca> writes:
> > It seems that readline() on my system (FreeBSD 4.8) isn't declared to
> > take the prompt as a const.  Thus, remove const from gets_interactive()
> > to remove the warning.
>
> I think it would be a lot cleaner to just put a cast to char * into the
> readline call (with a note about why).

Ok.. that works.

I must say it's a little strange being able to take a constant and say
its no longer constant anymore -- but I suppose it's no different than
defining then undefining pre-processor constants.

Rod Taylor <rbt@rbt.ca>
2003-07-25 19:27:06 +00:00
Michael Meskes 6a0d6d0060 Added explicit casts for date/interval/timestamp. 2003-07-25 16:10:26 +00:00
Michael Meskes 4c4a667f4d Applied Peter's patch to use yyless instead of my string_unput function. 2003-07-25 05:42:27 +00:00
Bruce Momjian b2312c4eae No need for Static.Entries, use -rHEAD. 2003-07-25 02:11:17 +00:00
Bruce Momjian 8355901a0e Add example of cvs log pulls _just_ from HEAD. 2003-07-25 01:40:02 +00:00
Tom Lane 45708f5ebc Error message editing in backend/optimizer, backend/rewrite. 2003-07-25 00:01:09 +00:00
Tom Lane cfa191f3b8 Error message editing in backend/storage. 2003-07-24 22:04:15 +00:00
Tom Lane 8fd5b3ed67 Error message editing in contrib (mostly by Joe Conway --- thanks Joe!) 2003-07-24 17:52:50 +00:00
Peter Eisentraut cf16f51a43 Fix grant option dumping and related cross-version compatibility issues. 2003-07-24 15:52:53 +00:00
Michael Meskes 060229b9d7 Fixed mdy functions to use correct offset. 2003-07-24 08:41:07 +00:00
Tom Lane 0643b6a1ba Fix timestamp_date for HAVE_INT64_TIMESTAMP case. 2003-07-24 04:38:19 +00:00
Barry Lind a7a012d167 Fixes additional sql injection vulnerabilities reported by Oliver Jowett
and Dmitry Tkach.  Specifically the previous fix still allowed the statement termination character through in unquoted places in the sql statement, and the driver never correctly handled someone passing a value of \0 in a string which under the v2 protocol would end the statement causing the following text to possibly
be treated as a new sql statement
 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-07-24 00:30:39 +00:00
Tom Lane 47f14e7ddf Repair 7.3 breakage in timestamp-to-date conversion for dates before 2000. 2003-07-24 00:21:26 +00:00
Tom Lane 2d9a001c9e Don't refer to AF_UNIX in code not protected with HAVE_UNIX_SOCKETS. 2003-07-24 00:02:53 +00:00
Tom Lane df63503dc2 Have a go at fixing various outstanding portability issues in code that
was modified for IPv6.  Use a robust definition of struct sockaddr_storage,
do a proper configure test to see if ss_len exists, don't assume that
getnameinfo() will handle AF_UNIX sockets, don't trust getaddrinfo to
return the protocol we ask for, etc.  This incorporates several outstanding
patches from Kurt Roeckx, but I'm to blame for anything that doesn't
work ...
2003-07-23 23:30:41 +00:00
Peter Eisentraut 56b8a6f5d1 Czech translation updates from Karel Zak 2003-07-23 09:36:43 +00:00
Peter Eisentraut ef889e925e Update German translations. 2003-07-23 08:49:30 +00:00
Peter Eisentraut c154fc3a20 Apply message style guide to frontend programs. 2003-07-23 08:47:41 +00:00
Bruce Momjian a7e898785b Stamp 7.3.4. 2003-07-23 04:08:44 +00:00
Tom Lane c72839d5be Error message editing in backend/bootstrap, /lib, /nodes, /port. 2003-07-22 23:30:39 +00:00
Tom Lane 56f87688c4 Error message editing for foreign-key triggers. 2003-07-22 22:14:57 +00:00
Tom Lane fe5de484fe A few parentheses shy of a load here ... 2003-07-22 21:19:22 +00:00
Bruce Momjian a0cc9f3cb9 Add GUC parameter to control rendezvous name. 2003-07-22 20:29:13 +00:00
Tom Lane 25114d3e29 wups, took out one memset too many ... 2003-07-22 19:13:19 +00:00
Tom Lane b05d3ae1ed Error message editing in backend/libpq, backend/postmaster, backend/tcop.
Along the way, fix some logic problems in pgstat_initstats, notably the
bogus assumption that malloc returns zeroed memory.
2003-07-22 19:00:12 +00:00
Barry Lind 0a73f69cb4 Fix to prevent SQL injection attacks for code calling setObject(int,Object,int)
where Object is a user supplied String and the type is a numeric type
(i.e. INTEGER,LONG,etc).
Also applied a patch from Kim Ho that fixes compile problems under jdk1.2

 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-07-22 05:17:09 +00:00
Bruce Momjian 0fe252b5da Don't report sequendces in pg_tables. 2003-07-22 00:02:55 +00:00
Bruce Momjian a4bfb055d4 Back out comment on GucContexts. 2003-07-21 21:02:12 +00:00
Barry Lind 80bbd3281d Applied patch from dmitry@openratings.com to fix parsing of array values
Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc2/Array.java
2003-07-21 20:48:31 +00:00
Tom Lane ec7aa4b515 Error message editing in backend/access. 2003-07-21 20:29:40 +00:00
Tom Lane c6106d91e2 Fix regression test broken by recent view change. 2003-07-21 20:24:31 +00:00
Tom Lane 5e6d691e0d Error message editing in backend/executor. 2003-07-21 17:05:12 +00:00
Bruce Momjian 82f18c4a2c Fix relkind test for pg_tables.
Mike Quinn
2003-07-21 15:20:27 +00:00
Tom Lane d85286305d Error message editing in backend/catalog. 2003-07-21 01:59:11 +00:00
Tom Lane da4ed8bfdd Another round of error message editing, covering backend/commands/. 2003-07-20 21:56:35 +00:00
Bruce Momjian 9132506477 Add Opteron/Itanium comment. 2003-07-20 04:31:32 +00:00
Tom Lane fa3bd4dbd0 Error message editing: finish up undone task of reporting the problem
xid when we fail to access pg_clog.
2003-07-19 21:37:37 +00:00
Tom Lane 2a4a0c4d71 Add ereport-related functions to GETTEXT_TRIGGERS list. 2003-07-19 20:32:12 +00:00
Tom Lane a56ff9a0bd Another round of error message editing, covering backend/parser/. 2003-07-19 20:20:53 +00:00
Tom Lane 216311d590 First bits of work on error message editing. 2003-07-18 23:20:33 +00:00
Bruce Momjian 44f665bf40 Add cleaner formatting to config file. 2003-07-18 19:16:03 +00:00
Michael Meskes 45d8f61ff2 Added more compat stuff ot the parser. 2003-07-18 14:32:56 +00:00
Tom Lane 5ea214b590 It seems some case-insensitive locales sort upper case before lower
(BBBB before bbbb) and others the other way around.  Provide comparison
files that cater to both approaches.
2003-07-18 03:21:53 +00:00
Tom Lane 157e17e20d Add an upper limit to IS_VALID_JULIAN() to defend against overflow in
date2j().  This ensures we give reasonable errors instead of bizarre
behavior for input dates far in the future.
2003-07-17 22:28:42 +00:00
Tom Lane 0347d310d7 Oh, for crying in a bucket ... relax Assert so that glibc's strxfrm
does not dump core.
2003-07-17 22:20:14 +00:00
Tom Lane 59d9a37080 Work around buggy strxfrm() present in some Solaris releases. 2003-07-17 20:52:36 +00:00
Tom Lane 0c172909d5 For COMMENT ON DATABASE where database name is unknown or not the current
database, emit a WARNING and do nothing, rather than raising ERROR.
Per recent discussion in which we concluded this is the best way to deal
with database dumps that are reloaded into a database of a new name.
2003-07-17 20:13:57 +00:00
Tom Lane 8cf63ba920 Repair boundary-case bug introduced by patch of two months ago that
fixed incorrect initial setting of StartUpID.  The logic in XLogWrite()
expects that Write->curridx is advanced to the next page as soon as
LogwrtResult points to the end of the current page, but StartupXLOG()
failed to make that happen when the old WAL ended exactly on a page
boundary.  Per trouble report from Hannu Krosing.
2003-07-17 16:45:04 +00:00
Michael Meskes c15b66ef82 Allow blanks at the end of numerical values. 2003-07-17 11:27:55 +00:00
Michael Meskes 7d32551a81 Fixed some bugs in Informix compat functions. 2003-07-17 07:54:29 +00:00
Tom Lane 764f72dc82 Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL convention
for the sign of timezone offsets, ie, positive is east from UTC.  These
were previously out of step with other operations that accept or show
timezones, such as I/O of timestamptz values.
2003-07-17 00:55:37 +00:00
Tom Lane 93236b58e0 Add defenses against trying to attach qual conditions to a setOperation
query node, since that won't work unless the planner is upgraded.
Someday we should try to support at least some cases of this, but for
now just plug the hole in the dike.  Per discussion with Dmitry Tkach.
2003-07-16 17:25:48 +00:00
Michael Meskes 96be4b28a3 Applied patch to fix two compatibility functions. 2003-07-16 13:18:51 +00:00
Tom Lane ffcb1491af Now that I look, SHOW TRANSACTION_ISOLATION isn't quite consistent
with SET TRANSACTION_ISOLATION, either.
2003-07-15 19:34:43 +00:00
Tom Lane cfa6999d3b Cause SHOW DATESTYLE to produce a string that will be accepted by SET
DATESTYLE, for instance 'SQL, European' instead of
'SQL with European conventions'.  Per gripe a month or two back from
Barry Lind.
2003-07-15 19:19:56 +00:00
Tom Lane 274328c8a8 Avoid use of int64_t, which seems not to be very portable. Simplify
padding logic for struct sockaddr_storage --- original version did not
do what it claimed to when SALEN is defined.
2003-07-15 17:54:34 +00:00
Tom Lane bbac4188f9 OSF supports pthreads, per Philip Yarra. 2003-07-15 17:28:36 +00:00
Michael Meskes 42df5e311f Started to create different error codes for different backend messages. 2003-07-15 12:38:38 +00:00
Tom Lane 9117e55493 Tweak original coding so that we can determine the platform-specific
shared_buffers and max_connections values to use before we run the
bootstrap process.  Without this, initdb would fail on platforms where
the hardwired default values are too large.  (We could get around that
by making the hardwired defaults tiny, perhaps, but why slow down
bootstrap by starving it for buffers...)
2003-07-15 00:11:14 +00:00
Tom Lane 683f4d0a25 Remove duplicate definition of ERROR. 2003-07-14 23:36:15 +00:00
Tom Lane 3d09f6c560 Make cost estimates for SubqueryScan more realistic: charge cpu_tuple_cost
for each row processed, and don't forget the evaluation cost of any
restriction clauses attached to the node.  Per discussion with Greg Stark.
2003-07-14 22:35:54 +00:00
Tom Lane b800196230 Fix typo in comment, as noted by Weiping He. 2003-07-14 20:34:18 +00:00
Tom Lane de98a7e23a The default values for shared_buffers and max_connections are now 1000
and 100 respectively, if the platform will allow it.  initdb selects
values that are not too large to allow the postmaster to start, and
places these values in the installed postgresql.conf file.  This allows
us to continue to start up out-of-the-box on platforms with small SHMMAX,
while having somewhat-realistic default settings on platforms with
reasonable SHMMAX.  Per recent pghackers discussion.
2003-07-14 20:00:23 +00:00
Tom Lane 8460000069 Whoops, missed committing this change to match cosmetic changes in
ascii.c.
2003-07-14 16:58:24 +00:00
Tom Lane b1eb992cc5 Fix a *second* buffer overrun bug in to_ascii(). Grumble. 2003-07-14 16:41:38 +00:00
Michael Meskes 6eb27d16b6 Missed one rule in syncinc preproc.y which resulted in reduce/reduce conflicts. 2003-07-14 12:18:25 +00:00
Michael Meskes e895eb197d - Synced preproc.y with gram.y
- Init sqlca in ECPGprepare().
        - Added CLOSE DATABASE for Informix compatibility.
2003-07-14 10:16:45 +00:00
Bruce Momjian cbdda3e2a9 Add description for new GUC context.
Aizaz Ahmed
2003-07-09 17:57:47 +00:00
Michael Meskes 18936ef372 Argh! Missed one file. 2003-07-09 14:53:18 +00:00
Michael Meskes abfa8ae54f Fixed some Informix compat functions so they handle NULL resp. indicators better. 2003-07-09 13:49:38 +00:00
Bruce Momjian 0ecc8ac425 Add special checks for non-super-user setting LOG_MIN_DURATION_STATEMENT
to zero.
2003-07-09 08:51:19 +00:00
Bruce Momjian bf889e649a Add new USERLIMIT GUC source level so certain options can be disabled
or increased only by super-users.

This fixes problems caused by making certain variables SUSET for
security reasons.
2003-07-09 06:47:34 +00:00
Barry Lind 6896bfa86c Applied patch from Kim Ho @ redhat.com to make support for setObject() more
spec complient with regards to various data/time/timestamp objects

 Modified Files:
 	jdbc/org/postgresql/errors.properties
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-07-09 05:12:04 +00:00
Michael Meskes f207718b0c More informix fixes. 2003-07-08 12:11:35 +00:00
Michael Meskes fee6fd7f65 Fix segfault in connect in informix mode. 2003-07-08 07:13:48 +00:00
Michael Meskes 91d60637cf "char *" of course is not the same as "char []". So I had to fix the way ecpg treated the second one. 2003-07-07 12:15:33 +00:00
Tom Lane 841b4a2d55 tm2timestamp should return -1, not elog, on overflow. (In the backend
this is merely an API inconsistency, but in ecpg it's fatal.)  Also,
fix misconceived overflow test in HAVE_INT64_TIMESTAMP case.
2003-07-04 18:21:14 +00:00
Tom Lane 3abbce39d5 Fix missing code for HAVE_INT64_TIMESTAMP. 2003-07-04 18:15:10 +00:00
Tom Lane b700a672fe Add --help-config facility to dump information about GUC parameters
without needing a running backend.  Reorder postgresql.conf.sample
to match new layout of runtime.sgml.  This commit re-adds work lost
in Wednesday's crash.
2003-07-04 16:41:22 +00:00
Tom Lane efbbd107c7 Add #include <limits.h> (re-add lost change from Wednesday). 2003-07-04 16:28:03 +00:00
Michael Meskes c7fddd3072 date, interval and timestamp data should be quoted. 2003-07-04 12:00:52 +00:00
Michael Meskes 23e4fc18a7 Fixed informix behaviour for select without into. 2003-07-04 11:30:48 +00:00
Tom Lane 79fafdf49c Some early work on error message editing. Operator-not-found and
function-not-found messages now distinguish the cases no-match and
ambiguous-match, and they follow the style guidelines too.
2003-07-04 02:51:34 +00:00
Tom Lane cdb8a844e6 Fix bug I introduced in recent rewrite of NUMERIC code: numeric to
integer conversions gave the wrong answer for values with stripped
trailing zeroes, such as 10000000.
2003-07-03 19:41:47 +00:00
Tom Lane b89140a7ec Do honest transformation and preprocessing of LIMIT/OFFSET clauses,
instead of the former kluge whereby gram.y emitted already-transformed
expressions.  This is needed so that Params appearing in these clauses
actually work correctly.  I suppose some might claim that the side effect
of 'SELECT ... LIMIT 2+2' working is a new feature, but I say this is
a bug fix.
2003-07-03 19:07:54 +00:00
Tom Lane 455891bf96 Code review for UPDATE tab SET col = DEFAULT patch ... whack it around
so it has some chance of working in rules ...
2003-07-03 16:34:26 +00:00
Michael Meskes 7b1885bf98 Fixed initialization bug and added postgres_fe.h to pgtypeslib. 2003-07-02 07:57:36 +00:00
Tom Lane b837c99210 Support polymorphic functions in plpgsql. Along the way, replace
linked-list search of function cache with hash-table lookup.
By Joe Conway.
2003-07-01 21:47:09 +00:00
Bruce Momjian cc3002313f Fix ecpg typo --- change ;; to ;. 2003-07-01 19:58:23 +00:00
Tom Lane e3b1b6c0cd Aggregates can be polymorphic, using polymorphic implementation functions.
It also works to create a non-polymorphic aggregate from polymorphic
functions, should you want to do that.  Regression test added, docs still
lacking.  By Joe Conway, with some kibitzing from Tom Lane.
2003-07-01 19:10:53 +00:00
Tom Lane 02b5d8e371 Dept. of second thoughts: supporting inlining of polymorphic SQL functions
takes only a few more lines of code than preventing it, so might as well
support it.
2003-07-01 19:07:02 +00:00
Tom Lane e0016db7d2 STRENGH => STRENGTH, per Jon Jensen. 2003-07-01 13:49:47 +00:00
Michael Meskes 2bdd2e5dcf Use ISO dates in pgtypeslib by default.
Applied patch by Philip Yarra to fix some thread issues.
Added a new data type "decimal" which is mostly the same as our
	"numeric" but uses a fixed length array to store the digits. This is
	for compatibility with Informix and maybe others.
2003-07-01 12:40:52 +00:00
Tom Lane f973b74583 Department of second thoughts: even if we can't run the full parser on
a SQL function with polymorphic inputs, we can at least run the raw
parser to catch silly syntactic errors.
2003-07-01 01:28:32 +00:00
Peter Eisentraut c5faf2cf3c Translation update 2003-07-01 00:05:49 +00:00
Tom Lane d6d07a0eea SQL functions can have arguments and results declared ANYARRAY or
ANYELEMENT.  The effect is to postpone typechecking of the function
body until runtime.  Documentation is still lacking.

Original patch by Joe Conway, modified to postpone type checking
by Tom Lane.
2003-07-01 00:04:39 +00:00
Peter Eisentraut 71e9f3b07f Change EXECUTE INTO to CREATE TABLE AS EXECUTE. 2003-07-01 00:04:31 +00:00
Dave Cramer df08f5c003 patches by Kim Ho to fix
getByte, getSort if input has decimal or whitespace
setObject if object is a BIT
boolean not on list of SQLKeywords
2003-06-30 21:10:55 +00:00
Tom Lane 6115224448 Rename plpython to plpythonu, and update documentation to reflect its
now-untrusted status.
2003-06-30 18:31:42 +00:00
Tom Lane 219e29784d Add GUC option log_error_verbosity to control which fields of error
reports get put into the postmaster log.  Options are TERSE, DEFAULT,
VERBOSE, with the same behavior as implemented on the client side in
libpq.
2003-06-30 16:47:02 +00:00
Barry Lind 9af05a9d10 Patches applied:
1) Patch from Kris Jurka to fix IPv6 parsing of the jdbc URL
	2) Patch from Kris Jurka to fix an ArrayIndexOutOfBounds error
	   when calling moveToCurrentRow while currentRow is "beforeFirst"
	3) Patch from Kim Ho to fix add some bounds checking in setMaxRows(),
	   setQueryTimeout(), setFetchSize()

 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/errors.properties
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
2003-06-30 16:38:30 +00:00
Tom Lane 835bb975d8 Restructure building of join relation targetlists so that a join plan
node emits only those vars that are actually needed above it in the
plan tree.  (There were comments in the code suggesting that this was
done at some point in the dim past, but for a long time we have just
made join nodes emit everything that either input emitted.)  Aside from
being marginally more efficient, this fixes the problem noted by Peter
Eisentraut where a join above an IN-implemented-as-join might fail,
because the subplan targetlist constructed in the latter case didn't
meet the expectation of including everything.
Along the way, fix some places that were O(N^2) in the targetlist
length.  This is not all the trouble spots for wide queries by any
means, but it's a step forward.
2003-06-29 23:05:05 +00:00
Michael Meskes cf883ea95c - Made sure Informix style decimal vars are initialized. They use a
fixed amount of digits and not an allocated one. So we have to work
  around. PostgreSQL numeric type remains the same.
- In INFORMIX_SE mode with autcommit set, make all cursors be "with
  hold". Is this really they way SE behaves?
2003-06-29 16:52:58 +00:00