summaryrefslogtreecommitdiff
path: root/src/include
AgeCommit message (Collapse)Author
2004-04-30Enable use of our own timezone library for Win32.Bruce Momjian
2004-04-30Minor adjustments to enable public-domain timezone library to be calledBruce Momjian
from our code.
2004-04-26Please find a attached a small patch that adds accessor functionsBruce Momjian
for "aclitem" so that it is not an opaque datatype. I needed these functions to browse aclitems from user land. I can load them when necessary, but it seems to me that these accessors for a backend type belong to the backend, so I submit them. Fabien Coelho
2004-04-25Tiny assorted fixes: correct a typo in a comment in vacuumlazy.c, removeNeil Conway
some unused #include directives from bufmgr.c, and clarify comments in bufmgr.h and buf.h
2004-04-25Remove the last traces of Joe Hellerstein's "xfunc" optimization. PatchNeil Conway
from Alvaro Herrera. Also, removed lispsort.c, since it is no longer used.
2004-04-23Add ceiling() as an alias for ceil(), and power() as an alias for pow().Neil Conway
Regression tests and documentation have both been updated. SQL2003 requires that both ceiling() and ceil() be present, so I have documented both spellings. SQL2003 doesn't mention pow() as far as I can see, so I decided to replace pow() with power() in the documentation: there is little reason to encourage the continued usage of a function that isn't compliant with the standard, given a standard-compliant alternative. RELEASE NOTES: should state that pow() is considered deprecated (although I don't see the need to ever remove it.)
2004-04-23Add new auto-detection of thread flags.Bruce Momjian
Allow additional thread flags to be added via port templates. Change thread flag names to PTHREAD_CFLAGS and PTHREAD_LIBS to match new configure script.
2004-04-22Make LocalRefCount and PrivateRefCount arrays of int32, rather than long.Neil Conway
This saves a small amount of per-backend memory for LP64 machines.
2004-04-22Per discussion earlier today, here is a fix that lets ereport() on win32Bruce Momjian
report socket errors. Magnus Hagander
2004-04-22This patch makes the EXECUTE command's completion tag return theBruce Momjian
completion tag of the actual statement executed. This allows the correct update count to be returned for UPDATE/INSERT/DELETE statements. Kris Jurka
2004-04-21Tweak indexscan and seqscan code to arrange that steps from one page toTom Lane
the next are handled by ReleaseAndReadBuffer rather than separate ReleaseBuffer and ReadBuffer calls. This cuts the number of acquisitions of the BufMgrLock by a factor of 2 (possibly more, if an indexscan happens to pull successive rows from the same heap page). Unfortunately this doesn't seem enough to get us out of the recently discussed context-switch storm problem, but it's surely worth doing anyway.
2004-04-21Another round of code cleanup on bufmgr. Use BM_VALID flag to keep trackTom Lane
of whether we have successfully read data into a buffer; this makes the error behavior a bit more transparent (IMHO anyway), and also makes it work correctly for local buffers which don't use Start/TerminateBufferIO. Collapse three separate functions for writing a shared buffer into one. This overlaps a bit with cleanups that Neil proposed awhile back, but seems not to have committed yet.
2004-04-19Code review for ARC patch. Eliminate static variables, improve handlingTom Lane
of VACUUM cases so that VACUUM requests don't affect the ARC state at all, avoid corner case where BufferSync would uselessly rewrite a buffer that no longer contains the page that was to be flushed. Make some minor other cleanups in and around the bufmgr as well, such as moving PinBuffer and UnpinBuffer into bufmgr.c where they really belong.
2004-04-19* Most changes are to fix warnings issued when compiling win32Bruce Momjian
* removed a few redundant defines * get_user_name safe under win32 * rationalized pipe read EOF for win32 (UPDATED PATCH USED) * changed all backend instances of sleep() to pg_usleep - except for the SLEEP_ON_ASSERT in assert.c, as it would exceed a 32-bit long [Note to patcher: If a SLEEP_ON_ASSERT of 2000 seconds is acceptable, please replace with pg_usleep(2000000000L)] I added a comment to that part of the code: /* * It would be nice to use pg_usleep() here, but only does 2000 sec * or 33 minutes, which seems too short. */ sleep(1000000); Claudio Natoli
2004-04-18Tweak findTargetlistEntry so that bare names occurring in GROUP BY clausesTom Lane
are sought first as local FROM columns, then as local SELECT-list aliases, and finally as outer FROM columns; the former behavior made outer FROM columns take precedence over aliases. This does not change spec conformance because SQL99 allows only the first case anyway, and it seems more useful and self-consistent. Per gripe from Dennis Bjorklund 2004-04-05.
2004-04-12Here's an attempt at new socket and signal code for win32.Bruce Momjian
It works on the principle of turning sockets into non-blocking, and then emulate blocking behaviour on top of that, while allowing signals to run. Signals are now implemented using an event instead of APCs, thus getting rid of the issue of APCs not being compatible with "old style" sockets functions. It also moves the win32 specific code away from pqsignal.h/c into port/win32, and also removes the "thread style workaround" of the APC issue previously in place. In order to make things work, a few things are also changed in pgstat.c: 1) There is now a separate pipe to the collector and the bufferer. This is required because the pipe will otherwise only be signalled in one of the processes when the postmaster goes down. The MS winsock code for select() must have some kind of workaround for this behaviour, but I have found no stable way of doing that. You really are not supposed to use the same socket from more than one process (unless you use WSADuplicateSocket(), in which case the docs specifically say that only one will be flagged). 2) The check for "postmaster death" is moved into a separate select() call after the main loop. The previous behaviour select():ed on the postmaster pipe, while later explicitly saying "we do NOT check for postmaster exit inside the loop". The issue was that the code relies on the same select() call seeing both the postmaster pipe *and* the pgstat pipe go away. This does not always happen, and it appears that useing WSAEventSelect() makes it even more common that it does not. Since it's only called when the process exits, I don't think using a separate select() call will have any significant impact on how the stats collector works. Magnus Hagander
2004-04-11Exit backend from SIGTERM or FATAL by simulating client EOF, rather thanBruce Momjian
calling proc_exit() directly. This should make SIGTERM more reliable.
2004-04-07Extend set-operation planning to keep track of the sort ordering inducedTom Lane
by the set operation, so that redundant sorts at higher levels can be avoided. This was foreseen a good while back, but not done. Per request from Karel Zak.
2004-04-07> >>1. change the type of "log_statement" option from boolean to string,Bruce Momjian
> >>with allowed values of "all, mod, ddl, none" with default "none". OK, here is a patch that implements #1. Here is sample output: test=> set client_min_messages = 'log'; SET test=> set log_statement = 'mod'; SET test=> select 1; ?column? ---------- 1 (1 row) test=> update test set x=1; LOG: statement: update test set x=1; ERROR: relation "test" does not exist test=> update test set x=1; LOG: statement: update test set x=1; ERROR: relation "test" does not exist test=> copy test from '/tmp/x'; LOG: statement: copy test from '/tmp/x'; ERROR: relation "test" does not exist test=> copy test to '/tmp/x'; ERROR: relation "test" does not exist test=> prepare xx as select 1; PREPARE test=> prepare xx as update x set y=1; LOG: statement: prepare xx as update x set y=1; ERROR: relation "x" does not exist test=> explain analyze select 1;; QUERY PLAN ------------------------------------------------------------------------------------ Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.006..0.007 rows=1 loops=1) Total runtime: 0.046 ms (2 rows) test=> explain analyze update test set x=1; LOG: statement: explain analyze update test set x=1; ERROR: relation "test" does not exist test=> explain update test set x=1; ERROR: relation "test" does not exist It checks PREPARE and EXECUTE ANALYZE too. The log_statement values are 'none', 'mod', 'ddl', and 'all'. For 'all', it prints before the query is parsed, and for ddl/mod, it does it right after parsing using the node tag (or command tag for CREATE/ALTER/DROP), so any non-parse errors will print after the log line.
2004-04-05Corrects issues recently posted by Dann Corbit, allowing libpq/psql toBruce Momjian
be built under VC++. Moves a pgstat win32 #def to port.h Claudio Natoli
2004-04-05This is a cleanup patch for access/transam/xact.c. It only removes someBruce Momjian
#ifdef NOT_USED code, and adds a new TBLOCK state which signals the fact that StartTransaction() has been executed. Alvaro Herrera
2004-04-05Remove 'syslog' GUC variable, and add more logical 'log_destination'Bruce Momjian
variable to control logoutput location on Unix and Win32. Magnus Hagander
2004-04-02check_sql_fn_retval has always thought that we supported doingTom Lane
'SELECT foo()' in a SQL function returning a rowtype, to simply pass back the results of another function returning the same rowtype. However, that hasn't actually worked in many years. Now it works again.
2004-04-02Get rid of crocky use of RangeVar nodes in parser to represent partiallyTom Lane
transformed whole-row variables. Cleaner to use regular whole-row Vars.
2004-04-01Replace TupleTableSlot convention for whole-row variables and functionTom Lane
results with tuples as ordinary varlena Datums. This commit does not in itself do much for us, except eliminate the horrid memory leak associated with evaluation of whole-row variables. However, it lays the groundwork for allowing composite types as table columns, and perhaps some other useful features as well. Per my proposal of a few days ago.
2004-03-30Cleanup vectors of GISTENTRY and eliminate problem with 64-bit strict-alignedTeodor Sigaev
boxes. Change interface to user-defined GiST support methods union and picksplit. Now instead of bytea struct it used special GistEntryVector structure.
2004-03-24Replace max_expr_depth parameter with a max_stack_depth parameter thatTom Lane
is measured in kilobytes and checked against actual physical execution stack depth, as per my proposal of 30-Dec. This gives us a fairly bulletproof defense against crashing due to runaway recursive functions.
2004-03-24Allow unlink/rename of files open by another process on Win32, using aBruce Momjian
special Win32 open flag FILE_SHARE_DELETE. Claudio Natoli
2004-03-23Upgrade ALTER TABLE DROP COLUMN so that it can drop an OID column, andTom Lane
remove separate implementation of ALTER TABLE SET WITHOUT OIDS in favor of doing a regular DROP. Also, cause CREATE TABLE to account completely correctly for the inheritance status of the OID column. This fixes problems with dropping OID columns that have dependencies, as noted by Christopher Kings-Lynne, as well as making sure that you can't drop an OID column that was inherited from a parent.
2004-03-23Replace the virtual_host and tcpip_socket parameters with a unifiedTom Lane
listen_addresses parameter, as per recent discussion. The default behavior is now to listen on localhost, which eliminates the need for the -i postmaster switch in many scenarios. Andrew Dunstan
2004-03-22Add timestamp-versus-timestamptz cross-type comparison functions,Tom Lane
flesh out the index operator classes to include these. In passing, fix erroneous volatility marking of ACL functions.
2004-03-21Revise syntax-error reporting behavior to give pleasant results forTom Lane
errors in internally-generated queries, such as those submitted by plpgsql functions. Per recent discussions with Fabien Coelho.
2004-03-20Handle draft version of getpwuid_r() that accepts only four arguments.Bruce Momjian
Backpatch to 7.4.X. Required for Solaris 7 & 8.
2004-03-19Create a validator for plpgsql, so that some minimal syntax checkingTom Lane
is done at creation time for plpgsql functions. Improve createlang and droplang to support adding/dropping validators for PLs. Initial steps towards producing a syntax error position from plpgsql syntax errors (this part is a work in progress, and will change depending on outcome of current discussions).
2004-03-19Code review for log_line_prefix patch. Cooperate with StringInfo insteadTom Lane
of fighting it, avoid hard-wired (and wrong) assumption about max length of prefix, cause %l to actually work as documented, don't compute data we may not need.
2004-03-17Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... ENDTom Lane
so that the 'val' is computed only once, per recent discussion. The speedup is not much when 'val' is just a simple variable, but could be significant for larger expressions. More importantly this avoids issues with multiple evaluations of a volatile 'val', and it allows the CASE expression to be reverse-listed in its original form by ruleutils.c.
2004-03-17Document SPI_push() and SPI_pop().Bruce Momjian
2004-03-17Replace the switching function ExecEvalExpr() with a macro that jumpsTom Lane
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-15Remove GUC log_statement, log_pid, log_timestamp, log_source_port.Bruce Momjian
Functionality superceeded by log_line_prefix. Andrew Dunstan
2004-03-15Add PQmbdsplen() which returns the "display length" of a character.Tatsuo Ishii
Still some works needed: - UTF-8, MULE_INTERNAL always returns 1
2004-03-15Localize our dependencies on the way to create NAN or INFINITY.Tom Lane
Per recent proposal to pghackers.
2004-03-15Remove grotty special-case code in coerce_to_target_type() thatTom Lane
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-14Tweak planner so that index expressions and predicates are matched toTom Lane
queries without regard to whether coercions are stated explicitly or implicitly. Per suggestion from Stephan Szabo.
2004-03-12Allow 'Infinity' and '-Infinity' as input to the float4 and float8Neil Conway
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-11Add NOWAIT option to LOCK commandTatsuo Ishii
2004-03-10Move non-blocking code into its own /port file, for code clarity.Bruce Momjian
2004-03-09Corrects a typo, introduces missing variables, and rearranges theBruce Momjian
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-09The win32 port backend will require the functionality provided byBruce Momjian
canonicalize_path. Patch moves it from initdb.c to port/path.c. Claudio Natoli
2004-03-09Add:Bruce Momjian
#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-05Add new SPI functions for use by PL/Java:Bruce Momjian
+extern Oid SPI_getargtypeid(void *plan, int argIndex); +extern int SPI_getargcount(void *plan); +extern bool SPI_is_cursor_plan(void *plan); Thomas Hallgren