Tom Lane [Sat, 14 Dec 2002 00:17:59 +0000 (00:17 +0000)]
Clean up plantree representation of SubPlan-s --- SubLink does not appear
in the planned representation of a subplan at all any more, only SubPlan.
This means subselect.c doesn't scribble on its input anymore, which seems
like a good thing; and there are no longer three different possible
interpretations of a SubLink. Simplify node naming and improve comments
in primnodes.h. No change to stored rules, though.
Tom Lane [Fri, 13 Dec 2002 20:35:57 +0000 (20:35 +0000)]
Admit defeat on the prospect of keeping straight exactly which platforms
produce which output in the geometry test, even with the problem narrowed
down to only whether they print minus zero or not. Instead, use
pg_regress' locale-variant mechanism to automatically consider the test
to pass if it matches either supplied comparison file. geometry_1.out
replaces the former geometry-positive-zeros.out.
Tom Lane [Fri, 13 Dec 2002 19:46:01 +0000 (19:46 +0000)]
Phase 3 of read-only-plans project: ExecInitExpr now builds expression
execution state trees, and ExecEvalExpr takes an expression state tree
not an expression plan tree. The plan tree is now read-only as far as
the executor is concerned. Next step is to begin actually exploiting
this property.
Tom Lane [Fri, 13 Dec 2002 17:29:25 +0000 (17:29 +0000)]
Adjust costsize calculations to avoid introducing unnecessary roundoff
error. This seems to explain the differing choice of plan that's been
causing geometry regress test to fail for the last few days.
Bruce Momjian [Fri, 13 Dec 2002 05:36:24 +0000 (05:36 +0000)]
Here's the patch I mentioned on HACKERS to fix up ALTER command tab
completion. Note that it's based on 7.3 tarball, not CVS HEAD, or 7.3rel
branch. Damn, looking at CVS, this will patch into 7.3rel (just tested,
it does) probably collide with Rod Taylor's patch adding ALTER TRIGGER
stuff. O.K, second patch attached against HEAD - not tested, hand
merged.
Bruce Momjian [Thu, 12 Dec 2002 22:49:27 +0000 (22:49 +0000)]
> There is an ugly little problem with the DB wrapper class.
>
> In pg.py the attributes of DB are defined as being the same as
> the attributes of the corresponding pgobject "db", using the following
...
> The problem is that the attributes of db (which are read only)
> are not static (they are actually function calls to PostgreSQL),
> especially "status" and "error", but those attributes are copied
> and this is done only once when initializing the DB object.
>
> So, in effect, only the attribute "db.error" of a DB instance
> will be updated, but not the attribute "error". Same with "status".
> Don't copy the (read only) attributes of the pgobject to the
> DB object, but only the methods, and all of them, like this:
>
> --------------- change in pg.py ------------------
> # Create convience methods, in a way that is still overridable.
> for e in self.db.__methods__:
> setattr(self, e, getattr(self.db, e))
> ----------------------------------------------------
>
> Furthermore, make an addition to the documentation of the
> DB wrapper class (i.e. in pygresql-pg-db.html):
> After the sentence "All pgobject methods are included in this class also."
> add the following sentence "The pgobject read-only attributes can be
> accessed py adding the prefix 'db.' to them."
Bruce Momjian [Thu, 12 Dec 2002 21:02:25 +0000 (21:02 +0000)]
TODO marked as done:
* Add schema, cast, and conversion backslash commands to psql
I had to create a new publically available function,
pg_conversion_is_visible, as it seemed to be missing from the catalogs.
This required me to do no small amount of hacking around in namespace.c
I have updated the \? help and sgml docs.
\dc - list conversions [PATTERN]
\dC - list casts
\dn list schemas
I didn't support patterns with casts as there's nothing obvious to match
against.
Tom Lane [Thu, 12 Dec 2002 20:35:16 +0000 (20:35 +0000)]
Preliminary code review for domain CHECK constraints patch: add documentation,
make VALUE a non-reserved word again, use less invasive method of passing
ConstraintTestValue into transformExpr, fix problems with nested constraint
testing, do correct thing with NULL result from a constraint expression,
remove memory leak. Domain checks still need much more work if we are going
to allow ALTER DOMAIN, however.
Tom Lane [Thu, 12 Dec 2002 15:49:42 +0000 (15:49 +0000)]
Phase 2 of read-only-plans project: restructure expression-tree nodes
so that all executable expression nodes inherit from a common supertype
Expr. This is somewhat of an exercise in code purity rather than any
real functional advance, but getting rid of the extra Oper or Func node
formerly used in each operator or function call should provide at least
a little space and speed improvement.
initdb forced by changes in stored-rules representation.
Bruce Momjian [Tue, 10 Dec 2002 22:27:45 +0000 (22:27 +0000)]
Add:
>
> * Wire Protocol Changes
> o Show transaction status in psql
> o Allow binding of query parameters, support for prepared queries
> o Add optional textual message to NOTIFY
> o Remove hard-coded limits on user/db/password names
> o Remove unused elements of startup packet (unused, tty, passlength)
> o Fix COPY/fastpath protocol?
> o Replication support?
> o Error codes
> o Dynamic character set handling
> o Special passing of binary values in platform-neutral format (bytea?)
> o ecpg improvements?
> o Add decoded type, length, precision
Add an unnecessary assignment to remove a bogus warning. I checked the
logic carefully and I am sure that the test against n happens after it
is assigned to.
Bruce Momjian [Mon, 9 Dec 2002 21:26:09 +0000 (21:26 +0000)]
I've simplified the Darwin/Mac OS X startup script I submitted earlier
in the year. This version has only the two files required by the Darwin
startup bundle design. Plus the sh script now uses Darwin-standard
functions to start up PostgreSQL, and it checks for the presence of a
variable in /etc/hostconfig, as do other Darwin startup scripts.
I suggest that a new directory be created,
contrib/start-scripts/darwin, and that these two files be put into it.
Folks who want to use the script can read the comments inside it to
figure out how to use it.
Bruce Momjian [Fri, 6 Dec 2002 05:20:28 +0000 (05:20 +0000)]
Attached are two small patches to expose md5 as a user function -- including
documentation and regression test mods. It seemed small and unobtrusive enough
to not require a specific proposal on the hackers list -- but if not, let me
know and I'll make a pitch. Otherwise, if there are no objections please apply.
Bruce Momjian [Fri, 6 Dec 2002 05:15:02 +0000 (05:15 +0000)]
Thank you very much, you catch it :). This bug had a long life, because it
exists if and only if locale of postmaster
was a different from C (or ru_RU.KOI8-R).
Please, apply patch for current CVS & 7.3.1
Magnus Naeslund(f) wrote:
> Ok, I nailed the bug, but i'm not sure what the correct fix is.
> Attached tsearch_morph.diff that remedies this problem by avoiding it.
> Also there's a debug aid patch if someone would like to know how i
> finally found it out :)
>
> There problem in the lemmatize() function is that GETDICT(...) returned
> a value not handled (BYLOCALE).
> The value (-1) and later used as an index into the dicts[] array.
> After that everything went berserk stack went crazy somehow so trapping
> the fault sent me to the wrong place, and every time i read the value it
> was positive ;)
>
> So now i just return the initial word passed to the lemmatize function,
> because i don't know what to do with it.
Bruce Momjian [Fri, 6 Dec 2002 03:46:37 +0000 (03:46 +0000)]
We have just finished porting the old KAME IPv6 patch over to
postgresql version 7.3, but yea... this patch adds full IPv6
support to postgres. I've tested it out on 7.2.3 and has
been running perfectly stable.
CREDITS:
The KAME Project (Initial patch)
Nigel Kukard <nkukard@lbsd.net>
Johan Jordaan <johanj@lando.co.za>
Bruce Momjian [Fri, 6 Dec 2002 03:44:14 +0000 (03:44 +0000)]
Some time ago John Gray <jgray@azuli.co.uk> and myself worked out and
tested a patch to contrib/xml where the existing code was causing
postgres to crash when it encountered & entities in the XML. I've
enclosed a patch that John came up with to correct this problem. It
patches against 7.3 and will apply on 7.2x if the elog WARNING calls
are changed to elog NOTICE.
Bruce Momjian [Fri, 6 Dec 2002 03:19:28 +0000 (03:19 +0000)]
PyGreSQL inserttable patch
=====================
I suggested an improvement of the inserttable in the PyGreSQL interface
already in January, but seemingly it was never implemented. I was told this
is the right place to get patches in for PyGreSQL, so I'm reposting my patch
here.
I consider the inserttable methode essential in populating the database
because of its benefits in performance compared to insert, so I think this
patch is quite essential. The attachment is an improved version of the
corresponding pg_inserttable function in pgmodule.c, which fixes the
following problems:
* The function raised exceptions because PyList_GetItem was used beyond the
size of the list. This was checked by comparing the result with NULL, but
the exception was not cleaned up, which could result in mysterious errors in
the following Python code. Instead of clearing the exception using
PyErr_Clear or something like that, I avoided throwing the exception at all
by at first requesting the size of the list. Using this opportunity, I also
checked the uniformity of the size of the rows passed in the lists/tuples.
The function also accepts (and silently ignores) empty lists and sublists.
* Python "None" values are now accepted and properly converted to PostgreSQL
NULL values
* The function now generates an error message in case of a line buffer
overflow
* It copes with tabulators, newlines and backslashes in strings now
* Rewrote the buffer filling code which should now run faster by avoiding
unnecessary string copy operations forth and back
Bruce Momjian [Thu, 5 Dec 2002 23:21:07 +0000 (23:21 +0000)]
As far as I figured from the source code this function only deals with
cleaning up locale names and nothing else. Since all the locale names
are in plain ASCII I think it will be safe to use ASCII-only lower-case
conversion.
Tom Lane [Thu, 5 Dec 2002 21:46:37 +0000 (21:46 +0000)]
Avoid pulling up sublinks from a subselect's targetlist. Works around
problems that occur if sublink is referenced via a join alias variable.
Perhaps this can be improved later, but a simple and safe fix is needed
for 7.3.1.
Tom Lane [Thu, 5 Dec 2002 15:50:39 +0000 (15:50 +0000)]
Phase 1 of read-only-plans project: cause executor state nodes to point
to plan nodes, not vice-versa. All executor state nodes now inherit from
struct PlanState. Copying of plan trees has been simplified by not
storing a list of SubPlans in Plan nodes (eliminating duplicate links).
The executor still needs such a list, but it can build it during
ExecutorStart since it has to scan the plan tree anyway.
No initdb forced since no stored-on-disk structures changed, but you
will need a full recompile because of node-numbering changes.
Tom Lane [Wed, 4 Dec 2002 20:00:37 +0000 (20:00 +0000)]
Repair oversight in recent change of dependency extraction code: when
recursing to handle a join alias var, the context had better be set to
be appropriate to the join var's query level. Per report from Hristo Neshev.
Tom Lane [Sun, 1 Dec 2002 21:05:14 +0000 (21:05 +0000)]
Teach planner to expand sufficiently simple SQL-language functions
('SELECT expression') inline, like macros, during the constant-folding
phase of planning. The actual expansion is not difficult, but checking
that we're not changing the semantics of the call turns out to be more
subtle than one might think; in particular must pay attention to
permissions issues, strictness, and volatility.
Tom Lane [Sun, 1 Dec 2002 20:27:32 +0000 (20:27 +0000)]
Fix ExecMakeTableFunctionResult() to work with generic expressions as
well as function calls. This is needed for cases where the planner has
constant-folded or inlined the original function call. Possibly we should
back-patch this change into 7.3 branch as well.
Tom Lane [Sun, 1 Dec 2002 18:14:22 +0000 (18:14 +0000)]
Run COPY OUT in a temporary memory context that's reset once per row,
and eliminate its manual pfree() calls. This solves the encoding-conversion
bug recently reported, and should be faster and more robust than the
original coding anyway. For example, we are no longer at risk if
datatype output routines leak memory or choose to return a constant string.
Tom Lane [Sat, 30 Nov 2002 21:25:08 +0000 (21:25 +0000)]
Code review for IS DISTINCT FROM patch. Fix incorrect constant-folding
logic, dissuade planner from thinking that 'x IS DISTINCT FROM 42' may
be optimized into 'x = 42' (!!), cause dependency on = operator to be
recorded correctly, minor other improvements.