Commit Graph

12517 Commits

Author SHA1 Message Date
Bruce Momjian d245b6bd9f Document SPI_push() and SPI_pop(). 2004-03-17 01:05:10 +00:00
Tom Lane c1352052ef Replace the switching function ExecEvalExpr() with a macro that jumps
directly to the appropriate per-node execution function, using a function
pointer stored by ExecInitExpr.  This speeds things up by eliminating one
level of function call.  The function-pointer technique also enables further
small improvements such as only making one-time tests once (and then
changing the function pointer).  Overall this seems to gain about 10%
on evaluation of simple expressions, which isn't earthshaking but seems
a worthwhile gain for a relatively small hack.  Per recent discussion
on pghackers.
2004-03-17 01:02:24 +00:00
Bruce Momjian 40f456ce56 Remove double-rename used by Win32 on busy files. Not needed anymore. 2004-03-16 05:05:58 +00:00
Bruce Momjian 8526f537cc The "cvs add" of test_thread_implicit.pgc seems to have been missed,
i've attached this again.

Additionally I include a small patch to remove mutex locking when a
DEFAULT/NULL connection is being retrieved. This is consistent with
libpq.

Lee Kindness
2004-03-15 16:27:43 +00:00
Bruce Momjian bda6e04ba0 Check for EOF on pipe differs under win32, as it is based on a socket
implementation.

Claudio Natoli
2004-03-15 16:21:37 +00:00
Bruce Momjian f744c0f760 float8-small-is-zero and float8-exp-three-digits will likely need
similar changes.

Claudio Natoli
2004-03-15 16:20:52 +00:00
Bruce Momjian 3947f653f9 * postmaster.c: cleanup pmdaemonize under win32; missed failure message
in CreateOptsFile
* s_lock.c: minor comment fix
* findbe.c: variables not used under win32 moved within #ifndef WIN32
case

Claudio Natoli
2004-03-15 16:18:43 +00:00
Bruce Momjian dea47eee06 Windows uses codepages rather than the environment, so we work around
that by querying the environment explicitly first for LC_COLLATE and
LC_CTYPE. We have to do this because initdb passes those values in the
environment. If there is nothing there we fall back on the codepage.

Andrew Dunstan
2004-03-15 16:14:26 +00:00
Bruce Momjian d6b57925ca Remove GUC log_statement, log_pid, log_timestamp, log_source_port.
Functionality superceeded by log_line_prefix.

Andrew Dunstan
2004-03-15 15:56:28 +00:00
Bruce Momjian 6812e95a28 Improve random regression tests to fail less frequently. 2004-03-15 15:46:25 +00:00
Tatsuo Ishii e8c3205037 Add PQmbdsplen() which returns the "display length" of a character.
Still some works needed:
- UTF-8, MULE_INTERNAL always returns 1
2004-03-15 10:41:26 +00:00
Tom Lane 1bc2d544b9 Localize our dependencies on the way to create NAN or INFINITY.
Per recent proposal to pghackers.
2004-03-15 03:29:22 +00:00
Tom Lane 89ab5c4abf Remove grotty special-case code in coerce_to_target_type() that
implemented casts to varchar and bpchar using a cast-to-text function.
This is a holdover from before we had pg_cast; it now makes more sense
to just list these casts in pg_cast.  While at it, add pg_cast entries
for the other direction (casts from varchar/bpchar) where feasible.
2004-03-15 01:13:41 +00:00
Bruce Momjian 64fe1fd239 Update Solaris thread flags, per Jim Seymour 2004-03-14 23:51:48 +00:00
Tom Lane 04226b6404 Tweak planner so that index expressions and predicates are matched to
queries without regard to whether coercions are stated explicitly or
implicitly.  Per suggestion from Stephan Szabo.
2004-03-14 23:41:27 +00:00
Tom Lane e1d08faf04 Fix error in termination of COPY IN mode when using V2 protocol.
Report and fix per ljb, 8-Mar-04.
2004-03-14 22:00:54 +00:00
Bruce Momjian 6e7a0f3550 Mark linux as thread-enabled with new 7.5 tests. 2004-03-14 15:06:13 +00:00
Bruce Momjian 48f3ddf991 Fix ecpg_sqlca_key_destructor to return void. 2004-03-14 14:47:33 +00:00
Bruce Momjian b76c536e2e > (I also see some post-7.4.1 changes in src/template/solaris, so you
> possibly should look there too.)
[snip]
>

I think I have the fix for part of it, but this remains...

    gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
    -Wmissing-declarations -fPIC -I. -I../../../src/include
    -D_POSIX_PTHREAD_SEMANTICS -DFRONTEND
    -DSYSCONFDIR='"/usr/local/pgsql/etc"'  -c -o thread.o thread.c
    thread.c: In function `pqGethostbyname':
    thread.c:189: error: `resbuf' undeclared (first use in this
function)

Looking at src/port/thread.c, line 189, it looks like somebody typo'd.
Looks like that second parameter should be "resultbuf", not "resbuf"?

Jim Seymour
2004-03-14 14:01:43 +00:00
Michael Meskes 757fb0e5a9 - Fixed Informix compat math functions to cope with the situations
where one argument takes the result.
- Applied thread patches by Lee Kindness
2004-03-14 12:16:30 +00:00
Neil Conway 80ac9b06ac Portability fixes and bug fixes for recent floating point input changes.
In particular, don't depend on strtod() to accept 'NaN' and 'Infinity'
inputs (while this is required by C99, not all platforms are compliant
with that yet). Also, don't require glibc's behavior from isinf():
it seems that on a lot of platforms isinf() does not itself distinguish
between negative and positive infinity.
2004-03-14 05:22:52 +00:00
Tom Lane 7665d1bc16 Teach psql to show the location of syntax errors visually, per recent
discussions.  Patch by Fabien Coelho and Tom Lane.  Still needs to be
taught about multi-screen-column kanji characters; Tatsuo has promised
to provide the needed infrastructure for that.
2004-03-14 04:25:18 +00:00
Tom Lane a8a3b54724 Arrange to emit a CONTEXT: SQL function "foo" entry in an error
message that is reporting a prechecking error in a SQL function.
This is to cue client-side code that the syntax error position,
if any, is with respect to the function body and not the outer command.
2004-03-14 01:58:41 +00:00
Tom Lane b88fa3b196 Generate a WARNING when the column types in a foreign key constraint are
incompatible enough to prevent indexscanning the referenced table.  Also,
improve the error message that pops out when we can't implement the FK at
all for lack of a usable equality operator.  Fabien Coelho, with some review
by Tom Lane.
2004-03-13 22:09:14 +00:00
Tom Lane 642cd0ab13 Repair memory leakage introduced into the non-hashed aggregate case by
7.4 rewrite for hashed aggregate support.  If the transition data type
is pass-by-reference, the transValue must be pfreed when starting a new
group boundary, else we have a one-value-per-group leakage.  Thanks to
Rae Steining for providing a reproducible test case.
2004-03-13 00:54:10 +00:00
Dennis Bjorklund 58e351113f Translation updates 2004-03-12 18:32:51 +00:00
Bruce Momjian 73f3ab692d Fixes recent changes to test. For immediate application.
[ Note: int8-exp-three-digits.out needs the same treatment]

Will review recent changes for float4/8 and implications for win32 when
I get a chance.

Claudio Natoli
2004-03-12 14:08:05 +00:00
Dennis Bjorklund 27731fd2fa Translation updates 2004-03-12 12:59:09 +00:00
Dennis Bjorklund 9bcaa8e283 Translation updates 2004-03-12 12:38:36 +00:00
Bruce Momjian 1c89c51b9e Rename incorrect references to nonblock.c to noblock.c. Claudio. 2004-03-12 04:33:41 +00:00
Neil Conway bfd6f52b0e Allow 'Infinity' and '-Infinity' as input to the float4 and float8
types. Update the regression tests and the documentation to reflect
this. Remove the UNSAFE_FLOATS #ifdef.

This is only half the story: we still unconditionally reject
floating point operations that result in +/- infinity. See
recent thread on -hackers for more information.
2004-03-12 00:25:43 +00:00
Dennis Bjorklund fe6e922136 Translation updates 2004-03-11 15:48:57 +00:00
Neil Conway e2ded829f6 Revise int2/int4/int8/float4/float8 input routines to allow for
any amount of leading or trailing whitespace (where "whitespace"
is defined by isspace()). This is for SQL conformance, as well
as consistency with other numeric types (e.g. oid, numeric).

Also refactor pg_atoi() to avoid looking at errno where not
necessary, and add a bunch of regression tests for the input
to these types.
2004-03-11 02:11:14 +00:00
Tatsuo Ishii 0b86ade1c2 Add NOWAIT option to LOCK command 2004-03-11 01:47:41 +00:00
Bruce Momjian 60a068b389 Move non-blocking code into its own /port file, for code clarity. 2004-03-10 21:12:49 +00:00
Peter Eisentraut 3ab5aa02f8 Build scanner output when making a distribution. 2004-03-09 19:47:05 +00:00
Bruce Momjian 8567bb2d06 Corrects a typo, introduces missing variables, and rearranges the
initialization of stats process under EXEC_BACKEND.

[A cleaner, rationalized approach to stat/backend/SSDataBase child
processes under EXEC_BACKEND is on my TODO list. However this patch
takes care of immediate concerns (ie. stats test now passes under
win32)]

Claudio Natoli
2004-03-09 05:11:53 +00:00
Bruce Momjian eeec31774a Determines the PKGLIBDIR equivalent under win32. Requires pgsql lib and
bin directories to be packaged under the same root directory (eg. <some
path>/pgsql/bin and <some path>/pgsql/lib) for the win32 port, which
does not appear to be an onerous restriction.

Claudio Natoli
2004-03-09 05:06:45 +00:00
Bruce Momjian 943eae92fb Add ALSO keyword to CREATE RULE.
Fabien COELHO
2004-03-09 05:05:41 +00:00
Bruce Momjian 53cd7cd8a9 Make a separate win32 debug DLL along with the non-debug version:
Currently, src/interfaces/libpq/win32.mak builds a statically-linked
library "libpq.lib", a debug dll "libpq.dll", import library for the
debug dll "libpqdll.lib", a release dll "libpq.dll", import library for
the release dll "libpqdll.lib".  To avoid naming clashes, I would make
the debug dll and import libraries "libpqd.dll" and "libpqddll.lib".

Basically, the debug build uses the cl flags: "/MDd /D _DEBUG", and the
release build uses the cl flags "/MD /D NDEBUG".  Usually the debug
build has a "D" suffix on the file name, so for example:

libpqd.dll     libpq, debug build
libpqd.lib     libpq, debug build, import library
libpq.dll      libpq, release build
libpq.lib      libpq, release build, import library

David Turner
2004-03-09 04:53:37 +00:00
Bruce Momjian f0f4e82f45 The win32 port backend will require the functionality provided by
canonicalize_path. Patch moves it from initdb.c to port/path.c.

Claudio Natoli
2004-03-09 04:49:02 +00:00
Bruce Momjian 2d3fe86bc4 Add:
#log_line_prefix = ''         # e.g. '<%u%%%d> '
                              # %u=user name %d=database name
                              # %r=remote host and port
                              # %p=PID %t=timestamp %i=command tag
                              # %c=session id %l=session line number
                              # %s=session start timestamp
                              # %x=stop here in non-session processes
                              # %%='%'

Andrew Dunstan
2004-03-09 04:43:07 +00:00
Bruce Momjian 4679e875c0 Add comment about why ON COMMENT in non-current database throws just an
warning.
2004-03-08 21:35:59 +00:00
Tom Lane 7998e8ca6a Test for whether a previous IN join restricts the current join was too
strict, per discussion with Dennis Haney.
Also, rearrange the preceding tests to avoid redundancy.
2004-03-08 17:20:17 +00:00
Tom Lane bc19d6641a When testing usability of a partial index, recognize that an index
predicate of the form 'foo IS NOT NULL' is implied by a WHERE clause
that uses 'foo' in any strict operator or function.  Per suggestion
and preliminary implementation by John Siracusa; some further hacking
by moi.
2004-03-07 05:43:53 +00:00
Bruce Momjian 1973971821 Per a brief conversation with Tom, I've created a patch for adding
support for 'week' within the date_trunc function.

Within the patch I added a couple of test cases and associated target
output, and changed the documentation to add 'week' appropriately.

Robert Creager
2004-03-05 02:41:14 +00:00
Tom Lane 44611f6e6d libpq's query to get the OIDs of large-object support functions was not
schema-safe.  Make it so, and improve the internal support for knowledge
of server version.
2004-03-05 01:53:59 +00:00
Bruce Momjian d91acf8401 Win32:
* Mostly, casting etc to remove compilation warnings in win32 only code.

* main.c: set _IONBF to stdout/stderr under win32 (under win32, _IOLBF
defaults to full buffering)

* pg_resetxlog/Makefile: ensures dirmod.o gets cleaned (got bitten by
this when, after "make clean"ing, switching compilation between Ming +
Cygwin)

Claudio Natoli
2004-03-05 01:11:04 +00:00
Bruce Momjian 65a0db19f4 Add new SPI functions for use by PL/Java:
+extern Oid SPI_getargtypeid(void *plan, int argIndex);
	+extern int SPI_getargcount(void *plan);
	+extern bool SPI_is_cursor_plan(void *plan);

Thomas Hallgren
2004-03-05 00:47:01 +00:00
Bruce Momjian 202cbdca03 Fix log_executor_stats for non-multi queries. Backpatch to 7.4.X. 2004-03-05 00:21:41 +00:00