summaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
* Bring syntax of role-related commands into SQL compliance. To avoidTom Lane2005-06-281-1/+1
| | | | | | | | | syntactic conflicts, both privilege and role GRANT/REVOKE commands have to use the same production for scanning the list of tokens that might eventually turn out to be privileges or role names. So, change the existing GRANT/REVOKE code to expect a list of strings not pre-reduced AclMode values. Fix a couple other minor issues while at it, such as InitializeAcl function name conflicting with a Windows system function.
* Replace pg_shadow and pg_group by new role-capable catalogs pg_authidTom Lane2005-06-284-43/+46
| | | | | | | | and pg_auth_members. There are still many loose ends to finish in this patch (no documentation, no regression tests, no pg_dump support for instance). But I'm going to commit it now anyway so that Alvaro can make some progress on shared dependencies. The catalog changes should be pretty much done.
* Fix overlooked regression output file.Tom Lane2005-06-261-1/+1
|
* Add E'' syntax so eventually normal strings can treat backslashesBruce Momjian2005-06-2618-38/+38
| | | | | | | | | | | | literally. Add GUC variables: "escape_string_warning" - warn about backslashes in non-E strings "escape_string_syntax" - supports E'' syntax? "standard_compliant_strings" - treats backslashes literally in '' Update code to use E'' when escapes are used.
* Remove forced CHECKPOINT in regression tests --- redundant now thatTom Lane2005-06-251-5/+1
| | | | CREATE DATABASE does one internally.
* Extend r-tree operator classes to handle Y-direction tests equivalentTom Lane2005-06-243-8/+11
| | | | | | | | | | | | | | | to the existing X-direction tests. An rtree class now includes 4 actual 2-D tests, 4 1-D X-direction tests, and 4 1-D Y-direction tests. This involved adding four new Y-direction test operators for each of box and polygon; I followed the PostGIS project's lead as to the names of these operators. NON BACKWARDS COMPATIBLE CHANGE: the poly_overleft (&<) and poly_overright (&>) operators now have semantics comparable to box_overleft and box_overright. This is necessary to make r-tree indexes work correctly on polygons. Also, I changed circle_left and circle_right to agree with box_left and box_right --- formerly they allowed the boundaries to touch. This isn't actually essential given the lack of any r-tree opclass for circles, but it seems best to sync all the definitions while we are at it.
* unbreak unicode/utf8 testTatsuo Ishii2005-06-243-3/+3
|
* Fix bug in CONTINUE statement for PL/pgSQL: when we continue a loop,Neil Conway2005-06-222-2/+66
| | | | | | | | we need to be careful to reset rc to PLPGSQL_RC_OK, depending on how the loop's logic is structured. If we continue a loop but it then exits without executing the loop's body again, we want to return PLPGSQL_RC_OK to our caller. Enhance the regression tests to catch this problem. Per report from Michael Fuhr.
* Add a CONTINUE statement to PL/PgSQL, which can be used to begin theNeil Conway2005-06-222-0/+231
| | | | | next iteration of a loop. Update documentation and add regression tests. Patch from Pavel Stehule, reviewed by Neil Conway.
* Cause initdb to create a third standard database "postgres", whichTom Lane2005-06-215-11/+11
| | | | | | | | | | | | | | unlike template0 and template1 does not have any special status in terms of backend functionality. However, all external utilities such as createuser and createdb now connect to "postgres" instead of template1, and the documentation is changed to encourage people to use "postgres" instead of template1 as a play area. This should fix some longstanding gotchas involving unexpected propagation of database objects by createdb (when you used template1 without understanding the implications), as well as ameliorating the problem that CREATE DATABASE is unhappy if anyone else is connected to template1. Patch by Dave Page, minor editing by Tom Lane. All per recent pghackers discussions.
* Change shell syntax that seems not to work right on FreeBSD 6-CURRENTTom Lane2005-06-201-2/+2
| | | | buildfarm machines.
* Add a time-of-preparation column to the pg_prepared_xacts view, per anTom Lane2005-06-181-2/+2
| | | | | | | | | | old suggestion by Oliver Jowett. Also, add a transaction column to the pg_locks view to show the xid of each transaction holding or awaiting locks; this allows prepared transactions to be properly associated with the locks they own. There was already a column named 'transaction', and I chose to rename it to 'transactionid' --- since this column is new in the current devel cycle there should be no backwards compatibility issue to worry about.
* Two-phase commit. Original patch by Heikki Linnakangas, with additionalTom Lane2005-06-175-3/+355
| | | | hacking by Alvaro Herrera and Tom Lane.
* Allow the parameters to PL/PgSQL's RAISE statement to be expressions,Neil Conway2005-06-142-24/+64
| | | | | | | | instead of just scalar variables. Add regression tests and update the documentation. Along the way, remove some redundant error checking code from exec_stmt_perform(). Original patch from Pavel Stehule, reworked by Neil Conway.
* Implement two new special variables in PL/PgSQL: SQLSTATE and SQLERRM.Neil Conway2005-06-102-0/+98
| | | | | | | | | | | | | | These contain the SQLSTATE and error message of the current exception, respectively. They are scope-local variables that are only defined in exception handlers (so attempting to reference them outside an exception handler is an error). Update the regression tests and the documentation. Also, do some minor related cleanup: export an unpack_sql_state() function from the backend and use it to unpack a SQLSTATE into a string, and add a free_var() function to pl_exec.c Original patch from Pavel Stehule, review by Neil Conway.
* Remove grammar productions for prefix and postfix % and ^ operators,Tom Lane2005-06-086-12/+12
| | | | | | | | | | as well as the existing pg_catalog entries for prefix and postfix %. These have never been documented, though they did appear in one old regression test. This avoids surprising behavior in cases like "SELECT -25 % -10". Per recent discussion. Note: although there is a catalog change here, I did not force initdb since there's no harm in leaving the inaccessible entries in one's copy of pg_operator.
* Add a function lastval(), which returns the value returned by theNeil Conway2005-06-072-0/+86
| | | | | | last nextval() or setval() performed by the current session. Update the docs, add regression tests, and bump the catalog version. Patch from Dennis Björklund, various improvements by Neil Conway.
* Add support for an optional INTO clause to PL/PgSQL's EXECUTE command.Neil Conway2005-06-072-0/+67
| | | | | | This allows the result of executing a SELECT to be assigned to a row variable, record variable, or list of scalars. Docs and regression tests updated. Per Pavel Stehule, improvements and cleanup by Neil Conway.
* When enqueueing after-row triggers for updates of a table with a foreignNeil Conway2005-05-302-0/+78
| | | | | | | | | | | | key, compare the new and old row versions. If the foreign key column has not changed, we needn't enqueue the trigger, since the update cannot violate the foreign key. This optimization was previously applied in the RI trigger function, but it is more efficient to avoid firing the trigger altogether. Per recent discussion on pgsql-hackers. Also add a regression test for some unintuitive foreign key behavior, and refactor some code that deals with the OIDs of the various RI trigger functions.
* Display only 9 subsecond digits instead of 10 for time values, forBruce Momjian2005-05-271-20/+20
| | | | | consistency and to prevent rounding for days < 30. Also round off all trailing zeros, rather than leaving an even number of digits.
* Back out part of patch that should be applied later.Bruce Momjian2005-05-271-20/+20
|
* Fix compile of entab to use stdarg.h. Clean up includes.Bruce Momjian2005-05-271-20/+20
| | | | Marko Kreen
* Back out SQLSTATE and SQLERRM support.Bruce Momjian2005-05-262-47/+0
|
* Minor cleanup for recent SQLSTATE / SQLERRM patch: spell "successful"Neil Conway2005-05-262-3/+4
| | | | correctly, style fixes.
* Adjust datetime parsing to be more robust. We now pass the length of theNeil Conway2005-05-262-0/+10
| | | | | | | | | | | | | | | working buffer into ParseDateTime() and reject too-long input there, rather than checking the length of the input string before calling ParseDateTime(). The old method was bogus because ParseDateTime() can use a variable amount of working space, depending on the content of the input string (e.g. how many fields need to be NUL terminated). This fixes a minor stack overrun -- I don't _think_ it's exploitable, although I won't claim to be an expert. Along the way, fix a bug reported by Mark Dilger: the working buffer allocated by interval_in() was too short, which resulted in rejecting some perfectly valid interval input values. I added a regression test for this fix.
* Add PL/pgSQL SQLSTATE and SQLERRM support which sets these values onBruce Momjian2005-05-262-0/+46
| | | | | | error. Pavel Stehule
* Implement md5(bytea), update regression tests and documentation. PatchNeil Conway2005-05-202-0/+56
| | | | | | | | from Abhijit Menon-Sen, minor editorialization from Neil Conway. Also, improve md5(text) to allocate a constant-sized buffer on the stack rather than via palloc. Catalog version bumped.
* Extend the pg_locks system view so that it can fully display all lockTom Lane2005-05-171-1/+1
| | | | types, as per recent discussion.
* Add a --dbname option to the pg_regress script, and use pl_regressionTom Lane2005-05-171-1/+5
| | | | | | for testing PLs and contrib_regression for testing contrib, instead of overwriting the core system's regression database as formerly done. Andrew Dunstan
* Add regression test for consecutive newlines in COPY CSV mode. (There isNeil Conway2005-05-132-0/+14
| | | | | no bug related to this functionality in HEAD, but it's worth adding a test for anyway.) From Andrew Dunstan.
* Give pg_regress a --load-language option, so that it can be used to testTom Lane2005-05-112-13/+25
| | | | other PLs besides plpgsql. Andrew Dunstan
* Regression tests for the COPY CSV header feature. From Andrew Dunstan.Neil Conway2005-05-102-0/+24
|
* Update "expected" regression test output for the recent stats collectorNeil Conway2005-05-091-1/+1
| | | | checkin. My apologies for breaking the tests.
* Change catalog entries for record_out and record_send to show only oneTom Lane2005-04-302-20/+16
| | | | | | argument, since that's all they are using now. Adjust type_sanity regression test so that it will complain if anyone tries to define multiple-argument output functions in future.
* First cut at planner support for bitmap index scans. Lots to do yet,Tom Lane2005-04-226-2/+24
| | | | | | | | but the code is basically working. Along the way, rewrite the entire approach to processing OR index conditions, and make it work in join cases for the first time ever. orindxpath.c is now basically obsolete, but I left it in for the time being to allow easy comparison testing against the old implementation.
* Rethink original decision to use AND/OR Expr nodes to represent bitmapTom Lane2005-04-211-11/+12
| | | | | | | logic operations during planning. Seems cleaner to create two new Path node types, instead --- this avoids duplication of cost-estimation code. Also, create an enable_bitmapscan GUC parameter to control use of bitmap plans.
* Add aggsortop column to pg_aggregate, so that MIN/MAX optimization canTom Lane2005-04-124-12/+118
| | | | | | | | be supported for all datatypes. Add CREATE AGGREGATE and pg_dump support too. Add specialized min/max aggregates for bpchar, instead of depending on text's min/max, because otherwise the possible use of bpchar indexes cannot be recognized. initdb forced because of catalog changes.
* Create the planner mechanism for optimizing simple MIN and MAX queriesTom Lane2005-04-114-0/+78
| | | | | | into indexscans on matching indexes. For the moment, it only handles int4 and text datatypes; next step is to add a column to pg_aggregate so that all MIN/MAX aggregates can be handled. Per my recent proposal.
* Fix interaction between materializing holdable cursors and firingTom Lane2005-04-112-0/+78
| | | | | | deferred triggers: either one can create more work for the other, so we have to loop till it's all gone. Per example from andrew@supernews. Add a regression test to help spot trouble in this area in future.
* Fix some issues with missing or too many newlines atTom Lane2005-04-074-3/+4
| | | | end of file.
* Allow plpgsql functions to omit RETURN command when the function returnsTom Lane2005-04-072-9/+45
| | | | | | output parameters or VOID or a set. There seems no particular reason to insist on a RETURN in these cases, since the function return value is determined by other elements anyway. Per recent discussion.
* Fix minor breakage to regression tests induced in previous commit -- I hadNeil Conway2005-04-071-0/+2
| | | | updated the expected/ output, not the output/ output. Apologies.
* Add a "USING" clause to DELETE, which is equivalent to the FROM clauseNeil Conway2005-04-0759-184/+296
| | | | | | | | | | | | | | | in UPDATE. We also now issue a NOTICE if a query has _any_ implicit range table entries -- in the past, we would only warn about implicit RTEs in SELECTs with at least one explicit RTE. As a result of the warning change, 25 of the regression tests had to be updated. I also took the opportunity to remove some bogus whitespace differences between some of the float4 and float8 variants. I believe I have correctly updated all the platform-specific variants, but let me know if that's not the case. Original patch for DELETE ... USING from Euler Taveira de Oliveira, reworked by Neil Conway.
* plpgsql does OUT parameters, as per my proposal a few weeks ago.Tom Lane2005-04-052-1/+203
|
* First phase of OUT-parameters project. We can now define and use SQLTom Lane2005-03-313-1/+194
| | | | | functions with OUT parameters. The various PLs still need work, as does pg_dump. Rudimentary docs and regression tests included.
* Convert oidvector and int2vector into variable-length arrays. ThisTom Lane2005-03-294-42/+34
| | | | | | | | | | | | | change saves a great deal of space in pg_proc and its primary index, and it eliminates the former requirement that INDEX_MAX_KEYS and FUNC_MAX_ARGS have the same value. INDEX_MAX_KEYS is still embedded in the on-disk representation (because it affects index tuple header size), but FUNC_MAX_ARGS is not. I believe it would now be possible to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet. There are still a lot of vestigial references to FUNC_MAX_ARGS, which I will clean up in a separate pass. However, getting rid of it altogether would require changing the FunctionCallInfoData struct, and I'm not sure I want to buy into that.
* Add Windows-specific variant comparison file.Tom Lane2005-03-261-0/+2149
|
* Add another ORDER BY to rules test to eliminate platform-specificTom Lane2005-03-262-2/+2
| | | | output ordering.
* Have libpgport link before libpq so that PG client applications are moreBruce Momjian2005-03-251-1/+1
| | | | immunte to changes in libpq's usage of pgport between major versions.
* Tweak planner to use a minimum size estimate of 10 pages for aTom Lane2005-03-243-44/+44
| | | | | | | | never-yet-vacuumed relation. This restores the pre-8.0 behavior of avoiding seqscans during initial data loading, while still allowing reasonable optimization after a table has been vacuumed. Several regression test cases revert to 7.4-like behavior, which is probably a good sign. Per gripes from Keith Browne and others.