summaryrefslogtreecommitdiff
path: root/src/backend
Commit message (Collapse)AuthorAgeFilesLines
* Allow CREATE FUNCTION's WITH clause to be used for all language types,Tom Lane1999-10-024-117/+105
| | | | | | | 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).
* Replace float.c's #ifdef finite check with a proper autoconf check, so itTom Lane1999-10-021-5/+5
| | | | works if finite() is a function. Patch from Christof Petig.
* Stick finger into a couple more holes in the leaky dike ofTom Lane1999-10-021-1/+16
| | | | | | | modifyAggrefQual. This routine really, really needs to be retired, but until we have subselects in FROM there's no chance of doing the job right. In the meantime try to respond to unhandlable cases with elog rather than coredump.
* Fix make_clause and make_opclause to record valid type infoTom Lane1999-10-021-20/+22
| | | | | | | in the Expr nodes they produce. This fixes a few cases of errors like 'typeidTypeRelid: Invalid type - oid = 0' caused by calling parser-related routines on expression trees that have already been processed by planner- related routines.
* Revise rule-printing routines to use expandable StringInfo buffers, so thatTom Lane1999-10-021-402/+340
| | | | | | | they have no hardwired limit on the length of a rule's text. Fix a couple of minor bugs in passing --- deparsed UPDATE queries didn't have quotes around relation name, and quotes and backslashes in constant values weren't backslash-quoted.
* Clean up rewriter routines to use expression_tree_walker andTom Lane1999-10-013-2430/+953
| | | | | | | | | | | | expression_tree_mutator rather than ad-hoc tree walking code. This shortens the code materially and fixes a fair number of sins of omission. Also, change modifyAggrefQual to *not* recurse into subselects, since its mission is satisfied if it removes aggregate functions from the top level of a WHERE clause. This cures problems with queries of the form SELECT ... WHERE x IN (SELECT ... HAVING something-using-an-aggregate), which would formerly get mucked up by modifyAggrefQual. The routine is still fundamentally broken, of course, but I don't think there's any way to get rid of it before we implement subselects in FROM ...
* Added utils/adt/ri_triggers with empty shells for theJan Wieck1999-09-303-4/+190
| | | | | | | | FOREIGN KEY triggers. Added pg_proc entries for all the new functions. Jan
* Removed (useless) pg_proc_prosrc_indexJan Wieck1999-09-303-39/+21
| | | | Jan
* Reverse out getopt patch --- turns out it doesn't help on myTom Lane1999-09-301-2/+2
| | | | | platform, and there are at least some people it's not broken for. So undo change until we can discuss a more portable solution.
* Un-break optarg() call --- some peoples' optarg librariesTom Lane1999-09-301-7/+7
| | | | don't like extraneous colons in the option list...
* Hmm, guess I forgot to commit this file the other day ...Tom Lane1999-09-301-24/+19
| | | | just some cosmetic changes now, Vadim already fixed the heap_xxx calls.
* Added nbtree operator class for NUMERICJan Wieck1999-09-291-1/+29
| | | | Jan
* Disable new FROM-clause warning.Bruce Momjian1999-09-292-2/+8
|
* This is part #1 for of the DEFERRED CONSTRAINT TRIGGER support.Jan Wieck1999-09-299-84/+1296
| | | | | | | | | | | | 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
* Add subquery mention in auto-create table entry.Bruce Momjian1999-09-282-5/+11
|
* Fix for AIX dynaloader from Zeugswetter AndreaBruce Momjian1999-09-281-0/+1
|
* More cleanup for | and ^.Bruce Momjian1999-09-281-13/+9
|
* More cleanup for | and ^.Bruce Momjian1999-09-281-7/+67
|
* Fix for creation of operator |.Bruce Momjian1999-09-281-5/+25
|
* Make tree compilable (+WAL).Vadim B. Mikheev1999-09-286-24/+27
|
* heap_close(rel, AccessShareLock);Vadim B. Mikheev1999-09-281-2/+2
| | | | ^^^^^^^^^^^^^^^^^ need in
* I have been working with user defined types and user defined cBruce Momjian1999-09-283-13/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reverse out last scan.l patch for minus handling.\Bruce Momjian1999-09-283-7/+7
|
* Fix nodeAgg coredump in case where lower-level plan hasTom Lane1999-09-281-27/+14
| | | | | | | an empty targetlist *and* fails to return any tuples, as will happen for example with 'SELECT COUNT(1) FROM table WHERE ...' if the where- clause selects no tuples. It's so nice to make a fix by diking out code, instead of adding more...
* Sorry, guys. Here is the ultimate patch which keeps the entireBruce Momjian1999-09-271-2/+2
| | | | | | | | | | behavior as it was, apart from forbidding minus-terminated operators. Seems that I have to break the habit of doing before thinking properly :-/ The point is that my second patch breaks constructs like a & b or a ! b. This patch is to be applied instead of any of two other today's patches. Leon
* Massimo's SET FSYNC and SHOW PG_OPTIONS changes, without SET QUERY_LIMIT.Bruce Momjian1999-09-274-5/+49
|
* Cancel query support from MassimoBruce Momjian1999-09-271-1/+7
|
* Following advice from Michael Ansley, I broke up the patch inBruce Momjian1999-09-271-97/+10
| | | | | | | two: one fixes uminus and other literal length. They are to be applied - uminus first, then possilbly literal on top of uminus. Leon
* Currently,only the first column of multi-column indicesBruce Momjian1999-09-272-48/+92
| | | | | | | | | | | | | is used to find start scan position of Indexscan-s. To speed up finding scan start position,I have changed _bt_first() to use as many keys as possible. I'll attach the patch here. Regards. Hiroshi Inoue
* Emit warning on SELECT pg_language.*Bruce Momjian1999-09-272-5/+14
|
* Fix to give super user and createdb user proper update catalog rights.Bruce Momjian1999-09-271-2/+4
|
* Transaction log manager core code.Vadim B. Mikheev1999-09-276-13/+1473
| | | | It doesn't work currently but also don't break anything -:)
* Add README.SSLBruce Momjian1999-09-271-0/+53
|
* Lots of patches coming in from me today :-)Bruce Momjian1999-09-276-65/+252
| | | | | | | | | | When drawing up a very simple "text-drawing" of how the negotiation is done, I realised I had done this last part (fallback) in a very stupid way. Patch #4 fixes this, and does it in a much better way. Included is also the simple text-drawing of how the negotiation is done. //Magnus
* Modify nodeAgg.c so that no rows are returned for a GROUP BYTom Lane1999-09-263-411/+441
| | | | | | | | with no input rows, per pghackers discussions around 7/22/99. Clean up a bunch of ugly coding while at it; remove redundant re-lookup of aggregate info at start of each new GROUP. Arrange to pfree intermediate values when they are pass-by-ref types, so that aggregates on pass-by-ref types no longer eat memory. This takes care of a couple of TODO items...
* Implement constant-expression simplification per BernardTom Lane1999-09-265-137/+554
| | | | | | | | | | | Frankpitt, plus some improvements from yours truly. The simplifier depends on the proiscachable field of pg_proc to tell it whether a function is safe to pre-evaluate --- things like nextval() are not, for example. Update pg_proc.h to contain reasonable cacheability information; as of 6.5.* hardly any functions were marked cacheable. I may have erred too far in the other direction; see recent mail to pghackers for more info. This update does not force an initdb, exactly, but you won't see much benefit from the simplifier until you do one.
* Several changes here, not very related but touching some of the same files.Tom Lane1999-09-2433-872/+1117
| | | | | | | | | | | | | | | | | | | | | * 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.
* Fix for netmask('x.x.x.x/0') is 255.255.255.255 instead of 0.0.0.0Bruce Momjian1999-09-231-2/+3
| | | | | | This is because (-1) << 32 is -1 (Only intel arc. has been checked) Oleg Sharoiko
* Add TRUNCATE command, with psql help and sgml additions.Bruce Momjian1999-09-236-9/+309
|
* values.h patch from Alex HowanskyBruce Momjian1999-09-216-6/+28
|
* Remove incorrect 'Assert(targetList != NULL)'. AnTom Lane1999-09-191-9/+2
| | | | | INSERT ... DEFAULT VALUES statement does indeed have a null targetlist, at least during parse and rewrite stages.
* Fix CASE bug identified by Keith Parks: CASE didn't reliablyTom Lane1999-09-181-31/+16
| | | | | treat a NULL condition result as FALSE. Clean up some bogus comments here and there, too.
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-1865-1163/+1045
| | | | | | | | | | | | | | | | | 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.
* Changes made by Hiroshi Inoue and approved by Vadim.Tatsuo Ishii1999-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See attached mail for more details. ------------------------------------------------------------------- From: "Vadim Mikheev" <vadim@krs.ru> To: "Hiroshi Inoue" <Inoue@tpf.co.jp> References: <000201befa94$42fe04c0$2801007e@cadzone.tpf.co.jp> Subject: Re: elog(ERROR) in vacuum Date: Fri, 10 Sep 1999 10:27:10 +0900 Organization: OJSC Rostelecom (Krasnoyarsk) Message-ID: <37D85E6E.5AFA126D@krs.ru> Hiroshi Inoue wrote: > > Hello Vadim, > > I have a question about vacuum. > > VACUUM has a phase like commit which calls TransactionIdCommit(). > But if elog(ERROR) occured after that,the status of transaction is > changed from XID_COMMIT to XID_ABORT. > > Seems to me this causes inconsistency. > Shoudn't AbortTransaction() be changed not to call TransacionIdAbort() > in case of vacuum. You're right! As usual -:) Vadim
* Allow ISOLATION and LEVEL as column names. These are SQL92 reserved wordsThomas G. Lockhart1999-09-141-1/+3
| | | | which do not need to be so for our parser. Apparently omitted earlier.
* Allow CASE statement to contain *only* untyped result clauses or nulls.Thomas G. Lockhart1999-09-131-2/+3
| | | | | | | Almost worked before, but forgot one place to check. Reported by Tatsuo Ishii. Still does not do the right thing if inserting into a non-string target column. Should look for a type coersion later, but doesn't.
* First cut at doing something reasonable with OR-of-ANDs WHERETom Lane1999-09-134-20/+267
| | | | | | | | conditions. There are some pretty bogus heuristics in prepqual.c that try to decide whether to output CNF or DNF format; they need to be replaced, likely. Right now the code is probably too willing to choose DNF form, which might hurt performance in some cases that used to work OK. But at least we have a foundation to build on.
* cygwin doesn't have an endian.h, but defines BYTE_ORDER in sys/param.hMarc G. Fournier1999-09-121-1/+4
|
* Further improvements in cnfify: reduce amount of self-recursionTom Lane1999-09-121-332/+381
| | | | | | | | | in or_normalize, remove detection of duplicate subexpressions (since it's highly unlikely to be worth the amount of time it takes), and introduce a dnfify() entry point so that unintelligible backwards logic in UNION processing can be eliminated. This is just an intermediate step --- next thing is to look at not forcing the qual into CNF form when it would be better off in DNF form.
* Eliminate query length limitation imposed by pg_client_to_serverTom Lane1999-09-113-154/+137
| | | | | and pg_server_to_client. Eliminate copy.c's restriction on the length of a single attribute.