aboutsummaryrefslogtreecommitdiff
path: root/src/include
Commit message (Collapse)AuthorAge
...
* Here is a patch to make the current snapshot compile on Win32 (native, libpqBruce Momjian2001-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and psql) again. Changes are: 1) psql requires the includes of "io.h" and "fcntl.h" in command.c in order to make a call to open() work (io.h for _open(), fcntl.h for the O_xxx) 2) PG_VERSION is no longer defined in version.h[.in], but in configure.in. Since we don't do configure on native win32, we need to put it in config.h.win32 :-( 3) Added define of SYSCONFDIR to config.h.win32 - libpq won't compile without it. This functionality is *NOT* tested - it's just defined as "" for now. May work, may not. 4) DEF_PGPORT renamed to DEF_PGPORT_STR I have done the "basic tests" on it - it connects to a database, and I can run queries. Haven't tested any of the fancier functions (yet). However, I stepped on a much bigger problem when fixing psql to work. It no longer works when linked against the .DLL version of libpq (which the Makefile does for it). I have left it linked against this version anyway, pending the comments I get on this mail :-) The problem is that there are strings being allocated from libpq.dll using PQExpBuffers (for example, initPQExpBuffer() on line 92 of input.c). These are being allocated using the malloc function used by libpq.dll. This function *may* be different from the malloc function used by psql.exe - only the resulting pointer must be valid. And with the default linking methods, it *WILL* be different. Later, psql.exe tries to free() this string, at which point it crashes because the free() function can't find the allocated block (it's on the allocated blocks list used by the runtime lib of libpq.dll). Shouldn't the right thing to do be to have psql call termPQExpBuffer() on the data instead? As it is now, gets_fromFile() will just return the pointer received from the PQExpBuffer.data (this may well be present at several places - this is the one I was bitten by so far). Isn't that kind of "accessing the internals of the PQExpBuffer structure" wrong? Instead, perhaps it shuold make a copy of the string, adn then termPQExpBuffer() it? In that case, the string will have been allocated from within the same library as the free() is called. I can get it to work just fine by doing this - changing from (around line 100 of input.c): and the same a bit further down in the same function. But, as I said above, this may be at more places in the code? Perhaps someone more familiar to it could comment on that? What do you think shuld be done about this? Personally, I go by the "If you allocate a piece of memory using an interface, use the same interface to free it", but the question is how to make it work :-) Also, AFAIK this only affects psql.exe, so the changes made to the libpq this patch are required no matter how the other issue is handled. Regards, Magnus
* Fix all the places that called heap_update() and heap_delete() withoutTom Lane2001-01-23
| | | | | | | | | | | bothering to check the return value --- which meant that in case the update or delete failed because of a concurrent update, you'd not find out about it, except by observing later that the transaction produced the wrong outcome. There are now subroutines simple_heap_update and simple_heap_delete that should be used anyplace that you're not prepared to do the full nine yards of coping with concurrent updates. In practice, that seems to mean absolutely everywhere but the executor, because *noplace* else was checking.
* Fix some int4->int32.Bruce Momjian2001-01-23
|
* Rename int4 to int32 in a few places.Bruce Momjian2001-01-23
|
* Remove rangechecks on errno; just call strerror unconditionally. ThisTom Lane2001-01-22
| | | | | | | | | eliminates a raft of portability issues, including whether sys_nerr exists, whether the platform has any valid negative errnos, etc. The downside is minimal: errno shouldn't ever contain an invalid value anyway, and if it does, reasonably modern versions of strerror will not choke. This rangecheck idea seemed good at the time, but it's clearly a net loss, and I apologize to all concerned for having ever put it in.
* Clean up lockmanager data structures some more, in preparation for plannedTom Lane2001-01-22
| | | | | | | | | | | rewrite of deadlock checking. Lock holder objects are now reachable from the associated LOCK as well as from the owning PROC. This makes it practical to find all the processes holding a lock, as well as all those waiting on the lock. Also, clean up some of the grottier aspects of the SHMQueue API, and cause the waitProcs list to be stored in the intuitive direction instead of the nonintuitive one. (Bet you didn't know that the code followed the 'prev' link to get to the next waiting process, instead of the 'next' link. It doesn't do that anymore.)
* Clean up per-tuple memory leaks in trigger firing and plpgsqlTom Lane2001-01-22
| | | | expression evaluation.
* All the global memory contexts should be DLLIMPORT, if any are.Tom Lane2001-01-22
|
* Deal with C++ incompatibility of sys_nerr declaration by taking it outTom Lane2001-01-21
| | | | | | | | of c.h altogether, and putting it into the only places that use it (elog.c and exc.c), instead. Modify these routines to check for a NULL or empty-string return from strerror, too, since some platforms define strerror to return empty string for unknown errors (what a useless definition that is ...). Clean up some cruft in ExcPrint while at it.
* Add missing piece of BitString support to node output functions. ExpandPeter Eisentraut2001-01-20
| | | | and remove IsA_Value macro.
* Still further tweaking of s_lock assembler: do not assume that leadingTom Lane2001-01-20
| | | | | | | | whitespace is unimportant in assembly code. Also, move VAX definition of typedef slock_t to port header files to be like all the other ports. Note that netbsd.h and openbsd.h are now identical, and I rather think that freebsd.h is broken in the places where it doesn't agree --- but I'll leave it to the freebsders to look at that.
* From Jason Tishler <jt@dothill.com>Peter Eisentraut2001-01-19
| | | | | | | | | | * doc/FAQ_MSWIN: Update to be consistent with software -- mainly change comment from lack of Cygwin UNIX domain socket support and to list of current Cygwin UNIX domain socket issues. * src/include/config.h.in: Enable UNIX domain sockets for Cygwin. * src/include/port/win.h: Disable UNIX domain sockets for Cygwin b20.1. * src/test/regress/pg_regress.sh: Use UNIX domain sockets for Cygwin instead of TCP/IP.
* Make critical sections (elog->crash) and interrupt holdoff sectionsTom Lane2001-01-19
| | | | into distinct concepts, per recent discussion on pghackers.
* cleanup.Bruce Momjian2001-01-19
|
* Remove ; and add \n to ASM code.Bruce Momjian2001-01-19
|
* Fix alignmentBruce Momjian2001-01-19
|
* Fix univel asm alignmentBruce Momjian2001-01-19
|
* Add __volatile__ to all __asm__ and make consistent indentingBruce Momjian2001-01-19
|
* New ASM format:Bruce Momjian2001-01-19
| | | | | | | | | | | | | | /* * Standard __asm__ format: * * __asm__( * "command;" * "command;" * "command;" * : "=r"(_res) return value, in register * : "r"(lock) argument, 'lock pointer', in register * : "r0"); inline code uses this register */
* Fix VAX ASM '1 f' -> '1f'.Bruce Momjian2001-01-18
|
* Fix up "Postgres-style" time interval representation when fields haveThomas G. Lockhart2001-01-18
| | | | | | | | | | mixed-signs. Previous effort left way too many minus signs, and was at least as broken as the one before that :( Clean up "ISO-style" time interval representation to omit zero fields if there is at least one non-zero field. Supress some leading plus signs when not necessary for clarity. Replace every #ifdef __CYGWIN__ block with a cleaner TIMEZONE_GLOBAL macro defined in datetime.h.
* Move structure comments from the top block down to the line entries forBruce Momjian2001-01-17
| | | | this file to match all the other files, and to be clearer.
* Oops, I had managed to break query-cancel-while-waiting-for-lock.Tom Lane2001-01-16
|
* Rename fields of lock and lockholder structures to something a tad lessTom Lane2001-01-16
| | | | confusing, and clean up documentation.
* pg_database's datpath column must not be marked toastable, becauseTom Lane2001-01-14
| | | | | | | | GetRawDatabaseInfo() won't cope with a compressed path spec (much less a moved-off one). I'm not going to force an initdb for this change, because it's noncritical --- we're not actually using datpath at all right now. But it seems a good idea to apply the fix while I'm thinking about it.
* Restructure backend SIGINT/SIGTERM handling so that 'die' interruptsTom Lane2001-01-14
| | | | | | | are treated more like 'cancel' interrupts: the signal handler sets a flag that is examined at well-defined spots, rather than trying to cope with an interrupt that might happen anywhere. See pghackers discussion of 1/12/01.
* Add more critical-section calls: all code sections that hold spinlocksTom Lane2001-01-12
| | | | | | | | | | | are now critical sections, so as to ensure die() won't interrupt us while we are munging shared-memory data structures. Avoid insecure intermediate states in some code that proc_exit will call, like palloc/pfree. Rename START/END_CRIT_CODE to START/END_CRIT_SECTION, since that seems to be what people tend to call them anyway, and make them be called with () like a function call, in hopes of not confusing pg_indent. I doubt that this is sufficient to make SIGTERM safe anywhere; there's just too much code that could get invoked during proc_exit().
* Add DLLIMPORT to TransactionCommandContext.Peter Eisentraut2001-01-11
|
* Add configure check for sys_nerr, to end all discussions.Peter Eisentraut2001-01-09
|
* The KAME files md5.* and sha1.* have the following changelogBruce Momjian2001-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | entry: ---------------------------- revision 1.2 date: 2000/12/04 01:20:38; author: tgl; state: Exp; lines: +18 -18 Eliminate some of the more blatant platform-dependencies ... it builds here now, anyway ... ---------------------------- Which basically changes u_int*_t -> uint*_t, so now it does not compile neither under Debian 2.2 nor under NetBSD 1.5 which is platform independent<B8> all right. Also it replaces $KAME$ with $Id$ which is Bad Thing. PostgreSQL Id should be added as a separate line so the file history could be seen. So here is patch: * changes uint*_t -> uint*. I guess that was the original intention * adds uint64 type to include/c.h because its needed [somebody should check if I did it right] * adds back KAME Id, because KAME is the master repository * removes stupid c++ comments in pgcrypto.c * removes <sys/types.h> from the code, its not needed -- marko Marko Kreen
* Fix oversight in planning of GROUP queries: when an expression is usedTom Lane2001-01-09
| | | | | | | | as both a GROUP BY item and an output expression, the top-level Group node should just copy up the evaluated expression value from its input, rather than re-evaluating the expression. Aside from any performance benefit this might offer, this avoids a crash when there is a sub-SELECT in said expression.
* Fix small but critical typo ...Tom Lane2001-01-09
|
* Fix recent breakage of query-cancel logic, see my pghackers messageTom Lane2001-01-07
| | | | of 6 Jan 2001 21:55.
* Modify readfuncs so that recursive use of stringToNode will not crashTom Lane2001-01-07
| | | | | | | | and burn. Just for added luck, change reading of CONST nodes so that we do not need to consult pg_type rows while reading them; this means that no database access occurs during stringToNode. This requires changing the order in which const-node fields are written, which means an initdb is forced.
* Rename and document some invalidation routines to make it clearer thatTom Lane2001-01-05
| | | | | they don't themselves flush any cache entries, only add to to-do lists that will be processed later.
* Remove not-really-standard implementation of CREATE TABLE's UNDER clause,Tom Lane2001-01-05
| | | | | | | | | | | and revert documentation to describe the existing INHERITS clause instead, per recent discussion in pghackers. Also fix implementation of SQL_inheritance SET variable: it is not cool to look at this var during the initial parsing phase, only during parse_analyze(). See recent bug report concerning misinterpretation of date constants just after a SET TIMEZONE command. gram.y really has to be an invariant transformation of the query string to a raw parsetree; anything that can vary with time must be done during parse analysis.
* Clean up non-reentrant interface for hash_seq/HashTableWalk, so thatTom Lane2001-01-02
| | | | | | | | starting a new hashtable search no longer clobbers any other search active anywhere in the system. Fix RelationCacheInvalidate() so that it will not crash or go into an infinite loop if invoked recursively, as for example by a second SI Reset message arriving while we are still processing a prior one.
* Mark geometric 'overlaps' operators (&&) as self-commutative.Tom Lane2000-12-31
|
* NetBSD/Alpha porting fixes from tom@minnesota.com.Tom Lane2000-12-31
|
* 1. WAL needs in zero-ed content of newly initialized page.Vadim B. Mikheev2000-12-30
| | | | | 2. Log record for PageRepaireFragmentation now keeps array of !LP_USED offnums to redo cleanup properly.
* Clean up spinlock assembly code slightly (just cosmetic improvements)Tom Lane2000-12-30
| | | | | | | | | for Alpha gcc case. For Alpha non-gcc case, replace use of __INTERLOCKED_TESTBITSS_QUAD builtin with __LOCK_LONG_RETRY and __UNLOCK_LONG. The former does not execute an MB instruction and therefore was guaranteed not to work on multiprocessor machines. The LOCK_LONG builtins produce code that is the same in all essential details as the gcc assembler code.
* Fix failure in CreateCheckPoint on some Alpha boxes --- it's not OK toTom Lane2000-12-29
| | | | | | | assume that TAS() will always succeed the first time, even if the lock is known to be free. Also, make sure that code will eventually time out and report a stuck spinlock, rather than looping forever. Small cleanups in s_lock.h, too.
* New WAL version - CRC and data blocks backup.Vadim B. Mikheev2000-12-28
|
* Fix portability problems recently exposed by regression tests on Alphas.Tom Lane2000-12-27
| | | | | | | | | | 1. Distinguish cases where a Datum representing a tuple datatype is an OID from cases where it is a pointer to TupleTableSlot, and make sure we use the right typlen in each case. 2. Make fetchatt() and related code support 8-byte by-value datatypes on machines where Datum is 8 bytes. Centralize knowledge of the available by-value datatype sizes in two macros in tupmacs.h, so that this will be easier if we ever have to do it again.
* Improve comments.Tom Lane2000-12-23
|
* Small cleanup of temp-table handling. Disallow creation of a non-tempTom Lane2000-12-22
| | | | | | | table that inherits from a temp table. Make sure the right things happen if one creates a temp table, creates another temp that inherits from it, then renames the first one. (Previously, system would end up trying to delete the temp tables in the wrong order.)
* Repair not-too-well-thought-out code to do rangechecking of OIDs onTom Lane2000-12-22
| | | | 64-bit machines. Also, make oidvectorin use the same code as oidin.
* Change default output formatting for CIDR to be unabbreviated, perTom Lane2000-12-22
| | | | | | recommendation from Paul Vixie. Add a new abbrev() function to produce abbreviated format as text. No forced initdb, but new function is not available unless you do an initdb or add the pg_proc row manually.
* Revise lock manager to support "session level" locks as well as "transactionTom Lane2000-12-22
| | | | | | | | | | | | | | | | level" locks. A session lock is not released at transaction commit (but it is released on transaction abort, to ensure recovery after an elog(ERROR)). In VACUUM, use a session lock to protect the master table while vacuuming a TOAST table, so that the TOAST table can be done in an independent transaction. I also took this opportunity to do some cleanup and renaming in the lock code. The previously noted bug in ProcLockWakeup, that it couldn't wake up any waiters beyond the first non-wakeable waiter, is now fixed. Also found a previously unknown bug of the same kind (failure to scan all members of a lock queue in some cases) in DeadLockCheck. This might have led to failure to detect a deadlock condition, resulting in indefinite waits, but it's difficult to characterize the conditions required to trigger a failure.
* Repair round(numeric) function. An initdb would be required to get thePeter Eisentraut2000-12-21
| | | | fixed version, otherwise you'll continue to encounter breakage.