Commit Graph

11355 Commits

Author SHA1 Message Date
Tom Lane 7c7139cf29 Knock down a couple more lappend() hotspots for large WHERE clauses. 2003-05-28 23:06:16 +00:00
Tom Lane 8a6ac83dab Fix some planner performance problems with large WHERE clauses, by
introducing new 'FastList' list-construction subroutines to use in
hot spots.  This avoids the O(N^2) behavior of repeated lappend's
by keeping a tail pointer, while not changing behavior by reversing
list order as the lcons() method would do.
2003-05-28 22:32:50 +00:00
Tom Lane 0f3c68aa43 Fix breakage of LINUX_PROFILE code due to recent Windows changes. 2003-05-28 19:36:28 +00:00
Tom Lane 4df52b28f0 Fix things so that an error occuring during standalone-backend processing
in initdb will result in exit(1), allowing the initdb script to realize
that there's something wrong.
2003-05-28 18:19:09 +00:00
Tom Lane aae078198d In bootstrap and standalone-backend modes, do not sort LOG elevel out
of order; the 'server log' output is actually client output in these
scenarios and we ought to treat elevels the same way as in the client
case.  This allows initdb to not send backend stderr to /dev/null anymore,
which makes it much more likely that people will notice problems during
initdb.
2003-05-28 17:25:02 +00:00
Tom Lane fc8d970cbc Replace functional-index facility with expressional indexes. Any column
of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.
2003-05-28 16:04:02 +00:00
Peter Eisentraut a6f01d1aa6 Internationalize interactive yes/no responses. 2003-05-27 19:36:55 +00:00
Bruce Momjian aea0270c23 Make log_ GUC settings controllable only by super-users, so non-super
users can't turn it off.
2003-05-27 17:55:50 +00:00
Bruce Momjian 98b6f37e47 Make debug_ GUC varables output DEBUG1 rather than LOG, and mention in
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location.
Doc changes included.
2003-05-27 17:49:47 +00:00
Bruce Momjian 24daeb8e73 Add configure thread tests. 2003-05-27 16:36:50 +00:00
Michael Meskes e185583a37 Allow input from stdin and output to stdout. 2003-05-27 14:36:00 +00:00
Michael Meskes 677844560f Fixed incorrect output for some structs. 2003-05-27 11:31:52 +00:00
Tom Lane 5493ecc3a5 Adjust error-handling logic in libpq. For the first time, libpq copes
sanely with running out of memory for a query result.
2003-05-26 20:05:20 +00:00
Tom Lane 8c43300ccc Make sure printtup() always sends the number of columns previously
advertised in RowDescription message.  Depending on the physical tuple's
column count is not really correct, since according to heap_getattr()
conventions the tuple may be short some columns, which will automatically
get read as nulls.  Problem has been latent since forever, but was only
exposed by recent change to skip a projection step in SELECT * FROM...
2003-05-26 17:51:38 +00:00
Bruce Momjian bb9f84aad7 Remove comment that cbrt() isn't being used. 2003-05-26 00:55:25 +00:00
Tom Lane f45df8c014 Cause CHAR(n) to TEXT or VARCHAR conversion to automatically strip trailing
blanks, in hopes of reducing the surprise factor for newbies.  Remove
redundant operators for VARCHAR (it depends wholly on TEXT operations now).
Clean up resolution of ambiguous operators/functions to avoid surprising
choices for domains: domains are treated as equivalent to their base types
and binary-coercibility is no longer considered a preference item when
choosing among multiple operators/functions.  IsBinaryCoercible now correctly
reflects the notion that you need *only* relabel the type to get from type
A to type B: that is, a domain is binary-coercible to its base type, but
not vice versa.  Various marginal cleanup, including merging the essentially
duplicate resolution code in parse_func.c and parse_oper.c.  Improve opr_sanity
regression test to understand about binary compatibility (using pg_cast),
and fix a couple of small errors in the catalogs revealed thereby.
Restructure "special operator" handling to fetch operators via index opclasses
rather than hardwiring assumptions about names (cleans up the pattern_ops
stuff a little).
2003-05-26 00:11:29 +00:00
Peter Eisentraut 297c1658ed Information schema improvements 2003-05-25 09:36:09 +00:00
Bruce Momjian 310049a19b Clean up our static cbrt() implementation in float.c. 2003-05-25 05:30:57 +00:00
Tom Lane 11d5c82002 Improve implementation of btrim/ltrim/rtrim: provide a special case for
single-byte encodings, and a direct C implementation of the single-argument
forms (where spaces are always what gets trimmed).  This is in preparation
for using rtrim1() as the bpchar-to-text cast operator, but is a useful
performance improvement even if we decide not to do that.
2003-05-23 22:33:23 +00:00
Michael Meskes 813d9960d2 Forgot these. 2003-05-23 15:22:38 +00:00
Michael Meskes d258fb91cf ecpg now accepts array elements as arguments. 2003-05-23 15:19:36 +00:00
Tom Lane 450d7e276e Seems pl_funcs didn't have support for plpgsql PERFORM statement. 2003-05-23 04:08:34 +00:00
Bruce Momjian 77645b99f4 Add define for missing EAI_ADDRFAMILY in BSD/OS 4.3. 2003-05-22 19:14:25 +00:00
Peter Eisentraut 6fabec242d Fix compilation on Cygwin. 2003-05-22 17:20:44 +00:00
Tom Lane cef0652a3d Add defense against possibility that tzname[] doesn't exist. 2003-05-22 17:13:08 +00:00
Michael Meskes dbd55d3a5b Fixed segfault when detecting undefined cursor. 2003-05-22 17:09:00 +00:00
Tom Lane c120f4ba0a Adjust configure so that extern tzname[] will be checked for
independently of whether the struct tm tm_zone member exists.
Also run autoheader, which seems not to have been done lately;
it added about three more things to pg_config.h.in than I was expecting...
2003-05-22 16:39:30 +00:00
Tom Lane 39e98d9563 Repair sometimes-incorrect computation of StartUpID after a crash, per
example from Rao Kumar.  This is a very corner corner-case, requiring
a minimum of three closely-spaced database crashes and an unlucky
positioning of the second recovery's checkpoint record before you'd notice
any problem.  But the consequences are dire enough that it's a must-fix.
2003-05-22 14:39:28 +00:00
Michael Meskes d03a067ba0 ecpg now recognizes named structs/unions. So you don't have to list the whole definition everytime you declare a variable anymore. 2003-05-22 07:58:45 +00:00
Tom Lane 0b5b3e9e65 Fix coredump in pg_get_triggerdef, ensure function name is schema-
qualified when necessary, simplify argument-printing code.
2003-05-20 20:35:10 +00:00
Michael Meskes dc554458ad Reversed my incorrect fix. 2003-05-20 11:05:27 +00:00
Tom Lane 9ecba0c2f8 Use -fPIC on Sparc, per Tom Callaway. 2003-05-19 17:51:01 +00:00
Bruce Momjian 36adb2e095 Rename Win32 include directory from win32_include to win32. 2003-05-19 17:31:59 +00:00
Michael Meskes 08d7e1c20e Fixed exec sql ifdef command. 2003-05-19 07:19:57 +00:00
Peter Eisentraut f89c972ac8 Add documentation for information schema, and some corrections on some
views.
2003-05-18 20:55:57 +00:00
Tom Lane 6d7ff848e5 Add code to test for unknown timezone names (following some ideas from
Ross Reedstrom, a couple months back) and to detect timezones that are
using leap-second timekeeping.  The unknown-zone-name test is pretty
heuristic and ugly, but it seems better than the old behavior of just
switching to GMT given a bad name.  Also make DecodePosixTimezone() a
tad more robust.
2003-05-18 01:06:26 +00:00
Tom Lane 6d8c774f55 Fix breakage induced by recent patch (careless use of fmtId()). 2003-05-17 15:53:12 +00:00
Tom Lane f9b232f019 Small changes to use the absolute path to system catalogs.
Greg Sabino Mullane
2003-05-16 13:37:00 +00:00
Michael Meskes 3d41da50f7 Made variable type double work again. 2003-05-16 11:30:09 +00:00
Michael Meskes 7e684fad02 Fixed incorrect include and another typo. Sorry, the include did not create a warning/error/problem on my machine, so I didn't notice it. 2003-05-16 09:42:56 +00:00
Bruce Momjian c42581eba3 Allow interfaces to compile under MingGW/Win32 by adding _P to symbols
in ecpg.
2003-05-16 04:59:24 +00:00
Tom Lane 32be7207aa Revert kerberos code breakage. 2003-05-16 04:58:03 +00:00
Bruce Momjian 9ea764a0dc Remove use of geteuid under Win32. 2003-05-16 02:40:19 +00:00
Bruce Momjian ec5e0ef791 Reorganize Win32 includes to only include <port.h> after system includes
under Win32.  Also fix other compile issues.
2003-05-16 01:57:52 +00:00
Tom Lane 5e04f3857c Revert change of inclusion order for pg_config_os.h; this broke plperl
on Linux and would have who knows what unpleasant effects on other platforms.
If you need another include file for Windows, then add it; don't go
messing with the semantics of every other port's include files.
2003-05-15 23:39:27 +00:00
Tom Lane 9e43184b9d Add missing #include. 2003-05-15 19:34:46 +00:00
Bruce Momjian 09aad5a3a6 Add copydir() function because xcopy doesn't work in XP without a
window.
2003-05-15 17:59:17 +00:00
Bruce Momjian bee0ac67ee Add missing win32 file --- seems best way to find these is to just
commmit then do a cvs update again.
2003-05-15 16:40:29 +00:00
Bruce Momjian 12c9423832 Allow Win32 to compile under MinGW. Major changes are:
Win32 port is now called 'win32' rather than 'win'
        add -lwsock32 on Win32
        make gethostname() be only used when kerberos4 is enabled
        use /port/getopt.c
        new /port/opendir.c routines
        disable GUC unix_socket_group on Win32
        convert some keywords.c symbols to KEYWORD_P to prevent conflict
        create new FCNTL_NONBLOCK macro to turn off socket blocking
        create new /include/port.h file that has /port prototypes, move
          out of c.h
        new /include/port/win32_include dir to hold missing include files
        work around ERROR being defined in Win32 includes
2003-05-15 16:35:30 +00:00
Peter Eisentraut 2c0556068f Indexing support for pattern matching operations via separate operator
class when lc_collate is not C.
2003-05-15 15:50:21 +00:00
Tom Lane 2a2f6cfa39 Fix oversight: ignore-till-SYNC state should not ignore EOF ... 2003-05-14 18:40:37 +00:00
Tom Lane 22c4caef12 Add text(cidr) cast, per recent discussion. I'm not bothering to
force an initdb for this.
2003-05-14 18:08:15 +00:00
Michael Meskes 4e1ed3da9b - Added more compatibility functions.
- Accept CPP defines for type definitions.
	- Do not parse system include files automatically for Informix mode
2003-05-14 14:37:36 +00:00
Tom Lane f85f43dfb5 Backend support for autocommit removed, per recent discussions. The
only remnant of this failed experiment is that the server will take
SET AUTOCOMMIT TO ON.  Still TODO: provide some client-side autocommit
logic in libpq.
2003-05-14 03:26:03 +00:00
Tom Lane d9b679c13a In RowDescription messages, report columns of domain datatypes as having
the type OID and typmod of the underlying base type.  Per discussions
a few weeks ago with Andreas Pflug and others.  Note that this behavioral
change affects both old- and new-protocol clients.
2003-05-13 18:39:50 +00:00
Tom Lane 0249c24235 More binary I/O routines. 2003-05-13 18:03:08 +00:00
Michael Meskes 72f311b86a Fixed order of include file search path. 2003-05-13 11:29:14 +00:00
Tom Lane 1c9ac7dfd0 Change pg_amop's index on (amopclaid,amopopr) to index (amopopr,amopclaid).
This makes no difference for existing uses, but allows SelectSortFunction()
and pred_test_simple_clause() to use indexscans instead of seqscans to
locate entries for a particular operator in pg_amop.  Better yet, they can
use the SearchSysCacheList() API to cache the search results.
2003-05-13 04:38:58 +00:00
Tom Lane 30f609484d Add binary I/O routines for a bunch more datatypes. Still a few to go,
but that was enough tedium for one day.  Along the way, move the few
support routines for types xid and cid into a more logical place.
2003-05-12 23:08:52 +00:00
Tom Lane b02832719c Avoid unnecessary copying of parameter values in BIND. This allows
efficient insertion of large bytea values through the BIND interface.
2003-05-12 16:48:17 +00:00
Tom Lane d97c9b3662 Apply fixes for problems with dropped columns whose types have also been
dropped.  The simplest fix for INSERT/UPDATE cases turns out to be for
preptlist.c to insert NULLs of a known-good type (I used INT4) rather
than making them match the deleted column's type.  Since the representation
of NULL is actually datatype-independent, this should work fine.
I also re-reverted the patch to disable the use_physical_tlist optimization
in the presence of dropped columns.  It still doesn't look worth the
trouble to be smarter, if there are no other bugs to fix.
Added a regression test to catch future problems in this area.
2003-05-12 00:17:03 +00:00
Tom Lane a7c50cd92b Finish removing HPUXMATHLIB. 2003-05-11 20:50:53 +00:00
Tom Lane 6f261461c1 Revert previous change --- turns out the underlying problem affects
more cases than I thought, so ExecTypeFromTL() will have to be fixed
anyway.
2003-05-11 20:25:50 +00:00
Tom Lane 8f2e53bc10 Disable the recently-added use_physical_tlist optimization in cases
where the table contains dropped columns.  If the columns are dropped,
then their types may be gone as well, which causes ExecTypeFromTL() to
fail if the dropped columns appear in a plan node's tlist.  This could
be worked around but I don't think the optimization is valuable enough
to be worth the trouble.
2003-05-11 15:03:52 +00:00
Tom Lane a4e775a263 Make use of new error context stack mechanism to allow random errors
detected during buffer dump to be labeled with the buffer location.
For example, if a page LSN is clobbered, we now produce something like
ERROR:  XLogFlush: request 2C000000/8468EC8 is not satisfied --- flushed only
to 0/8468EF0
CONTEXT:  writing block 0 of relation 428946/566240
whereas before there was no convenient way to find out which page had
been trashed.
2003-05-10 19:04:30 +00:00
Tom Lane ecc8c3652e In child-crashed log messages, identify a checkpoint process as such
instead of calling it a 'server process'.
2003-05-10 18:15:42 +00:00
Tom Lane 8d86a96068 Adjust CreateCheckpoint so that buffer dumping activities and cleanup of
dead xlog segments are not considered part of a critical section.  It is
not necessary to force a database-wide panic if we get a failure in these
operations.  Per recent trouble reports.
2003-05-10 18:01:31 +00:00
Bruce Momjian 199f24e19d More crypt() cleanup. 2003-05-10 04:06:55 +00:00
Bruce Momjian 37627eb571 Remove HPUX 9 rint() test.
Cleanup new crypt() source code.
2003-05-10 04:03:37 +00:00
Bruce Momjian cb8b1299a3 Add Makefile rules for new crypt/rint() /port functions. Add include
for rint prototype.
2003-05-10 02:05:50 +00:00
Tom Lane ba1e066e46 Implement array_send/array_recv (binary I/O for arrays). This exposed
the folly of not passing element type to typsend/typreceive, so fix that.
2003-05-09 23:01:45 +00:00
Tom Lane b1ee615a7f COPY BINARY uses the new binary I/O routines. Update a few more datatypes
so that COPY BINARY regression test passes.
2003-05-09 21:19:50 +00:00
Tom Lane 38d9919d1a Now that fastpath protocol allows null arguments to be passed,
fastpath.c had better check for strict functions.
2003-05-09 18:18:54 +00:00
Tom Lane 0ac6298bb8 Implement new-protocol binary I/O support in DataRow, Bind, and FunctionCall
messages.  Binary I/O is now up and working, but only for a small set
of datatypes (integers, text, bytea).
2003-05-09 18:08:48 +00:00
Bruce Momjian d85a0a6bef More cleanups now that we have crypt(). 2003-05-09 16:59:43 +00:00
Bruce Momjian 66e0a8cb39 Add crypt() to /port for Win32. 2003-05-09 16:52:11 +00:00
Bruce Momjian 89eae96b2f Remove rint() prototype from QNX. 2003-05-09 16:35:57 +00:00
Bruce Momjian 3afb84cd0f Remove another old rint() replacement. 2003-05-09 16:31:24 +00:00
Bruce Momjian 0afe5417d7 Add rint() to /port, remove from qnx/. 2003-05-09 16:26:29 +00:00
Bruce Momjian 995773be1c Pass canAcceptConnections to exec'ed backend, for Jan. 2003-05-09 15:57:24 +00:00
Tom Lane 5ecd4e3f30 Binary send/receive routines for a few basic datatypes --- enough for
testing purposes.
2003-05-09 15:44:42 +00:00
Bruce Momjian 4207d6bf30 Add opendir/readdir/closedir() for Win32.
Keep SRA copyright on file because it contains BSD license clause.
2003-05-09 01:16:29 +00:00
Tom Lane 45d04099df Reinstate pg_type's typsend and typreceive columns. They don't do much
yet, but they're there.  Also some editorial work on CREATE TYPE reference
page.
2003-05-08 22:19:58 +00:00
Bruce Momjian f2c7a27635 Write non-defaults file before signalling the children to reread it. 2003-05-08 20:43:07 +00:00
Bruce Momjian 789a5b340c Move attached to shared memory out into a separate function for clarity. 2003-05-08 19:17:07 +00:00
Tom Lane 075a0078df I think we're done with protocol instability, so mark server and libpq
as speaking the one true 3.0 protocol.
2003-05-08 18:33:39 +00:00
Tom Lane c0a8c3ac13 Update 3.0 protocol support to match recent agreements about how to
handle multiple 'formats' for data I/O.  Restructure CommandDest and
DestReceiver stuff one more time (it's finally starting to look a bit
clean though).  Code now matches latest 3.0 protocol document as far
as message formats go --- but there is no support for binary I/O yet.
2003-05-08 18:16:37 +00:00
Bruce Momjian 5e7a5c9511 Pass shared memory address on command line to exec'ed backend.
Allow backends to attached to specified shared memory address.
2003-05-08 14:49:04 +00:00
Bruce Momjian 07d35e4277 Change alternate database location patch to test for symlink() rather
than WIN32.
2003-05-07 03:47:08 +00:00
Barry Lind 137b123fc7 Fixed bug with Warnings. Warnings are not added to the Statement instead of
the connection when appropriate.
This checkin also adds the type map for jdbc3, however currently it is
identical to the jdbc2 mapping.

 Modified Files:
 	jdbc/org/postgresql/core/BaseStatement.java
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/jdbc3/AbstractJdbc3Connection.java
2003-05-07 03:03:30 +00:00
Bruce Momjian d9fd7d12f6 Pass shared memory id and socket descriptor number on command line for
fork/exec.
2003-05-06 23:34:56 +00:00
Tom Lane 755d191700 Add display of eventual result RowDescription (if any) to the output
of Describe on a prepared statement.  This was in the original 3.0
protocol proposal, but I took it out for reasons that seemed good at
the time.  Put it back per yesterday's pghackers discussion.
2003-05-06 21:51:42 +00:00
Tom Lane 8f6a6b7e9a Ensure that an Execute operation can't send tuples in cases where
Describe would claim that no tuples will be returned.  Only affects
SELECTs added to non-SELECT base queries by rewrite rules.  If you
want to see the output of such a select, you gotta use 'simple Query'
protocol.
2003-05-06 21:01:04 +00:00
Tom Lane 79913910d4 Restructure command destination handling so that we pass around
DestReceiver pointers instead of just CommandDest values.  The DestReceiver
is made at the point where the destination is selected, rather than
deep inside the executor.  This cleans up the original kluge implementation
of tstoreReceiver.c, and makes it easy to support retrieving results
from utility statements inside portals.  Thus, you can now do fun things
like Bind and Execute a FETCH or EXPLAIN command, and it'll all work
as expected (e.g., you can Describe the portal, or use Execute's count
parameter to suspend the output partway through).  Implementation involves
stuffing the utility command's output into a Tuplestore, which would be
kind of annoying for huge output sets, but should be quite acceptable
for typical uses of utility commands.
2003-05-06 20:26:28 +00:00
Michael Meskes 299fbb4b37 Added rfmtlong compatibility function. 2003-05-06 09:48:25 +00:00
Bruce Momjian 3ad406bbc9 Rename internal variables DBName|dbName to dbname, for consistency. 2003-05-06 05:15:45 +00:00
Bruce Momjian 77a0219ab1 Comment out some of the conditional tests until we have exec().
Reorder non-default variable loading until PGDATA is defined.
2003-05-06 04:16:35 +00:00
Tom Lane 2cf57c8f8d Implement feature of new FE/BE protocol whereby RowDescription identifies
the column by table OID and column number, if it's a simple column
reference.  Along the way, get rid of reskey/reskeyop fields in Resdoms.
Turns out that representation was not convenient for either the planner
or the executor; we can make the planner deliver exactly what the
executor wants with no more effort.
initdb forced due to change in stored rule representation.
2003-05-06 00:20:33 +00:00
Tom Lane 94a3c60324 Ditch ExecGetTupType() in favor of the much simpler ExecGetResultType(),
which does the same thing.  Perhaps at one time there was a reason to
allow plan nodes to store their result types in different places, but
AFAICT that's been unnecessary for a good while.
2003-05-05 17:57:47 +00:00
Tom Lane 20aea2ec7b Alter plpgsql's lexer so that yylineno and yymore are not used. This
avoids 'input buffer overflow' failure on long literals, improves
performance, gives the right answer for line position in functions
containing multiline literals, suppresses annoying compiler warnings,
and generally is so much better I wonder why we didn't do it before.
2003-05-05 16:46:28 +00:00
Tom Lane e3ed942e3b Not sure why parser() was still doing clearerr(stdin) ... but it's
*got* to be pointless.
2003-05-05 01:59:02 +00:00
Tom Lane 16503e6fa4 Extended query protocol: parse, bind, execute, describe FE/BE messages.
Only lightly tested as yet, since libpq doesn't know anything about 'em.
2003-05-05 00:44:56 +00:00
Bruce Momjian a59793f82c Disable alternate locations on Win32 because it doesn't support symlinks. 2003-05-04 04:42:52 +00:00
Tom Lane 50ed78b805 Allow 60 in seconds fields of timestamp, time, interval input values.
Per recent discussion on pgsql-general, this is appropriate for spec
compliance, and has the nice side-effect of easing porting from old
pg_dump files that exhibit the 59.999=>60.000 roundoff problem.
2003-05-04 04:30:15 +00:00
Tom Lane ac5fdea687 When a TIMESTAMP, TIME, or INTERVAL precision is specified larger than our
implementation limits, do not issue an ERROR; instead issue a NOTICE and use
the max supported value.  Per pgsql-general discussion of 28-Apr, this is
needed to allow easy porting from pre-7.3 releases where the limits were
higher.

Unrelated change in same area: accept GLOBAL TEMP/TEMPORARY as a synonym
for TEMPORARY, as per pgsql-hackers discussion of 15-Apr.  We previously
rejected it, but that was based on a misreading of the spec --- SQL92's
GLOBAL temp tables are really closer to what we have than their LOCAL ones.
2003-05-04 00:03:55 +00:00
Tom Lane 228697179a Fix erroneous space calculation leading to core dump in dumpProcLangs,
per report from Olivier Prenant.  Also fix off-by-one space calculation
in ReadToc; this woould not have hurt us until we had more than 100
dependencies for a single object, but wrong is wrong.
2003-05-03 22:18:59 +00:00
Barry Lind 5295fffc26 Patch to fix up LONGVARBINARY support submitted by Amit Gollapudi
(agollapudi@demandsolutions.com).
Also applied the RefCursor support patch by Nic Ferrier.  This patch allows
you too return a get a result set from a function that returns a refcursor.
For example:
call.registerOutParameter(1, Types.OTHER);
call.execute();
ResultSet rs = (ResultSet) call.getObject(1);

Modified Files:
 	jdbc/org/postgresql/core/BaseStatement.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc1/Jdbc1CallableStatement.java
 	jdbc/org/postgresql/jdbc1/Jdbc1PreparedStatement.java
 	jdbc/org/postgresql/jdbc1/Jdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java
 	jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java
 	jdbc/org/postgresql/jdbc2/Jdbc2Statement.java
 	jdbc/org/postgresql/jdbc3/Jdbc3CallableStatement.java
 	jdbc/org/postgresql/jdbc3/Jdbc3PreparedStatement.java
 	jdbc/org/postgresql/jdbc3/Jdbc3Statement.java
 Added Files:
 	jdbc/org/postgresql/PGRefCursorResultSet.java
 	jdbc/org/postgresql/jdbc1/Jdbc1RefCursorResultSet.java
 	jdbc/org/postgresql/jdbc2/Jdbc2RefCursorResultSet.java
 	jdbc/org/postgresql/jdbc3/Jdbc3RefCursorResultSet.java
 	jdbc/org/postgresql/test/jdbc2/RefCursorTest.java
2003-05-03 20:40:45 +00:00
Bruce Momjian 721996d889 Cleanup patch for exec() handling. 2003-05-03 05:13:20 +00:00
Bruce Momjian a7fd03e1de Handle clog structure in shared memory in exec() case, for Win32. 2003-05-03 03:52:07 +00:00
Bruce Momjian 36fa297497 SECOND ATTEMPT
Dump/read non-default GUC values for use by exec'ed backend, for Win32.
2003-05-02 22:02:47 +00:00
Bruce Momjian 9f0d69f527 Back out second part of patch. 2003-05-02 22:01:51 +00:00
Bruce Momjian a2e038fbee Back out last commit --- wrong patch. 2003-05-02 21:59:31 +00:00
Bruce Momjian fb1f7ccec5 Dump/read non-default GUC values for use by exec'ed backends, for Win32. 2003-05-02 21:52:42 +00:00
Tom Lane de28dc9a04 Portal and memory management infrastructure for extended query protocol.
Both plannable queries and utility commands are now always executed
within Portals, which have been revamped so that they can handle the
load (they used to be good only for single SELECT queries).  Restructure
code to push command-completion-tag selection logic out of postgres.c,
so that it won't have to be duplicated between simple and extended queries.
initdb forced due to addition of a field to Query nodes.
2003-05-02 20:54:36 +00:00
Tom Lane 1940434f1e Repair sloppiness about where cached mergeclause pathkeys are allocated.
Without this fix, CVS tip dumps core when running the regression tests
with geqo_threshold = 2.  I would think that a similar patch might be
needed in 7.3, but cannot duplicate the failure in that branch --- so
for now, leave well enough alone.
2003-05-02 19:48:53 +00:00
Michael Meskes f7d836212a Fixed double definition of ecpg_compat_mode. 2003-05-02 14:43:25 +00:00
Michael Meskes 9e9d8d54e3 Added an option to force ecpg to also parse files includes via '#include' and some more Informix stuff. 2003-05-01 17:16:57 +00:00
Tom Lane 0c57d69dd7 Update to describe new set of globally-known contexts planned for support
of extended query features in new FE/BE protocol.  TransactionCommandContext
is gone (PortalContext replaces it for some purposes), and QueryContext
has taken on a new meaning (MessageContext plays its old role).
2003-04-30 19:04:12 +00:00
Tom Lane aa282d4446 Infrastructure for deducing Param types from context, in the same way
that the types of untyped string-literal constants are deduced (ie,
when coerce_type is applied to 'em, that's what the type must be).
Remove the ancient hack of storing the input Param-types array as a
global variable, and put the info into ParseState instead.  This touches
a lot of files because of adjustment of routine parameter lists, but
it's really not a large patch.  Note: PREPARE statement still insists on
exact specification of parameter types, but that could easily be relaxed
now, if we wanted to do so.
2003-04-29 22:13:11 +00:00
Bruce Momjian 19141f5584 Remove unneeded define. 2003-04-29 18:25:54 +00:00
Tom Lane 4a5f38c4e6 Code review for holdable-cursors patch. Fix error recovery, memory
context sloppiness, some other things.  Includes Neil's mopup patch
of 22-Apr.
2003-04-29 03:21:30 +00:00
Tom Lane 11def6906b Missed some corner cases (PGSERVICE mostly)... 2003-04-28 04:52:13 +00:00
Tom Lane 092133beb3 Okay, I've had it with PQsetdbLogin having slightly different defaults
than PQconnectdb.  Reimplement the former to use the same code as the
latter.  Fix documentation omissions while at it.
2003-04-28 04:29:12 +00:00
Tom Lane d08007ae77 Make getaddrinfo's behavior with NULL node parameter agree with the
Linux man page for it.  This error was preventing CVS tip from accepting
remote connections.
2003-04-27 23:56:53 +00:00
Tom Lane 1045655a25 Prevent coredump in current_schemas() if someone has just deleted a
schema that was in our search path.
2003-04-27 23:22:13 +00:00
Tom Lane 4089d25175 Fix plpgsql so that variables of composite types (rowtypes) can be
declared without having to write %ROWTYPE.  If the declared type of
a variable is a composite type, it'll be taken to be a row variable
automatically.
2003-04-27 22:21:22 +00:00
Tom Lane 982430f846 Put back encoding-conversion step in processing of incoming queries;
I had inadvertently omitted it while rearranging things to support
length-counted incoming messages.  Also, change the parser's API back
to accepting a 'char *' query string instead of 'StringInfo', as the
latter wasn't buying us anything except overhead.  (I think when I put
it in I had some notion of making the parser API 8-bit-clean, but
seeing that flex depends on null-terminated input, that's not really
ever gonna happen.)
2003-04-27 20:09:44 +00:00
Tom Lane 351372e585 Department of second thoughts: probably still need an IsTransactionState
test in there...
2003-04-27 18:01:46 +00:00
Tom Lane 5f15fa8d06 Clean up some problems in SetClientEncoding: failed to honor doit flag
in all cases, leaked TopMemoryContext memory in others.  Make the
interaction between SetClientEncoding and InitializeClientEncoding
cleaner and better documented.  I suspect these changes should be
back-patched into 7.3, but will wait on Tatsuo's verification.
2003-04-27 17:31:25 +00:00
Tom Lane 3a496c8af0 Repair permissions problem in RI triggers: query parsing has to be done
as the correct user, not only query execution.  Per report from Sean
Chittenden.
2003-04-26 22:21:47 +00:00
Tom Lane 4db9689d1a Add transaction status field to ReadyForQuery messages, and make room
for tableID/columnID in RowDescription.  (The latter isn't really
implemented yet though --- the backend always sends zeroes, and libpq
just throws away the data.)
2003-04-26 20:23:00 +00:00
Tom Lane 2b1e36c7c0 Tweak stats collector start logic so that we will not try to spawn a
new stats collector oftener than once a minute.  Per gripe from Erik Walthinsen
4/25/03.
2003-04-26 02:57:14 +00:00
Tom Lane 9fdb1de3ba Make [VACUUM] ANALYZE safe on zero-column tables. 2003-04-25 21:29:18 +00:00
Tom Lane 9cbaf72177 In the continuing saga of FE/BE protocol revisions, add reporting of
initial values and runtime changes in selected parameters.  This gets
rid of the need for an initial 'select pg_client_encoding()' query in
libpq, bringing us back to one message transmitted in each direction
for a standard connection startup.  To allow server version to be sent
using the same GUC mechanism that handles other parameters, invent the
concept of a never-settable GUC parameter: you can 'show server_version'
but it's not settable by any GUC input source.  Create 'lc_collate' and
'lc_ctype' never-settable parameters so that people can find out these
settings without need for pg_controldata.  (These side ideas were all
discussed some time ago in pgsql-hackers, but not yet implemented.)
2003-04-25 19:45:10 +00:00
Bruce Momjian a2190c9eb6 Prevent unlink/rename Win32 mapping on frontends. 2003-04-25 16:18:40 +00:00
Bruce Momjian 97e2446bf0 Add new versions DLL lists, from Karl Waclawek 2003-04-25 14:20:21 +00:00
Bruce Momjian 7b4aa31007 Fix typo in DLL list. 2003-04-25 14:18:59 +00:00
Tom Lane 3831636645 const-ify info_cb() to match recent openssl releases. Per Joe Conway. 2003-04-25 04:37:23 +00:00
Tom Lane f779a34c16 Fix breakage induced by yours truly in Kerberos and PAM code. 2003-04-25 03:28:55 +00:00
Tom Lane 6687650ce6 COPY and pg_dump failed to cope with zero-column tables. Fix 'em. 2003-04-25 02:28:22 +00:00
Bruce Momjian db7e46a76d Use closesocket() for all socket/pipe closing, because Win32 requires
it, and map that to close() on Unix.
2003-04-25 01:24:00 +00:00
Tom Lane 5f677af2da Adjust subquery qual pushdown rules so that we can push down a qual
into a UNION that has some type coercions applied to the component
queries, so long as the qual itself does not reference any columns that
have such coercions.  Per example from Jonathan Bartlett 24-Apr-03.
2003-04-24 23:43:09 +00:00
Bruce Momjian 555fe9dda8 Add Win32 Makefile for IPC stuff. 2003-04-24 21:25:34 +00:00
Bruce Momjian 4a10ce5db3 No need for include for Win32 right now. 2003-04-24 21:24:36 +00:00
Bruce Momjian 20ead395c7 Add Win32 shmem/sema prototypes. 2003-04-24 21:23:01 +00:00
Tom Lane f690920a75 Infrastructure for upgraded error reporting mechanism. elog.c is
rewritten and the protocol is changed, but most elog calls are still
elog calls.  Also, we need to contemplate mechanisms for controlling
all this functionality --- eg, how much stuff should appear in the
postmaster log?  And what API should libpq expose for it?
2003-04-24 21:16:45 +00:00
Bruce Momjian a91c5be6a4 pgindent new Win32 files. 2003-04-24 18:14:22 +00:00
Bruce Momjian 1a67e4869c Add shared memory and semaphore routines for Win32.
Also update copyright to be ours, with approval from Jan.
2003-04-24 17:20:23 +00:00
Bruce Momjian d670bf378c Add shared memory and semaphore routines for Win32. 2003-04-24 17:16:13 +00:00
Bruce Momjian 3126c78b1a Add comments to replace/unlink Win32 functions. 2003-04-24 16:40:17 +00:00
Bruce Momjian 5dc844b75c Add PQunescapeBytea() and PQfeeMem() to the Win32 DLL list.
Karl Waclawek
2003-04-24 15:09:27 +00:00
Bruce Momjian 52e49e298f Remove Win32 special rename/unlink from libpq. 2003-04-22 19:42:27 +00:00
Tom Lane 8a703496a2 getaddrinfo has no business doing unlink(). 2003-04-22 03:52:56 +00:00
Bruce Momjian 7fc30094c7 Add dirmod to libpq Makefile. 2003-04-22 02:21:34 +00:00
Bruce Momjian b952f0ef9b Add Win32 unlink/rename file. 2003-04-22 02:18:48 +00:00
Bruce Momjian dfc6649c4d Add Win32 versions of unlink and rename --- loop until success. 2003-04-22 02:18:09 +00:00
Tom Lane 5ed27e35f3 Another round of protocol changes. Backend-to-frontend messages now all
have length words.  COPY OUT reimplemented per new protocol: it doesn't
need \. anymore, thank goodness.  COPY BINARY to/from frontend works,
at least as far as the backend is concerned --- libpq's PQgetline API
is not up to snuff, and will have to be replaced with something that is
null-safe.  libpq uses message length words for performance improvement
(no cycles wasted rescanning long messages), but not yet for error
recovery.
2003-04-22 00:08:07 +00:00
Tom Lane ca944bd2d4 Prevent palloc(0) error when parent table has zero columns. 2003-04-21 15:19:55 +00:00
Tom Lane 1dc3a62ec7 stddev() and variance() should return NULL when there is just one input
value, per recent discussion on pgsql-general.
2003-04-21 00:22:24 +00:00
Tom Lane f9ba0a7fe5 Apple's assembler likes the inlined TAS syntax too, so no reason to
maintain a separate out-of-line version of PPC tas() anymore.
Also fix S_UNLOCK for __powerpc64__ platforms.
2003-04-20 21:54:34 +00:00
Tom Lane b5d0051ecf Fix multiple causes of breakage in plperl's error handling. 2003-04-20 21:15:34 +00:00
Tom Lane b40bc9eac6 Avoid O(N^2) behavior with lots of deferred triggers by making
deferredTriggerInvokeEvents only scan events added since it last ran.
Stephan Szabo, some corrections by Tom Lane.
2003-04-20 17:03:25 +00:00
Bruce Momjian c3b7d2d522 Allow \r and \r\n termination for COPY files.
Output \r\n termination on Win32.

Disallow literal carriage return as a data value,
backslash-carriage-return and \r still allowed.

Doc changes already committed.
2003-04-19 20:36:03 +00:00
Bruce Momjian 9c48cae3e4 Add pipe parameter to COPY function to allow proper line termination. 2003-04-19 19:55:37 +00:00
Tom Lane 3df163ad89 Add more documentation about shared memory costs. 2003-04-19 00:37:28 +00:00
Tom Lane bd8d441775 Second round of FE/BE protocol changes. Frontend->backend messages now
have length counts, and COPY IN data is packetized into messages.
2003-04-19 00:02:30 +00:00
Tom Lane 54b38d293e Fix breakage from recent variable-handling changes. 2003-04-18 23:38:47 +00:00
Bruce Momjian 4d4953fc41 Make Win32 tests to match existing Cygwin tests, where appropriate. 2003-04-18 01:03:42 +00:00
Tom Lane cb7fb3ca95 First phase of FE/BE protocol modifications: new StartupPacket layout
with variable-width fields.  No more truncation of long user names.
Also, libpq can now send its environment-variable-driven SET commands
as part of the startup packet, saving round trips to server.
2003-04-17 22:26:02 +00:00
Tom Lane 31845dd363 Fix abstime-to-time cast function, which has had broken implementation
since 7.2, per bug #947.  Turns out it had wrong volatility label, too.
Can't force initdb in 7.3 branch, but fix anyway for future installs.
2003-04-17 04:50:20 +00:00
Barry Lind 0b88b63709 Applied patches from Kris Jurka fixing a string tokenizing problem and
fixing an order by problem for index metadata results.
Also includes removing some unused code as well as a fix to the toString
method on statement.

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-04-17 04:37:07 +00:00
Tom Lane 1719fd55d3 Fix some problems exposed by building outside the source tree. 2003-04-16 05:23:55 +00:00
Tom Lane 1426db5d95 Fix stupid oversight ... 2003-04-16 04:37:58 +00:00
Tom Lane 5ab15591d9 eqjoinsel's logic for case where MCV lists are not present should
account for NULLs; in hindsight this is obvious since the code for
the MCV-lists case would reduce to this when there are zero entries
in both lists.  Per example from Alec Mitchell.
2003-04-15 05:18:12 +00:00
Tom Lane 49c3cf5fd1 path.c needs to be included in libpq; per Joe Conway. 2003-04-14 21:15:13 +00:00
Tom Lane 0851e12244 Reorganize clog's error reporting so that PANIC on clog I/O error can
be reduced to a plain ERROR.  Should make it at least a little less
painful to deal with data-corruption problems.
2003-04-14 17:31:33 +00:00
Bruce Momjian 6bfa2df64e Document file name as optional for \o in psql help (\h). 2003-04-14 16:23:36 +00:00
Dave Cramer 810e0b982b exposed the addDataType method to the PGConnection, allows users to add datatypes 2003-04-14 10:39:51 +00:00
Barry Lind 51acf97235 Applied patch submitted by Nic Ferrier with some cleanups of his previous
patch to add cursor based queries.

 Modified Files:
 	jdbc/org/postgresql/core/BaseConnection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-04-13 04:10:07 +00:00
Tom Lane 3fd5faed5b Second try at avoiding conflicts with system isblank(). 2003-04-13 04:07:17 +00:00
Tom Lane ff5456feae Add code to provide useful dynamic-linking error messages on OS X. 2003-04-13 01:19:06 +00:00
Tom Lane ae02cf3c44 Guard against macro versions of isblank(). 2003-04-12 22:28:33 +00:00
Tatsuo Ishii 35a0995992 Fix encoding conversion function bug.
See following posting for more details.

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

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

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

Jan
2003-04-07 20:30:38 +00:00
Tom Lane afe1185cf0 Remove unnecessary dt2local() call. 2003-04-07 15:04:03 +00:00
Peter Eisentraut cb1d036acb Generate pg_config.h.in by autoheader. Separate out manually editable
parts.  Standardize spelling of comments in pg_config.h.
2003-04-06 22:45:23 +00:00
Bruce Momjian 3a8f67d091 Fix compile problem with Win32 macro used inside another macro. 2003-04-05 19:54:12 +00:00
Bruce Momjian d46e643822 Add Win32 path handling for / vs. \ and drive letters. 2003-04-04 20:42:13 +00:00
Bruce Momjian 9bad936f67 Handle cp, rm, and exec for Win32. 2003-04-04 20:40:45 +00:00
Tom Lane 9c264975d5 Fix some signed-vs-unsigned-int issues; make print_aligned_vertical
safe for zero-column tables.
2003-04-04 15:48:38 +00:00
Tom Lane eb5e4c58d1 Tighten up register usage for inline PPC version of tas(). 2003-04-04 06:57:39 +00:00
Tom Lane cd35d601b8 Put the isync where it's supposed to be. 2003-04-04 05:32:30 +00:00