Hiroshi Inoue [Thu, 4 Nov 1999 08:01:09 +0000 (08:01 +0000)]
Make it possible to execute crashed CREATE/DROP commands again.
Now indexes of pg_class and pg_type are unique indexes
and guarantee the uniqueness of correponding attributes.
heap_create() was changed to take another boolean parameter
which allows to postpone the creation of disk file.
The name of rd_nonameunlinked was changed to rd_unlinked.
It is used generally(not only for noname relations) now.
Requires initdb.
Tom Lane [Mon, 1 Nov 1999 05:18:31 +0000 (05:18 +0000)]
Eliminate RewritePreprocessQuery, which was taking an
unreasonable amount of time to clean up after a vanished parser problem.
Don't call fireRIRonSubselect when we know there are no subselects,
either.
Tom Lane [Mon, 1 Nov 1999 05:15:13 +0000 (05:15 +0000)]
Eliminate some unbelievably cheesy code in _copyConst().
Apparently, back in the dim reaches of prehistory, the parser couldn't
be trusted to label Const nodes with the correct constbyval value ...
and someone preferred to patch around this in copyObject rather than
fix the problem at the source. The problem is long gone, but the hack
lingered on. Until now.
Tom Lane [Sat, 30 Oct 1999 23:13:30 +0000 (23:13 +0000)]
Avoid duplicate ExecTypeFromTL() call in ExecInitJunkFilter() by passing
in the TupleDesc that the caller already has (for call from ExecMain) or
can make just as easily as ExecInitJunkFilter() can (for call from
ExecAppend). Also, don't bother to build a junk filter for an INSERT
operation that doesn't actually need one, which is the normal case.
Tom Lane [Sat, 30 Oct 1999 23:07:55 +0000 (23:07 +0000)]
Skip invoking set_uppernode_references() for a RESULT node
that has no subplan --- saves a material amount of time for a simple
INSERT ... VALUES query.
Tom Lane [Sat, 30 Oct 1999 23:06:32 +0000 (23:06 +0000)]
Rewrite preprocess_targetlist() to reduce overhead for simple INSERTs.
In particular, don't bother to look up type information for attributes
where we're not actually going to use it, and avoid copying entire tlist
structure when it's not necessary.
Tom Lane [Sat, 30 Oct 1999 17:27:15 +0000 (17:27 +0000)]
Further performance improvements in sorting: reduce number of comparisons
during initial run formation by keeping both current run and next-run
tuples in the same heap (yup, Knuth is smarter than I am). And, during
merge passes, make use of available sort memory to load multiple tuples
from any one input 'tape' at a time, thereby improving locality of
access to the temp file.
Tom Lane [Sat, 30 Oct 1999 01:18:16 +0000 (01:18 +0000)]
Put back code in nodeAgg to generate a dummy all-nulls input tuple
before calling execProject, when the outerPlan has returned zero tuples.
I took this out under the mistaken impression that the input tuple
couldn't be referenced by execProject if we weren't in GROUP BY mode.
But it can, if we're in an UPDATE or DELETE...
Bruce Momjian [Tue, 26 Oct 1999 04:49:00 +0000 (04:49 +0000)]
These are two minor corrections to libpq's PQsetNoticeProcessor function.
One, it now returns the previous hook. That way people don't have to dig
around in libpq-int.h for that information anymore. It previously
returned void, so there should be no incompatibilities.
Second, you cannot set the callback to NULL anymore. (Of course you can
still call it with NULL just to get the current hook.) The way libpq uses
the callback pointer, having a NULL there wasn't very healthy.
Bruce Momjian [Tue, 26 Oct 1999 03:12:39 +0000 (03:12 +0000)]
Hello.
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>
|
Tom Lane [Mon, 25 Oct 1999 03:08:03 +0000 (03:08 +0000)]
Standardize on MAXPGPATH as the size of a file pathname buffer,
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.
Tom Lane [Mon, 25 Oct 1999 02:31:47 +0000 (02:31 +0000)]
'extern char *pg_pathname' in these files fails to agree with
postgres.c's declaration of 'char pg_pathname[...]'. I dunno when these
ports were last used, but they are sure broken now...
Tom Lane [Sun, 24 Oct 1999 20:42:27 +0000 (20:42 +0000)]
Add a notion of a 'catalog version number' that can indicate
when an initdb-forcing change has been applied within a development cycle.
PG_VERSION serves this purpose for official releases, but we can't bump
the PG_VERSION number every time we make a change to the catalogs during
development. Instead, increase the catalog version number to warn other
developers that you've made an incompatible change. See my mail to
pghackers for more info.
Tom Lane [Fri, 22 Oct 1999 23:14:50 +0000 (23:14 +0000)]
Remove fixed-size literal buffer from ecpg's lexer (same
fix recently applied to backend's lexer). I see that YY_USES_REJECT
still gets defined for this lexer, which means it's going to have trouble
parsing really long tokens. Not sure if it's worth doing anything about
that or not; I don't have the interest right now to understand why
ecpg's additions to the syntax cause this problem...
Tom Lane [Mon, 18 Oct 1999 03:32:29 +0000 (03:32 +0000)]
Drive a stake through the heart of the last use of MAX_PARSE_BUFFER
in the backend. Still a few stragglers, but we're getting closer to
being rid of query length limits...
Tom Lane [Mon, 18 Oct 1999 02:42:31 +0000 (02:42 +0000)]
Remove fixed-size literal buffer from scan.l, and repair
boundary-condition bug in myinput() which caused flex scanner to fail
on tokens larger than a bufferload. Turns out flex doesn't want null-
terminated input ... and if it gives you a 1-character buffer, you'd
better supply a character, not a null, lest you be thought to be
reporting end of input.
Tom Lane [Sun, 17 Oct 1999 23:09:02 +0000 (23:09 +0000)]
Change fd.c so that temp files are closed and deleted at
proc_exit time. I discovered that if the frontend closes the connection
when you're inside a transaction block, there is nothing ensuring that
temp files go away ... I wonder whether proc_exit ought to try to do an
explicit transaction abort?
Tom Lane [Sun, 17 Oct 1999 22:15:09 +0000 (22:15 +0000)]
Final stage of psort reconstruction work: replace psort.c with
a generalized module 'tuplesort.c' that can sort either HeapTuples or
IndexTuples, and is not tied to execution of a Sort node. Clean up
memory leakages in sorting, and replace nbtsort.c's private implementation
of mergesorting with calls to tuplesort.c.
Tom Lane [Sat, 16 Oct 1999 19:49:28 +0000 (19:49 +0000)]
Second phase of psort reconstruction project: add bookkeeping logic to
recycle storage within sort temp file on a block-by-block basis. This
reduces peak disk usage to essentially just the volume of data being
sorted, whereas it had been about 4x the data volume before.
Bruce Momjian [Fri, 15 Oct 1999 01:49:49 +0000 (01:49 +0000)]
This patch implements ORACLE's COMMENT SQL command.
>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.