aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
Commit message (Collapse)AuthorAge
...
* Use better named loop variable for large loop, rather than 'i'.Bruce Momjian2006-08-06
|
* Improve logging of protocol-level prepared statements.Bruce Momjian2006-08-04
|
* Adjust initialization sequence for timezone_abbreviations so thatTom Lane2006-07-29
| | | | | | | | | it's handled just about like timezone; in particular, don't try to read anything during InitializeGUCOptions. Should solve current startup failure on Windows, and avoid wasted cycles if a nondefault setting is specified in postgresql.conf too. Possibly we need to think about a more general solution for handling 'expensive to set' GUC options.
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-14
|
* Allow include files to compile own their own.Bruce Momjian2006-07-13
| | | | | | | Strip unused include files out unused include files, and add needed includes to C files. The next step is to remove unused include files in C files.
* Add GUC update_process_title to control whether 'ps' display is updatedBruce Momjian2006-06-27
| | | | for every command, default to on.
* Remove redundant gettimeofday() calls to the extent practical withoutTom Lane2006-06-20
| | | | | | | | | | | changing semantics too much. statement_timestamp is now set immediately upon receipt of a client command message, and the various places that used to do their own gettimeofday() calls to mark command startup are referenced to that instead. I have also made stats_command_string use that same value for pg_stat_activity.query_start for both the command itself and its eventual replacement by <IDLE> or <idle in transaction>. There was some debate about that, but no argument that seemed convincing enough to justify an extra gettimeofday() call.
* Merge postmaster and postgres command into just postgres. postmasterPeter Eisentraut2006-06-18
| | | | | symlink is kept for now for compatibility. To call single-user mode, use postgres --single.
* Fix Assert failure when a fastpath function call is attempted inside anTom Lane2006-06-11
| | | | | | | | | | | | | | | already-aborted transaction block. GetSnapshotData throws an Assert if not in a valid transaction; hence we mustn't attempt to set a snapshot for the function until after checking for aborted transaction. This is harmless AFAICT if Asserts aren't enabled (GetSnapshotData will compute a bogus snapshot, but it doesn't matter since HandleFunctionRequest will throw an error shortly anywy). Hence, not a major bug. Along the way, add some ability to log fastpath calls when statement logging is turned on. This could probably stand to be improved further, but not logging anything is clearly undesirable. Backpatched as far as 8.0; bug doesn't exist before that.
* Add statement_timestamp(), clock_timestamp(), andBruce Momjian2006-04-25
| | | | | | | | | transaction_timestamp() (just like now()). Also update statement_timeout() to mention it is statement arrival time that is measured. Catalog version updated.
* Simplify ParamListInfo data structure to support only numbered parameters,Tom Lane2006-04-22
| | | | | | | not named ones, and replace linear searches of the list with array indexing. The named-parameter support has been dead code for many years anyway, and recent profiling suggests that the searching was costing a noticeable amount of performance for complex queries.
* Document that errors are not output by log_statement (was they were inBruce Momjian2006-04-18
| | | | | | | | | 8.0), and add as suggestion to use log_min_error_statement for this purpose. I also fixed the code so the first EXECUTE has it's prepare, rather than the last which is what was in the current code. Also remove "protocol" prefix for SQL EXECUTE output because it is not accurate. Backpatch to 8.1.X.
* Modify all callers of datatype input and receive functions so that if theseTom Lane2006-04-04
| | | | | | | | | | | | | | | functions are not strict, they will be called (passing a NULL first parameter) during any attempt to input a NULL value of their datatype. Currently, all our input functions are strict and so this commit does not change any behavior. However, this will make it possible to build domain input functions that centralize checking of domain constraints, thereby closing numerous holes in our domain support, as per previous discussion. While at it, I took the opportunity to introduce convenience functions InputFunctionCall, OutputFunctionCall, etc to use in code that calls I/O functions. This eliminates a lot of grotty-looking casts, but the main motivation is to make it easier to grep for these places if we ever need to touch them again.
* Improve parser so that we can show an error cursor position for errorsTom Lane2006-03-14
| | | | | | | | | | | during parse analysis, not only errors detected in the flex/bison stages. This is per my earlier proposal. This commit includes all the basic infrastructure, but locations are only tracked and reported for errors involving column references, function calls, and operators. More could be done later but this seems like a good set to start with. I've also moved the ReportSyntaxErrorPosition logic out of psql and into libpq, which should make it available to more people --- even within psql this is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Fix typo in comment.Neil Conway2006-02-17
|
* Add a new system view, pg_cursors, that displays the currently availableNeil Conway2006-01-18
| | | | | | | | | | | | | | | | | | | | | cursors. Patch from Joachim Wieland, review and ediorialization by Neil Conway. The view lists cursors defined by DECLARE CURSOR, using SPI, or via the Bind message of the frontend/backend protocol. This means the view does not list the unnamed portal or the portal created to implement EXECUTE. Because we do list SPI portals, there might be more rows in this view than you might expect if you are using SPI implicitly (e.g. via a procedural language). Per recent discussion on -hackers, the query string included in the view for cursors defined by DECLARE CURSOR is based on debug_query_string. That means it is not accurate if multiple queries separated by semicolons are submitted as one query string. However, there doesn't seem a trivial fix for that: debug_query_string is better than nothing. I also changed SPI_cursor_open() to include the source text for the portal it creates: AFAICS there is no reason not to do this. Update the documentation and regression tests, bump the catversion.
* Add a new system view, pg_prepared_statements, that can be used toNeil Conway2006-01-08
| | | | | | | | | | | | | | | | access information about the prepared statements that are available in the current session. Original patch from Joachim Wieland, various improvements by Neil Conway. The "statement" column of the view contains the literal query string sent by the client, without any rewriting or pretty printing. This means that prepared statements created via SQL will be prefixed with "PREPARE ... AS ", whereas those prepared via the FE/BE protocol will not. That is unfortunate, but discussion on -patches did not yield an efficient way to improve this, and there is some merit in returning exactly what the client sent to the backend. Catalog version bumped, regression tests updated.
* Make all command-line options of postmaster and postgres the same. SeePeter Eisentraut2006-01-05
| | | | | http://archives.postgresql.org/pgsql-hackers/2006-01/msg00151.php for the complete plan.
* Remove BEOS port.Bruce Momjian2006-01-05
|
* Rearrange backend startup sequence so that ShmemIndexLock can becomeTom Lane2006-01-04
| | | | | | an LWLock instead of a spinlock. This hardly matters on Unix machines but should improve startup performance on Windows (or any port using EXEC_BACKEND). Per previous discussion.
* Prefix client-side prepare with '[protocol]' rather than '[client]'.Bruce Momjian2005-12-31
|
* Rename send_rfq to send_ready_for_query.Bruce Momjian2005-12-30
|
* Mmark client-side prepare/bind/execute statements with "[client]" soBruce Momjian2005-12-30
| | | | they can be easily distinguished from SQL commands.
* Defend against crash while processing Describe Statement or Describe PortalTom Lane2005-12-14
| | | | | | messages, when client attempts to execute these outside a transaction (start one) or in a failed transaction (reject message, except for COMMIT/ROLLBACK statements which we can handle). Per report from Francisco Figueiredo Jr.
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* When in transaction-aborted state, reject Bind message for portals containingTom Lane2005-11-10
| | | | | | | | | | anything but transaction-exiting commands (ROLLBACK etc). We already rejected Parse and Execute in such cases, so there seems little point in allowing Bind. This prevents at least an Assert failure, and probably worse things, since there's a lot of infrastructure that doesn't work when not in a live transaction. We can also simplify the Bind logic a bit by rejecting messages with a nonzero number of parameters, instead of the former kluge to silently substitute NULL for each parameter. Per bug #2033 from Joel Stevenson.
* Rename the members of CommandDest enum so they don't collide with other uses ofAlvaro Herrera2005-11-03
| | | | | those names. (Debug and None were pretty bad names anyway.) I hope I catched all uses of the names in comments too.
* Postpone pg_timezone_initialize() until after creation of postmaster.pid,Tom Lane2005-10-20
| | | | | | | since it can take a fair amount of time and this can confuse boot scripts that expect postmaster.pid to appear quickly. Move initialization of SSL library and preloaded libraries to after that point, too, just for luck. Per reports from Tony Caduto and others.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Make stack_base_ptr non-static, for PL/Java.Bruce Momjian2005-10-13
|
* Code cleanup for log_disconnections(). Patch from Qingqing Zhou,Neil Conway2005-10-05
| | | | fixes by Neil Conway.
* Log protocol-excute fetch operatation as fetch, rather than execute,Bruce Momjian2005-09-26
| | | | adjusted from a patch by Simon.
* Suppress signed-vs-unsigned-char warnings.Tom Lane2005-09-24
|
* Suppress port number for unix domain sockets in log connect/disconnectBruce Momjian2005-09-22
| | | | messages.
* Print proper cause of statement cancel, user interaction or timeout.Bruce Momjian2005-09-19
|
* Update query cancel message:Bruce Momjian2005-09-16
| | | | errmsg("canceling query due to user request or statement timeout")));
* Add log display label for unnamed server-side portals.Bruce Momjian2005-09-02
|
* Autovacuum loose end mop-up. Provide autovacuum-specific vacuum costTom Lane2005-08-11
| | | | | | | delay and limit, both as global GUCs and as table-specific entries in pg_autovacuum. stats_reset_on_server_start is now OFF by default, but a reset is forced if we did WAL replay. XID-wrap vacuums do not ANALYZE, but do FREEZE if it's a template database. Alvaro Herrera
* Cause ShutdownPostgres to do a normal transaction abort during backendTom Lane2005-08-08
| | | | | | | | exit, instead of trying to take shortcuts. Introduce some additional shutdown callback routines to eliminate kluges like having ProcKill be responsible for shutting down the buffer manager. Ensure that the order of operations during shutdown is predictable and what you would expect given the module layering.
* Add time/date macros for code clarity:Bruce Momjian2005-07-21
| | | | | | | #define DAYS_PER_YEAR 365.25 #define MONTHS_PER_YEAR 12 #define DAYS_PER_MONTH 30 #define HOURS_PER_DAY 24
* Integrate autovacuum functionality into the backend. There's still aTom Lane2005-07-14
| | | | | few loose ends to be dealt with, but it seems to work. Alvaro Herrera, based on the contrib code by Matthew O'Connor.
* Change typreceive function API so that receive functions get the sameTom Lane2005-07-10
| | | | | | | optional arguments as text input functions, ie, typioparam OID and atttypmod. Make all the datatypes that use typmod enforce it the same way in typreceive as they do in typinput. This fixes a problem with failure to enforce length restrictions during COPY FROM BINARY.
* Arrange for the postmaster (and standalone backends, initdb, etc) toTom Lane2005-07-04
| | | | | | | | chdir into PGDATA and subsequently use relative paths instead of absolute paths to access all files under PGDATA. This seems to give a small performance improvement, and it should make the system more robust against naive DBAs doing things like moving a database directory that has a live postmaster in it. Per recent discussion.
* Clean up the rather historically encumbered interface to now() andTom Lane2005-06-29
| | | | | | | | current time: provide a GetCurrentTimestamp() function that returns current time in the form of a TimestampTz, instead of separate time_t and microseconds fields. This is what all the callers really want anyway, and it eliminates low-level dependencies on AbsoluteTime, which is a deprecated datatype that will have to disappear eventually.
* Fix the mechanism for reporting the original table OID and column numberTom Lane2005-06-22
| | | | | of columns of a query result so that it can "see through" cursors and prepared statements. Per gripe a couple months back from John DeSoi.
* Two-phase commit. Original patch by Heikki Linnakangas, with additionalTom Lane2005-06-17
| | | | hacking by Alvaro Herrera and Tom Lane.
* Add pg_postmaster_start_time() function.Bruce Momjian2005-06-14
| | | | | Euler Taveira de Oliveira Matthias Schmidt
* Revise handling of dropped columns in JOIN alias lists to avoid aTom Lane2005-06-03
| | | | | | | | | | | | | | | | | | | | | performance problem pointed out by phil@vodafone: to wit, we were spending O(N^2) time to check dropped-ness in an N-deep join tree, even in the case where the tree was freshly constructed and couldn't possibly mention any dropped columns. Instead of recursing in get_rte_attribute_is_dropped(), change the data structure definition: the joinaliasvars list of a JOIN RTE must have a NULL Const instead of a Var at any position that references a now-dropped column. This costs nothing during normal parse-rewrite-plan path, and instead we have a linear-time update to make when loading a stored rule that might contain now-dropped columns. While at it, move the responsibility for acquring locks on relations referenced by rules into this separate function (which I therefore chose to call AcquireRewriteLocks). This saves effort --- namely, duplicated lock grabs in parser and rewriter --- in the normal path at a cost of one extra non-locked heap_open() in the stored-rule path; seems a good tradeoff. A fringe benefit is that it is now *much* clearer that we acquire lock on relations referenced in rules before we make any rewriter decisions based on their properties. (I don't know of any bug of that ilk, but it wasn't exactly clear before.)
* Push enable/disable of notify and catchup interrupts all the way downTom Lane2005-06-02
| | | | | | | to just around the bare recv() call that gets a command from the client. The former placement in PostgresMain was unsafe because the intermediate processing layers (especially SSL) use facilities such as malloc that are not necessarily re-entrant. Per report from counterstorm.com.