Commit Graph

11940 Commits

Author SHA1 Message Date
Bruce Momjian 9182481bea Remove WIN32_CONSOLE support, at the request of the author. 2003-09-12 02:40:10 +00:00
Bruce Momjian aaafbdcfd3 Fix old mention of exec() in AttachSharedMemoryAndSemaphores comment. 2003-09-12 02:13:23 +00:00
Tom Lane 8ff2005c67 Message in the other exit from acquire_sample_rows(), as per update
from Mark Kirkwood.  Also show the sample size.
2003-09-11 23:12:31 +00:00
Tom Lane 47c7f9ef1c Try to make recently-added analyze log message look something like
the others in style.
2003-09-11 22:59:28 +00:00
Bruce Momjian 188eda0df2 Consistenly lowercase GUC variable names, in docs and error messages. 2003-09-11 18:30:39 +00:00
Bruce Momjian d768cb267b seemed like a typo in one of the appendix tables
Robert Treat
2003-09-11 16:22:42 +00:00
Tom Lane fdd93470fa Fix missed message update, per Alvaro Herrera. 2003-09-11 02:40:13 +00:00
Bruce Momjian d6a9b4e0b5 Update row count for \? output, used by pager. 2003-09-10 21:35:55 +00:00
Tom Lane 9cb4a28f47 Improve error message for cp or rm failur during create/drop database,
per recent discussions.
2003-09-10 20:24:09 +00:00
Tom Lane 336ebee2c0 copydir() is supposed to return on failure, not elog(ERROR). Reduce
ERROR to WARNING so we keep control.
2003-09-10 20:12:01 +00:00
Bruce Momjian d16b877612 Add HINT if CREATE FUNCTION specifies a valid language, but the language
isn't loaded into the database.
2003-09-10 19:59:23 +00:00
Michael Meskes 573f4500a3 Some uppercase type definitions were left. 2003-09-10 18:03:08 +00:00
Bruce Momjian 0f310ee703 Here is a patch to make PostgreSQL use a full path in DT_SONAME for
UnixWare.

Larry Rosenman
2003-09-10 03:56:33 +00:00
Peter Eisentraut 33d4c828fd Some "feature not supported" errors are better syntax errors, because the
feature they complain about isn't a feature or cannot be implemented without
definitional changes.
2003-09-09 23:22:21 +00:00
Tom Lane d0bfe7f100 Update comments about how locale settings are handled. 2003-09-09 15:19:31 +00:00
Barry Lind 62b53accd4 Clean up some unused import warnings in the example jdbc code 2003-09-09 11:24:04 +00:00
Barry Lind 5cdf771d8a Additional SQLState work for JDBC - thanks to Kim Ho at Redhat for input on this
Modified Files:
 	jdbc/build.xml jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/util/PSQLState.java
2003-09-09 10:49:16 +00:00
Michael Meskes fcdf0e22fc - Added Dave patch for Informix handling of numeric/int conversion.
- Changed all new datatypes to lowercase.
- Fixed rounding bug in numerical types.
2003-09-09 10:46:42 +00:00
Barry Lind 05dddf40c2 Opps, can't forget the new file. This is part of the last commit to apply
the redhat patch for SQLState support.

 Added Files:
 	PSQLState.java
2003-09-08 17:45:35 +00:00
Barry Lind 0378a269f3 This set of changes applies a patch from KHO at redhat to add some SQLState
support to the jdbc driver.
That patch needed some work: it assumed the sqlcode in a server message was
fixed in its position, the patch lost the ability to pass exceptions, and the
patch missed a couple of places where server errors where being received.
In addition to fixing the above, I also added full support for the V3 protocol
error message syntax, I reversed the order of arguments in the PSQLException
constructor to more closely follow the constructors for SQLException, I changed
the new constructors that take PSQLState to take Object for additional
parameters as the old ones did.
Still todo are to add SQLState values to all existing exceptions thrown in the
driver and add support for parsing the V3 protocol format for notices.

 Modified Files:
 	jdbc/build.xml jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/errors.properties
 	jdbc/org/postgresql/core/Encoding.java
 	jdbc/org/postgresql/core/PGStream.java
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/fastpath/Fastpath.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/util/MessageTranslator.java
 	jdbc/org/postgresql/util/PSQLException.java
2003-09-08 17:30:22 +00:00
Tom Lane e702b04cf4 Avoid using s_addr as a local variable name, to work around broken
system headers on Unixware.
2003-09-08 00:56:13 +00:00
Tom Lane 48beecda7c Remove geqo_random_seed parameter. Having geqo reset the global random()
sequence every time it's called is bogus --- it interferes with user
control over the seed, and actually decreases randomness overall
(because a seed based on time(NULL) is pretty predictable).  If you really
want a reproducible result from geqo, do 'set seed = 0' before planning
a query.
2003-09-07 15:26:54 +00:00
Tom Lane 75c35e0f31 Remove check on source address of a statistics packet. Check was broken
by recent IPv6 changes, and since it's redundant with a kernel-level check
anyway, it seems not worth trying to fix it.  Per recent discussions.
2003-09-07 14:44:40 +00:00
Bruce Momjian 4b407f6c3c Changes for MinGW/WIN32:
o allow configure to see include/port/win32 include files
        o add matching Win32 accept() prototype
        o allow pg_id to compile with native Win32 API
        o fix invalide mbvalidate() function calls (existing bug)
        o allow /scripts to compile with native Win32 API
        o add win32.c to Win32 compiles (already in *.mak files)
2003-09-07 03:43:57 +00:00
Tom Lane 7703e55c32 Make the default pg_hba.conf include an entry for ::1 only if configure
set HAVE_IPV6.  Per recent discussions.
2003-09-07 03:36:03 +00:00
Tom Lane f4ed650996 load_file() has to remove pre-existing shlibs that match the new file
on either name or inode; otherwise load_external_function() won't do
anything.  At least on Linux, it appears that recompiling a shlib leads
to a new file with a different inode, so the old code failed to detect
a match.
2003-09-07 02:18:01 +00:00
Peter Eisentraut 3e20a72603 Make all valid uses of the COLLATE clause yield the same result: a syntax
error.  There is no point in providing some kind of forward compatibility
now, because no one can tell what a future implementation will look like.
2003-09-06 14:01:51 +00:00
Bruce Momjian 4060f07578 Rename variables for clarity. 2003-09-06 01:41:56 +00:00
Tom Lane 92aa462247 Second try at IPv4-to-v6 mapping code; avoid assuming that the struct
returned by getaddrinfo_all will have enough room for an IPv6 address.
2003-09-05 23:07:21 +00:00
Tom Lane 3c9bb8886d Allow IPv4-format entries in pg_hba.conf to match IPv6 connections
that have IPv4-embedded-in-IPv6 addresses.  Per idea of Andreas Pflug.
2003-09-05 20:31:36 +00:00
Bruce Momjian e26af972b5 ifdef out pqGetpwuid() because Win32 doesn't have struct passwd.
Needed for libpq builds, not just for native Win32 port, and probably
for cygwin too.
2003-09-05 17:43:40 +00:00
Bruce Momjian 702c91b4ff This fixes three minor typos in hba.c.
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
2003-09-05 03:57:13 +00:00
Bruce Momjian 04aabb034f Clean up WIN32_CONSOLE code. 2003-09-05 02:31:10 +00:00
Bruce Momjian 2dc9437160 Enable Win32 to compile libpq again, and enable SSL compiles on that
platform.

Andreas Pflug
2003-09-05 02:08:36 +00:00
Bruce Momjian 1709fde56a Improve prototype casting for thread calls. 2003-09-05 01:53:41 +00:00
Tom Lane 7a3693716d Reimplement hash index locking algorithms, per my recent proposal to
pghackers.  This fixes the problem recently reported by Markus KrÌutner
(hash bucket split corrupts the state of scans being done concurrently),
and I believe it also fixes all the known problems with deadlocks in
hash index operations.  Hash indexes are still not really ready for prime
time (since they aren't WAL-logged), but this is a step forward.
2003-09-04 22:06:27 +00:00
Tom Lane ca43f71ca5 Avoid consuming unreasonable amounts of memory when GRANT has many
grantees.
2003-09-04 15:53:04 +00:00
Tom Lane fe055e9280 Looks like plperl has same bug as pltcl. 2003-09-04 15:16:39 +00:00
Tom Lane 9dbfcc2261 Fix some problems with dropped columns in pltcl functions. 2003-09-04 15:10:10 +00:00
Bruce Momjian 6d239ee4b4 Allow non-super users to set log_duration to true, then false, when the
administrator has not turned it on, and fix other PGC_USERLIMIT
variables.
2003-09-04 05:11:20 +00:00
Bruce Momjian b8245766ab Re-upper case CHECKPOINT_SEGMENTS. 2003-09-04 03:38:55 +00:00
Bruce Momjian cac43aefd8 Lowercase CHECKPOINT_SEGMENTS. 2003-09-04 00:36:46 +00:00
Bruce Momjian 38eb18092c Tighten casting of function call pointers for threads. 2003-09-03 22:34:08 +00:00
Peter Eisentraut 29a20145fd Pass session_authorization to the client and make psql update its prompt
accordingly.
2003-09-03 22:05:09 +00:00
Bruce Momjian 4928856fc4 Mark unixware as verified. 2003-09-03 20:54:21 +00:00
Bruce Momjian e57c9fa6b8 Add Unixware as verified. 2003-09-03 20:51:40 +00:00
Bruce Momjian 47e6609c54 Mark BSD/OS as verified not needing reentrant function names. 2003-09-03 19:40:56 +00:00
Bruce Momjian 2310dd3af2 Add reporting of specificy threading failure functions. 2003-09-03 19:36:31 +00:00
Bruce Momjian 4cc247f74b Add test for thread-safeness of libc functions. 2003-09-03 19:30:31 +00:00
Bruce Momjian c351729e1e Mark Unixware as not requiring *_r functions. 2003-09-03 17:55:43 +00:00
Tom Lane b96e32ebf8 Work around ENOTEMPTY being an alias for EEXIST on some platforms. 2003-09-03 15:49:42 +00:00
Tom Lane 5840b89373 Repair problems with to_char() overrunning its input string.
From Karel Zak.
2003-09-03 14:59:41 +00:00
Tom Lane 5ac2d7c0eb In _bt_check_unique() loop, don't bother applying _bt_isequal() to
killed items; just skip to the next item immediately.  Only check for
key equality when we reach a non-killed item or the end of the index
page.  This saves key comparisons when there are lots of killed items,
as for example in a heavily-updated table that's not been vacuumed lately.
Seems to be a win for pgbench anyway.
2003-09-02 22:10:16 +00:00
Peter Eisentraut 30b4abf5d0 Remove outdated CLI things. 2003-09-02 21:45:37 +00:00
Tom Lane b916cc435a Cause standalone backend (including bootstrap case) to read the GUC
config file if it exists.  This was already discussed as being a good
idea, and now seems the cleanest way to deal with initdb-time failures
on machines with small SHMMAX.  (The submitted patches instead modified
initdb.sh to pass the correct sizing parameters, but that would still
leave standalone backends prone to failure later.  An admin who needs
to use a standalone backend has enough trouble already, he shouldn't
have to manually configure its shmem settings...)
2003-09-02 19:04:12 +00:00
Tom Lane d70610c4ee Several fixes for hash indexes that involve changing the on-disk index
layout; therefore, this change forces REINDEX of hash indexes (though
not a full initdb).  Widen hashm_ntuples to double so that hash space
management doesn't get confused by more than 4G entries; enlarge the
allowed number of free-space-bitmap pages; replace the useless bshift
field with a useful bmshift field; eliminate 4 bytes of wasted space
in the per-page special area.
2003-09-02 18:13:32 +00:00
Tom Lane 8b2450c831 Fix a couple typos, add some more comments. 2003-09-02 03:29:01 +00:00
Tom Lane 39673ca47b Rewrite hashbulkdelete() to make it amenable to new bucket locking
scheme.  A pleasant side effect is that it is *much* faster when deleting
a large fraction of the indexed tuples, because of elimination of
redundant hash_step activity induced by hash_adjscans.  Various other
continuing code cleanup.
2003-09-02 02:18:38 +00:00
Peter Eisentraut 5f65345a57 Do not pass server_encoding to the client.
libpq, talking to an old server, should assume SQL_ASCII as the default
client encoding, because that is what the server will actually use (not
the server encoding).
2003-09-01 23:04:49 +00:00
Peter Eisentraut f10a9033bf Clean up after pygresql removal: adjust/remove documentation and remove
unneeded configure work.
2003-09-01 23:01:49 +00:00
Tom Lane 65c2d427fb Preliminary cleanup for hash index code (doesn't attack the locking problem
yet).  Fix a couple of bugs that would only appear if multiple bitmap pages
are used, including a buffer reference leak and incorrect computation of bit
indexes.  Get rid of 'overflow address' concept, which accomplished nothing
except obfuscating the code and creating a risk of failure due to limited
range of offset field.  Rename some misleadingly-named fields and routines,
and improve documentation.
2003-09-01 20:26:34 +00:00
Tom Lane eaeb8621f8 Add some internals documentation for hash indexes, including an
explanation of the remarkably confusing page addressing scheme.
The file also includes my planned-but-not-yet-implemented revision
of the hash index locking scheme.
2003-09-01 20:24:49 +00:00
Michael Meskes 05f4b03b23 Fixed two bugs in pgtypes library. 2003-09-01 12:37:40 +00:00
Bruce Momjian 11c2f1900a Rename DoIt to changeVar, for clarity. 2003-09-01 04:15:51 +00:00
Peter Eisentraut defc7a972d Translation update 2003-08-31 17:38:06 +00:00
Bruce Momjian 5a288903b9 Guard against pgindent changing =- to = -. 2003-08-30 14:59:34 +00:00
Bruce Momjian ceacae7734 Fix unixware template --- had spaces around equals. 2003-08-30 03:19:47 +00:00
Tom Lane 209a8d63df pg_dump and pg_restore -r had managed to diverge on the ordering of
different object types.  Fix, and centralize logic to try to prevent
the same mistake in future.
2003-08-28 20:21:34 +00:00
Tom Lane 80bc61c849 Ensure that FK constraints are dumped after primary/unique constraints,
rather than relying on OID order of pg_constraint entries.  Per gripe
from Greg Stark.
2003-08-28 18:59:06 +00:00
Tom Lane ce2ab4131a Fix stupid typo (mine I suppose) in CopyGetData. Per report from Dave Cramer. 2003-08-28 13:52:34 +00:00
Tom Lane d1031cdef2 Adjust date/time input parsing code to correctly distinguish the four
SQLSTATE error codes required by SQL99 (invalid format, datetime field
overflow, interval field overflow, invalid time zone displacement value).
Also emit a HINT about DateStyle in cases where it seems appropriate.
Per recent gripes.
2003-08-27 23:29:29 +00:00
Tom Lane 64a32f9df8 Department of second thoughts: can't reorder merge-join clauses. 2003-08-27 12:44:12 +00:00
Peter Eisentraut f2c2943aae Share PG_DIAG_* macros between client and server and use them internally. 2003-08-27 00:33:34 +00:00
Tom Lane 73e3edf2e6 Push subplan clauses to the back in qual lists for join plans, not
only scan plans.  Per observation from Rod Taylor.
2003-08-26 22:56:51 +00:00
Bruce Momjian 147c16497b Call it Linux, not GNU/Linux. 2003-08-26 21:31:11 +00:00
Tom Lane 1de9615a58 Use separate SQLSTATE codes for file not found/file exists, rather than
lumping them into ERRCODE_UNDEFINED_OBJECT/ERRCODE_DUPLICATE_OBJECT.
This seems reasonable since 'object' was meant to refer to 'object in the
database' and a file is outside the database.  Per request from Dave
Cramer.
2003-08-26 21:15:27 +00:00
Bruce Momjian 0b511f07e3 psql's HISTSIZE from .psqlrc do not want to be set so I did it for psql
that HISTSIZE might take effect from my .psqlrc

Andriy Tkachuk
2003-08-26 18:35:31 +00:00
Bruce Momjian 1e100176c4 This patch adds a new regression test for the UPDATE command. Right
now all that is tested is Rod Taylor's recent addition to allow
this syntax:

    UPDATE ... SET <col> = DEFAULT;

If anyone else would like to add more UPDATE tests, go ahead --
I just wanted to write a test for the above functionality, and
couldn't see an existing test that it would be appropriate
to add to.

Neil Conway
2003-08-26 18:32:23 +00:00
Michael Meskes 47a4e2ed1c Fixed connect statement with username in variable. 2003-08-26 16:09:02 +00:00
Bruce Momjian cd0f42e87c Attached is a (very small) patch to make analyze display some
interesting info in verbose mode about the analyzed relation (pages,
rows per block and rows).

Mark Kirkwood
2003-08-26 15:38:42 +00:00
Tom Lane f63cbccac7 Mop-up for previous change to determine default shared_buffers and
max_connections at initdb time.  Get rid of DEF_NBUFFERS and DEF_MAXBACKENDS
macros, which aren't doing anything useful anymore, and put more likely
defaults into postgresql.conf.sample.
2003-08-26 15:38:25 +00:00
Barry Lind 06bbd98a15 Attempt to fix setMaxFieldSize() logic that was checked in yesterday.
I think this should fix the problem, but since I don't have a reproducable test
case, I can't be sure.  This problem is reported by Kim Ho of redhat, who will
test this fix.  This also includes a test case for the original functionality.

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/test/jdbc2/ResultSetTest.java
2003-08-26 06:50:39 +00:00
Tom Lane 3e51c1553c Add the Brazilian time zone abbreviations BRT, BRST, FNT, FNST.
ACT and ACST were already present.  AMT and AMST conflict with the
existing entries for Armenia; no change there for the moment.
2003-08-25 23:30:27 +00:00
Tom Lane 412c57b15f Allow parsing of time and timetz inputs to accept the documented input
syntax '040506' for '04:05:06', as well as '0405' for '04:05:00'.  This
has been broken since 7.2 but was only recently complained of.
2003-08-25 22:47:34 +00:00
Peter Eisentraut 3b87c1f8b6 Translation updates 2003-08-25 21:29:53 +00:00
Tom Lane a17f2d76cc Refactor code so that to_date() does not call to_timestamp() and then
perform a timestamp-to-date coercion.  Instead both routines share a
subroutine that delivers the parsing result as a struct tm.  This avoids
problems with timezone dependency of to_date's result, and should be
at least marginally faster too.
2003-08-25 16:13:27 +00:00
Michael Meskes 4b02f3c4eb Synced parser and fixed a bug in error output to log file. 2003-08-25 13:44:00 +00:00
Bruce Momjian f3dda96452 Fix unixware thread test. 2003-08-25 02:48:25 +00:00
Tatsuo Ishii 0c9f978c0c Fix GB18030 to UTF-8 mapping table 2003-08-25 01:46:16 +00:00
Bruce Momjian eb4dded09e Add quotes to += of unixware threads define. 2003-08-24 23:21:05 +00:00
Barry Lind 2495365df1 Applied patches from Oliver Jowett to fix the following bugs:
- adds a finalizer method to AbstractJdbc1Statement to clean up in the case of
   poor user code which fails to close the statement object
 - fix ant build file to correctly detect dependencies across jdbc1/jdbc2/jdbc3
 - fix a coupld of server prepared statement bugs and added regression test for
   them
Applied patch from Kim Ho:
 - adds support for get/setMaxFieldSize().
Also fixed build.xml to provide a better error message in the event that an
older version of the driver exists in the classpath when trying to build.
2003-08-24 22:10:09 +00:00
Peter Eisentraut 478bb0268f Fix translation mistake. 2003-08-24 21:26:34 +00:00
Peter Eisentraut 903fe8fc6f Translation updates 2003-08-24 21:18:53 +00:00
Peter Eisentraut 693aad413b Change warnings for non-existing or pre-existing cursors to errors. 2003-08-24 21:02:43 +00:00
Peter Eisentraut c3664c0c00 Add macros for error result fields to libpq. 2003-08-24 18:36:38 +00:00
Tatsuo Ishii b4ab39ff05 Fix GB18030 to UTF-8 mapping table 2003-08-24 05:18:04 +00:00
Peter Eisentraut 200b7d11af Fix uninstall target. 2003-08-23 04:22:34 +00:00
Peter Eisentraut 588970c399 Correct uninstall target. 2003-08-23 04:21:59 +00:00
Tom Lane 29a43f398a Tweak grammar to use FastAppend rather than lappend when constructing
expr_lists.  This appears to be the only remaining O(N^2) bottleneck
in processing many-way 'x IN (a,b,c,...)' conditions.
2003-08-22 20:34:33 +00:00
Tom Lane 92ee2528d8 Tweak processing of multiple-index-scan plans to reduce overhead when
handling many-way scans: instead of re-evaluating all prior indexscan
quals to see if a tuple has been fetched more than once, use a hash table
indexed by tuple CTID.  But fall back to the old way if the hash table
grows to exceed SortMem.
2003-08-22 20:26:43 +00:00
Peter Eisentraut ef38ca9b3d Translation updates 2003-08-20 21:10:01 +00:00
Tom Lane 80860c32d9 Improve dynahash.c's API so that caller can specify the comparison function
as well as the hash function (formerly the comparison function was hardwired
as memcmp()).  This makes it possible to eliminate the special-purpose
hashtable management code in execGrouping.c in favor of using dynahash to
manage tuple hashtables; which is a win because dynahash knows how to expand
a hashtable when the original size estimate was too small, whereas the
special-purpose code was too stupid to do that.  (See recent gripe from
Stephan Szabo about poor performance when hash table size estimate is way
off.)  Free side benefit: when using string_hash, the default comparison
function is now strncmp() instead of memcmp().  This should eliminate some
part of the overhead associated with larger NAMEDATALEN values.
2003-08-19 01:13:41 +00:00
Tom Lane 23e10843db When compiling a plpgsql trigger function, include the OID of the table
the trigger is attached to in the hashkey.  This ensures that we will
create separate compiled trees for each table the trigger is used with,
avoiding possible datatype-mismatch problems if the tables have different
rowtypes.  This is essentially the same bug recently identified in plpython
--- though plpgsql doesn't seem as prone to crash when the rowtype changes
underneath it.  But failing robustly is no substitute for just working.
2003-08-18 19:16:02 +00:00
Tom Lane e945246321 Fix ARRAY[] construct so that in multidimensional case, elements can
be anything yielding an array of the proper kind, not only sub-ARRAY[]
constructs; do subscript checking at runtime not parse time.  Also,
adjust array_cat to make array || array comply with the SQL99 spec.

Joe Conway
2003-08-17 23:43:27 +00:00
Tom Lane de9c553f6b Clean up locktable init code per recent gripe from Kurt Roeckx.
No change in behavior, but old code would have failed to detect
overrun of MAX_LOCKMODES.
2003-08-17 22:41:12 +00:00
Tom Lane c771838106 Somebody forgot to include any actual documentation for ADD_MISSING_FROM. 2003-08-17 22:19:15 +00:00
Tom Lane ec646dbc65 Create a 'type cache' that keeps track of the data needed for any particular
datatype by array_eq and array_cmp; use this to solve problems with memory
leaks in array indexing support.  The parser's equality_oper and ordering_oper
routines also use the cache.  Change the operator search algorithms to look
for appropriate btree or hash index opclasses, instead of assuming operators
named '<' or '=' have the right semantics.  (ORDER BY ASC/DESC now also look
at opclasses, instead of assuming '<' and '>' are the right things.)  Add
several more index opclasses so that there is no regression in functionality
for base datatypes.  initdb forced due to catalog additions.
2003-08-17 19:58:06 +00:00
Bruce Momjian d4be99f63d (I always forget what the magic numbers 0 through 2 means for the
"syslog" option.)

By the way: The "virtual_host" parameter is a bad name for that
particular option, I think. "Virtual host" signals that PostgreSQL will
behave differently according to which IP address it's contacted (like
Apache's virtual host support which makes the web-server serve different
sites according to different criteria). A better word for the options
would be "tcpip_listen_addr" or something like that.

Troels Arvin
2003-08-17 03:17:22 +00:00
Bruce Momjian 4369432405 Not needed, already in CVS. 2003-08-17 00:14:13 +00:00
Bruce Momjian bfeabcc84f Add description of error style. 2003-08-16 23:53:54 +00:00
Bruce Momjian edc999b09a Make NEED_REENTRANT_FUNC_NAMES _require_ *_r functions, and add tests to
configure to report if they are not found.
2003-08-16 15:35:51 +00:00
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