summaryrefslogtreecommitdiff
path: root/src/backend/commands
Commit message (Collapse)AuthorAgeFilesLines
* Add recreate index notice to vacuum error.Bruce Momjian1999-11-141-3/+3
|
* New NameStr macro to convert Name to Str. No need for var.data anymore.Bruce Momjian1999-11-0710-43/+43
| | | | | | Fewer calls to nameout. Better use of RelationGetRelationName.
* Fix compile after COMMENT problem.Bruce Momjian1999-10-261-1/+4
|
* Hello.Bruce Momjian1999-10-266-57/+863
| | | | | | | | | | | | | | | | | | | The following patch extends the COMMENT ON functionality to the rest of the database objects beyond just tables, columns, and views. The grammer of the COMMENT ON statement now looks like: COMMENT ON [ [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ] <objname> | COLUMN <relation>.<attribute> | AGGREGATE <aggname> <aggtype> | FUNCTION <funcname> (arg1, arg2, ...) | OPERATOR <op> (leftoperand_typ rightoperand_typ) | TRIGGER <triggername> ON relname> Mike Mascari (mascarim@yahoo.com)
* Standardize on MAXPGPATH as the size of a file pathname buffer,Tom Lane1999-10-251-10/+10
| | | | | | | eliminating some wildly inconsistent coding in various parts of the system. I set MAXPGPATH = 1024 in config.h.in. If anyone is really convinced that there ought to be a configure-time test to set the value, go right ahead ... but I think it's a waste of time.
* This patch implements ORACLE's COMMENT SQL command.Bruce Momjian1999-10-151-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >From the ORACLE 7 SQL Language Reference Manual: ----------------------------------------------------- COMMENT Purpose: To add a comment about a table, view, snapshot, or column into the data dictionary. Prerequisites: The table, view, or snapshot must be in your own schema or you must have COMMENT ANY TABLE system privilege. Syntax: COMMENT ON [ TABLE table ] | [ COLUMN table.column] IS 'text' You can effectively drop a comment from the database by setting it to the empty string ''. ----------------------------------------------------- Example: COMMENT ON TABLE workorders IS 'Maintains base records for workorder information'; COMMENT ON COLUMN workorders.hours IS 'Number of hours the engineer worked on the task'; to drop a comment: COMMENT ON COLUMN workorders.hours IS ''; The current patch will simply perform the insert into pg_description, as per the TODO. And, of course, when the table is dropped, any comments relating to it or any of its attributes are also dropped. I haven't looked at the ODBC source yet, but I do know from an ODBC client standpoint that the standard does support the notion of table and column comments. Hopefully the ODBC driver is already fetching these values from pg_description, but if not, it should be trivial. Hope this makes the grade, Mike Mascari (mascarim@yahoo.com)
* Fix planner and rewriter to follow SQL semantics for tables that areTom Lane1999-10-071-3/+3
| | | | | | | | | | | mentioned in FROM but not elsewhere in the query: such tables should be joined over anyway. Aside from being more standards-compliant, this allows removal of some very ugly hacks for COUNT(*) processing. Also, allow HAVING clause without aggregate functions, since SQL does. Clean up CREATE RULE statement-list syntax the same way Bruce just fixed the main stmtmulti production. CAUTION: addition of a field to RangeTblEntry nodes breaks stored rules; you will have to initdb if you have any rules.
* Reimplement parsing and storage of default expressions and constraintTom Lane1999-10-034-60/+121
| | | | | | | | | | | | | | | expressions in CREATE TABLE. There is no longer an emasculated expression syntax for these things; it's full a_expr for constraints, and b_expr for defaults (unfortunately the fact that NOT NULL is a part of the column constraint syntax causes a shift/reduce conflict if you try a_expr. Oh well --- at least parenthesized boolean expressions work now). Also, stored expression for a column default is not pre-coerced to the column type; we rely on transformInsertStatement to do that when the default is actually used. This means "f1 datetime default 'now'" behaves the way people usually expect it to. BTW, all the support code is now there to implement ALTER TABLE ADD CONSTRAINT and ALTER TABLE ADD COLUMN with a default value. I didn't actually teach ALTER TABLE to call it, but it wouldn't be much work.
* Allow CREATE FUNCTION's WITH clause to be used for all language types,Tom Lane1999-10-022-109/+96
| | | | | | | not just C, so that ISCACHABLE attribute can be specified for user-defined functions. Get rid of ParamString node type, which wasn't actually being generated by gram.y anymore, even though define.c thought that was what it was getting. Clean up minor bug in dfmgr.c (premature heap_close).
* Added utils/adt/ri_triggers with empty shells for theJan Wieck1999-09-301-2/+3
| | | | | | | | FOREIGN KEY triggers. Added pg_proc entries for all the new functions. Jan
* This is part #1 for of the DEFERRED CONSTRAINT TRIGGER support.Jan Wieck1999-09-291-62/+1077
| | | | | | | | | | | | Implements the CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands. TODO: Generic builtin trigger procedures Automatic execution of appropriate CREATE CONSTRAINT... at CREATE TABLE Support of new trigger type in pg_dump Swapping of huge # of events to disk Jan
* Make tree compilable (+WAL).Vadim B. Mikheev1999-09-281-8/+6
|
* I have been working with user defined types and user defined cBruce Momjian1999-09-281-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions. One problem that I have encountered with the function manager is that it does not allow the user to define type conversion functions that convert between user types. For instance if mytype1, mytype2, and mytype3 are three Postgresql user types, and if I wish to define Postgresql conversion functions like I run into problems, because the Postgresql dynamic loader would look for a single link symbol, mytype3, for both pieces of object code. If I just change the name of one of the Postgresql functions (to make the symbols distinct), the automatic type conversion that Postgresql uses, for example, when matching operators to arguments no longer finds the type conversion function. The solution that I propose, and have implemented in the attatched patch extends the CREATE FUNCTION syntax as follows. In the first case above I use the link symbol mytype2_to_mytype3 for the link object that implements the first conversion function, and define the Postgresql operator with the following syntax The patch includes changes to the parser to include the altered syntax, changes to the ProcedureStmt node in nodes/parsenodes.h, changes to commands/define.c to handle the extra information in the AS clause, and changes to utils/fmgr/dfmgr.c that alter the way that the dynamic loader figures out what link symbol to use. I store the string for the link symbol in the prosrc text attribute of the pg_proc table which is currently unused in rows that reference dynamically loaded functions. Bernie Frankpitt
* Massimo's SET FSYNC and SHOW PG_OPTIONS changes, without SET QUERY_LIMIT.Bruce Momjian1999-09-271-1/+36
|
* Cancel query support from MassimoBruce Momjian1999-09-271-1/+7
|
* Fix to give super user and createdb user proper update catalog rights.Bruce Momjian1999-09-271-2/+4
|
* Several changes here, not very related but touching some of the same files.Tom Lane1999-09-243-48/+153
| | | | | | | | | | | | | | | | | | | | | * Buffer refcount cleanup (per my "progress report" to pghackers, 9/22). * Add links to backend PROC structs to sinval's array of per-backend info, and use these links for routines that need to check the state of all backends (rather than the slow, complicated search of the ShmemIndex hashtable that was used before). Add databaseOID to PROC structs. * Use this to implement an interlock that prevents DESTROY DATABASE of a database containing running backends. (It's a little tricky to prevent a concurrently-starting backend from getting in there, since the new backend is not able to lock anything at the time it tries to look up its database in pg_database. My solution is to recheck that the DB is OK at the end of InitPostgres. It may not be a 100% solution, but it's a lot better than no interlock at all...) * In ALTER TABLE RENAME, flush buffers for the relation before doing the rename of the physical files, to ensure we don't get failures later from mdblindwrt(). * Update TRUNCATE patch so that it actually compiles against current sources :-(. You should do "make clean all" after pulling these changes.
* Add TRUNCATE command, with psql help and sgml additions.Bruce Momjian1999-09-231-1/+21
|
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-1815-378/+323
| | | | | | | | | | | | | | | | | additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
* Eliminate query length limitation imposed by pg_client_to_serverTom Lane1999-09-111-109/+65
| | | | | and pg_server_to_client. Eliminate copy.c's restriction on the length of a single attribute.
* Eliminate elog()'s hardwired limit on length of an error message.Tom Lane1999-09-111-24/+3
| | | | | | | | | This change seems necessary in conjunction with long queries, and it cleans up some bogosity in connection with long EXPLAIN texts anyway. Note that current libpq will accept any length error message (at least until it runs out of memory); prior versions have a limit of 8K, but will cleanly discard excess error text, so there shouldn't be any big compatibility problems with old clients.
* Remove no-longer-needed code to update temprel's copy ofTom Lane1999-09-041-8/+1
| | | | pg_class tuple during ALTER TABLE ADD COLUMN.
* Minor improvements to stringinfo package to make it moreTom Lane1999-08-311-1/+4
| | | | robust, since it's about to get used much more heavily.
* Fix vacuum's memory consumptionTatsuo Ishii1999-08-251-4/+11
|
* Further planner/optimizer cleanups. Move all set_tlist_referencesTom Lane1999-08-221-3/+4
| | | | | | | | | | and fix_opids processing to a single recursive pass over the plan tree executed at the very tail end of planning, rather than haphazardly here and there at different places. Now that tlist Vars do not get modified until the very end, it's possible to get rid of the klugy var_equal and match_varid partial-matching routines, and just use plain equal() throughout the optimizer. This is a step towards allowing merge and hash joins to be done on expressions instead of only Vars ...
* EXPLAIN didn't know about 'Materialize' plan nodes.Tom Lane1999-08-161-1/+4
|
* > > Prevent sorting if result is already sortedBruce Momjian1999-08-091-1/+3
| | | | | | | | | | | | | | > > > > was implemented by Jan Wieck. > > His work is for ascending order cases. > > > > Here is a patch to prevent sorting also in descending > > order cases. > > Because I had already changed _bt_first() to position > > backward correctly before v6.5,this patch would work. > > Hiroshi Inoue Inoue@tpf.co.jp
* Store -1 in attdisbursion to signal 'no duplicates in column'.Tom Lane1999-08-091-26/+36
| | | | Centralize att_disbursion readout logic.
* For a unique-key attribute (no duplicate values), vacuum analyzeTom Lane1999-08-081-8/+16
| | | | was recording a disbursion of 0, not the correct value 1/numberOfRows.
* First step in fixing selectivity-estimation code. eqsel andTom Lane1999-08-011-22/+46
| | | | | | | | | | neqsel now behave as per my suggestions in pghackers a few days ago. selectivity for < > <= >= should work OK for integral types as well, but still need work for nonintegral types. Since these routines have never actually executed before :-(, this may result in some significant changes in the optimizer's choices of execution plans. Let me know if you see any serious misbehavior. CAUTION: THESE CHANGES REQUIRE INITDB. pg_statistic table has changed.
* Make usecatupd disabled for normal users, and allow normal users toBruce Momjian1999-07-301-2/+2
| | | | update temp tables with this setting.
* Plug several holes in backend's ability to cope withTom Lane1999-07-221-12/+28
| | | | unexpected loss of connection to frontend.
* Install new alignment code to use MAXALIGN rather than DOUBLEALIGN whereBruce Momjian1999-07-191-5/+5
| | | | approproate.
* configure cleanupBruce Momjian1999-07-181-3/+1
|
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-1719-52/+16
|
* Fix incorrect declaration of rtentry as 'ResTarget' where itTom Lane1999-07-171-2/+2
| | | | should be 'RangeTblEntry' ; explain.c had copied the erroneous code.
* More cleanupBruce Momjian1999-07-161-3/+2
|
* Final cleanup.Bruce Momjian1999-07-1618-92/+94
|
* Update #include cleanupsBruce Momjian1999-07-166-13/+13
|
* Change #include's to use <> and "" as appropriate.Bruce Momjian1999-07-1514-150/+150
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-1516-121/+14
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-156-11/+7
|
* Fix spelling of variable name.Bruce Momjian1999-07-071-5/+5
|
* Fix misspelling.Bruce Momjian1999-07-071-5/+5
|
* Fix to prevent too large tuple from being created.Bruce Momjian1999-07-032-4/+4
|
* Change form() to varargform() to prevent portability problems.Bruce Momjian1999-06-191-7/+7
|
* Explain didn't handle inheritance correctly (it didn'tTom Lane1999-06-171-2/+1
| | | | manipulate rtable the same way executor does).
* Remove QUERY_LIMIT and documenation on same. Change _ALIGN to TYPEALIGNBruce Momjian1999-06-171-64/+2
| | | | for Irix.
* Fix critical error noticed by Massimo: copy.c used to have aTom Lane1999-06-121-17/+2
| | | | | | | | | special hack to ensure it would close its output file even after failure due to elog(ERROR) partway through the copy. This is now unnecessary because fd.c takes care of cleaning up open files at transaction abort; worse, after fd.c closed the file copy.c would try to do so *again* at the start of the next COPY command. This would result in havoc in most implementations of stdio library.
* Change Assert(Ptp.t_data->t_xmax == tp.t_data->t_xmin) to :Vadim B. Mikheev1999-06-111-3/+30
| | | | | | | | | | | | | | | | | /* * Read above about cases when !ItemIdIsUsed(Citemid) * (child item is removed)... Due to the fact that * at the moment we don't remove unuseful part of * update-chain, it's possible to get too old * parent row here. Like as in the case which * caused this problem, we stop shrinking here. * I could try to find real parent row but want * not to do it because of real solution will * be implemented anyway, latter, and we are too * close to 6.5 release. - vadim 06/11/99 */ if (Ptp.t_data->t_xmax != tp.t_data->t_xmin) ...