Commit Graph

11940 Commits

Author SHA1 Message Date
Michael Meskes f604b39c2f - Applied some bug fixing patches by Dave Cramer <dave@fastcrypt.com>.
- Added protecting defines to include files.
2003-09-20 09:10:09 +00:00
Tom Lane f72a93b4c9 pg_dump missed comments attached to primary key or unique constraints
(as distinct from their underlying indexes).  Per bug report from
Hiroshi Saito.
2003-09-19 23:15:18 +00:00
Tom Lane a13b018530 Disallow foreign-key references from temp tables to permanent tables.
Per recent discussion, this does not work because other backends can't
reliably see tuples in a temp table and so cannot run the RI checks
correctly.  Seems better to disallow this case than go back to accessing
temp tables through shared buffers.  Also, disallow FK references to
ON COMMIT DELETE ROWS tables.  We already caught this problem for normal
TRUNCATE, but the path used by ON COMMIT didn't check.
2003-09-19 21:04:20 +00:00
Tom Lane fc6b7c550d Latest version of gcc from Apple does not work well with -traditional-cpp
(it rejects some system header files...).  Use -no-cpp-precomp instead.
I think it is okay to change this unconditionally, but if we hear
complaints from people still using very old compilers on Darwin,
we could put in a test to see which switch the compiler likes.
2003-09-19 20:47:59 +00:00
Tom Lane 28847ae77d Seems like a bad idea that REINDEX TABLE supports (or thinks it does)
reindexing system tables without ignoring system indexes, when the
other two varieties of REINDEX disallow it.  Make all three act the same,
and simplify downstream code accordingly.
2003-09-19 19:57:42 +00:00
Michael Meskes 580e08a98b One small typo in preprocessor. 2003-09-19 14:13:16 +00:00
Michael Meskes df974272ec Removed superfluous return statement in get_data. 2003-09-19 14:06:21 +00:00
Michael Meskes 723a9bde33 - Accept output variables for FETCH in DECLARE statement.
- Synced parser.
- Allowed C variables to carry the name of prepared statements.
- Added Informix handling of datatype converion errors.
2003-09-18 13:12:23 +00:00
Barry Lind 215d965f0e Applied patch from Oliver Jowett to clean up some instances where the wrong
type was being reported for PREPAREs.

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java
2003-09-18 04:14:27 +00:00
Barry Lind 7da6afef26 Small jdbc patch from Kim Ho at RedHat to fix some boolean problems
Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
2003-09-18 04:09:02 +00:00
Barry Lind 47cb1c3f94 A minor fix to jdbc regression tests
Modified Files:
 	jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataPropertiesTest.java
2003-09-18 03:58:16 +00:00
Tom Lane 6b73da67b2 Disallow converting a table to a view if it has triggers, indexes, or
child tables --- all cases that will trip various sanity checks elsewhere
in the system, as well as cases that should not occur in the only intended
use of this feature, namely coping with ancient pg_dump representation
of views.  Per bug report from Chris Pizzi.
2003-09-17 17:19:17 +00:00
Barry Lind e8839c2b6c Applied patch to jdbc from Kim Ho at RedHat, fixing improper handling of empty queries under the V3 protocol
Modified Files:
 	jdbc/org/postgresql/core/QueryExecutor.java
2003-09-17 08:21:36 +00:00
Barry Lind c020d67bc6 Applied patch for jdbc from Kim Ho at RedHat to more correctly deal with boolean values
Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
2003-09-17 07:00:24 +00:00
Barry Lind 292048f186 Fixed jdbc to correctly report that constraints are supported
Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
2003-09-17 06:42:47 +00:00
Barry Lind 33815bf657 Applied patch from Fernando Nasser of RedHat to fix some error messages
that would not get correctly looked up in the translation files for jdbc

 Modified Files:
 	jdbc/org/postgresql/errors.properties
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
2003-09-17 05:14:52 +00:00
Barry Lind 0671b65b81 Applied patch from Kim Ho at redhat to improve boolean and bit handling
in the jdbc driver

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc3/AbstractJdbc3Statement.java
2003-09-17 05:07:38 +00:00
Tatsuo Ishii ce90c0f504 Fix typo in comment 2003-09-17 04:25:29 +00:00
Tom Lane 7e06dbe1c2 Make psql correctly track the effects of SET CLIENT_ENCODING commands.
I thought I'd fixed this earlier, but I didn't get it right ...
2003-09-16 17:59:02 +00:00
Tatsuo Ishii 7b05ef5b63 fix typo in a comment 2003-09-16 07:47:06 +00:00
Tom Lane fc73264005 I don't care whether it's informix-compatible or not: #defining a word
like 'date' in a public header file is a damn fool idea.
2003-09-16 04:32:28 +00:00
Tom Lane b8f8896888 Fix some problems with dropped columns in plpython trigger functions. 2003-09-16 01:07:51 +00:00
Tom Lane 8723e37a26 Since SPI_modifytuple's natts argument is the number of attributes to be
changed, it should allow a zero value (implying no changes to make).
2003-09-16 00:50:09 +00:00
Tom Lane db18703b5a Fix LISTEN/NOTIFY race condition reported by Gavin Sherry. While a
really general fix might be difficult, I believe the only case where
AtCommit_Notify could see an uncommitted tuple is where the other guy
has just unlistened and not yet committed.  The best solution seems to
be to just skip updating that tuple, on the assumption that the other
guy does not want to hear about the notification anyway.  This is not
perfect --- if the other guy rolls back his unlisten instead of committing,
then he really should have gotten this notify.  But to do that, we'd have
to wait to see if he commits or not, or make UNLISTEN hold exclusive lock
on pg_listener until commit.  Either of these answers is deadlock-prone,
not to mention horrible for interactive performance.  Do it this way
for now.  (What happened to that project to do LISTEN/NOTIFY in memory
with no table, anyway?)
2003-09-15 23:33:43 +00:00
Tom Lane d73e1b33b5 Update regression test for message change. 2003-09-15 23:25:31 +00:00
Tom Lane daed6f4b94 Improve a couple of error messages per suggestions from Alvaro Herrera. 2003-09-15 22:28:58 +00:00
Peter Eisentraut 7ce5f25b5b Translation updates 2003-09-15 20:42:40 +00:00
Peter Eisentraut 2d13472c9e OK, some of these syntax errors should be given other codes. 2003-09-15 20:03:37 +00:00
Bruce Momjian 72ed916a1f Add errno value for thread *_r function call buffer too small. Improve
thread comments.
2003-09-15 02:30:29 +00:00
Bruce Momjian 24d41a9efc NetBSD needs reentrant funcs. 2003-09-15 02:17:49 +00:00
Peter Eisentraut a07c5a1225 Remove warnings for operations that have no effect when executed repeatedly. 2003-09-15 00:26:31 +00:00
Peter Eisentraut 2f9d32cded Run distprep target before creating list of files that contain translatable
strings in the backend, so that .l and .y files are included.  To that end,
don't make the .pot file a prerequisite on distprep.
2003-09-14 22:40:38 +00:00
Peter Eisentraut 20aaf64252 Allow translation of SQL help in psql. 2003-09-14 22:37:13 +00:00
Tom Lane 241cea18f7 Add missing support for Opteron (__x86_64__). 2003-09-14 20:21:18 +00:00
Tom Lane 0441e269ea Make pltcl create separate function objects when the same function is
used as trigger on different relations.  I am not convinced that Tcl
actually has to have this, but it seems a good idea to make it be
parallel to the other PLs that definitely do need it.
2003-09-14 17:25:54 +00:00
Tom Lane 96e63199f3 Fix plpython to generate separate cached procedure data for each
relation, when the same function is used as a trigger on more than
one relation.  This avoids crashes due to differing rowtypes for
different relations.  Per bug report from Lance Thomas, 7-Feb-03.
2003-09-14 17:13:06 +00:00
Bruce Momjian efebe2605e Since I haven't gotten a reply, can someone REVERT the lines in
src/Makefile.shlib that adds $(libdir)/$(soname) for
port,eq,unixware to $(soname)?

Larry Rosenman
2003-09-14 13:33:08 +00:00
Tom Lane b38c04335a Reconsider placement of MemoryContextCheck() call --- do after commit,
not before, to avoid duplication of effort.
2003-09-14 00:03:32 +00:00
Tom Lane 4cf6e9e081 Avoid corner cases where aset.c would unnecessarily make malloc()
requests of sizes that aren't powers of 2.  Per observation from
David Schultz, 28-Aug.
2003-09-13 22:25:38 +00:00
Tom Lane 94a13b8a11 Okay, I've had it with mktime() bugs. While chasing Torello Querci's
recent gripe, I discovered not one but two undocumented, undesirable
behaviors of glibc's mktime.  So, stop using it entirely, and always
rely on inversion of localtime() to determine the local time zone.
It's not even very much slower, as it turns out that mktime (at least
in the glibc implementation) also does repeated reverse-conversions.
2003-09-13 21:12:38 +00:00
Bruce Momjian cd47a4d3c4 With pg_autovacuum becoming increasingly popular it's important to
have a working stats collector.  This test is able to discover the
problem that was present in 7.4 Beta 2.

Manfred Koizar
2003-09-13 16:44:49 +00:00
Bruce Momjian c346ca8648 When I sent in the sslmode patch I forgot to update the
comments/examples in pg_hba.conf. This patch remedies that, adds a brief
explanation of the connection types, and adds a missing period in the
docs.

Jon Jensen
2003-09-13 16:43:38 +00:00
Bruce Momjian d7635e5c4f autoconf/autoheader run. 2003-09-13 16:39:51 +00:00
Bruce Momjian b041d3e3a1 Attempt threading in this order:
*      use non-*_r function names if they are all thread-safe
 *          (NEED_REENTRANT_FUNCS=no)
 *      use *_r functions if they exist (configure test)
 *      do our own locking and copying of non-threadsafe functions

New to this patch is the last option.
2003-09-13 14:49:51 +00:00
Barry Lind 509a9cd3f9 More SQLState updates from Kim Ho at Redhat.
Also a patch from Kris Jurka to correctly report SQLState support.

 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/fastpath/Fastpath.java
 	jdbc/org/postgresql/geometric/PGbox.java
 	jdbc/org/postgresql/geometric/PGcircle.java
 	jdbc/org/postgresql/geometric/PGline.java
 	jdbc/org/postgresql/geometric/PGlseg.java
 	jdbc/org/postgresql/geometric/PGpath.java
 	jdbc/org/postgresql/geometric/PGpoint.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java
 	jdbc/org/postgresql/jdbc2/Array.java
 	jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java
 	jdbc/org/postgresql/util/PGmoney.java
 	jdbc/org/postgresql/util/PSQLState.java
2003-09-13 04:02:16 +00:00
Tom Lane 8b43e325eb Revert to our pre-7.4 behavior of identifying Unix-socket connections in
ps status as '[local]', not as 'localhost' as the code has been doing
recently.  That's too easily confused with TCP loopback connections,
and there is no good reason to change the behavior anyway.
2003-09-12 20:18:51 +00:00
Tom Lane b1d3de6b96 Someone (possibly me) foolishly reduced the response for failing
to create a TCP/IP socket from FATAL to LOG.  This was unwise;
historically we have expected socket conflicts to abort postmaster
startup.  Conflicts on port numbers with another postmaster can only
be detected reliably at the TCP socket level.
2003-09-12 19:33:59 +00:00
Bruce Momjian 9fc3b9330e Mark FreeBSD as non-thread-safe. 2003-09-12 16:49:34 +00:00
Bruce Momjian 06e3ec7a54 Implement compiler #error if spinlock code not found, add configure flag
to bypass the error, --without-spinlocks.
2003-09-12 16:10:27 +00:00
Bruce Momjian 69a46e9ce1 Enable Opteron/Itanium spinlocks. 2003-09-12 15:49:34 +00:00
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