Tom Lane [Sat, 19 Feb 2000 22:10:47 +0000 (22:10 +0000)]
Get rid of postgres.c's separate parsing logic for PGDATESTYLE env.
variable, instead calling same code in variable.c that is used to parse
SET DATESTYLE. Fix bug: although backend's startup datestyle had been
changed to ISO, 'RESET DATESTYLE' and 'SET DATESTYLE TO DEFAULT' didn't
know about it. For consistency I have made the latter two reset to the
PGDATESTYLE-defined initial value, which may not be the same as the
compiled-in default of ISO.
Tom Lane [Sat, 19 Feb 2000 04:17:25 +0000 (04:17 +0000)]
Clean up scan.l's handling of \r vs \n --- they are reliably treated as
equivalent now, which should make Windows and Mac clients happier.
Also fix failure to handle SQL comments between segments of a multiline
quoted literal.
Tom Lane [Fri, 18 Feb 2000 06:32:39 +0000 (06:32 +0000)]
Replace inefficient _bt_invokestrat calls with direct calls to the
appropriate btree three-way comparison routine. Not clear why the
three-way comparison routines were being used in some paths and not
others in btree --- incomplete changes by someone long ago, maybe?
Anyway, this makes for a nice speedup in CREATE INDEX.
Tom Lane [Thu, 17 Feb 2000 03:40:02 +0000 (03:40 +0000)]
Finish repairing 6.5's problems with r-tree indexes: create appropriate
selectivity functions and make the r-tree operators use them. The
estimation functions themselves are just stubs, unfortunately, but
perhaps someday someone will make them compute realistic estimates.
Change pg_am so that the optimizer can reliably tell the difference
between ordered and unordered indexes --- before it would think that
an r-tree index can be scanned in '<<' order, which is not right AFAIK.
Repair broken negator links for network_sup and related ops.
Initdb forced. This might be my last initdb force for 7.0 ... hope so
anyway ...
Tom Lane [Thu, 17 Feb 2000 02:20:59 +0000 (02:20 +0000)]
Update expected/horology-no-DST-before-1970.out to match
new datetime regress test. Someone needs to deal with fixing
expected/horology-solaris-1947.out too, assuming we still need it.
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
Make ISO date style (e.g. "2000-02-16 09:33") the default.
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
Tom Lane [Wed, 16 Feb 2000 00:59:27 +0000 (00:59 +0000)]
Make eqsel produce better results for boolean columns,
and make scalarltsel a little more forgiving at the boundaries of the
known range of a column value.
Tom Lane [Tue, 15 Feb 2000 20:49:31 +0000 (20:49 +0000)]
New cost model for planning, incorporating a penalty for random page
accesses versus sequential accesses, a (very crude) estimate of the
effects of caching on random page accesses, and cost to evaluate WHERE-
clause expressions. Export critical parameters for this model as SET
variables. Also, create SET variables for the planner's enable flags
(enable_seqscan, enable_indexscan, etc) so that these can be controlled
more conveniently than via PGOPTIONS.
Planner now estimates both startup cost (cost before retrieving
first tuple) and total cost of each path, so it can optimize queries
with LIMIT on a reasonable basis by interpolating between these costs.
Same facility is a win for EXISTS(...) subqueries and some other cases.
Redesign pathkey representation to achieve a major speedup in planning
(I saw as much as 5X on a 10-way join); also minor changes in planner
to reduce memory consumption by recycling discarded Path nodes and
not constructing unnecessary lists.
Minor cleanups to display more-plausible costs in some cases in
EXPLAIN output.
Initdb forced by change in interface to index cost estimation
functions.
Carry column aliases from the parser frontend. Enables queries like
SELECT a FROM t1 tx (a);
Allow join syntax, including queries like
SELECT * FROM t1 NATURAL JOIN t2;
Update RTE structure to hold column aliases in an Attr structure.
Add "DEC" as synonym for "DECIMAL".
Add "SESSION_USER" as SQL92 keyword; equivalent to CURRENT_USER for now.
Implement column aliases (aka correlation names) and more join syntax.
Fix up indenting and tabbing.
Recognize special case of POSIX time zone: "GMT+8" and "GMT-8".
Still needs to be done for the general case:
"tz+/-#" where tz is a 3 char string.
This will probably involve moving code around to other places.
Bruce Momjian [Mon, 14 Feb 2000 12:33:19 +0000 (12:33 +0000)]
I suspect that you are not the person to send this to, but I wasn't sure
where else to mail it. I am the maintainer of unixODBC, and we have a
set of code in our project that started life as the Postgres windows
ODBC driver, which has been ported back to unix. Anyway I have just
fixed a memory leak in the driver, and I cant see any mention of the fix
being done in the main Postgres code, so I thougth I would let you know.
Its in the statement.c module, after the COMMIT statement has been
executed in SC_Execute, the code was
Bruce Momjian [Sun, 13 Feb 2000 18:59:53 +0000 (18:59 +0000)]
contrib-array.patch
this is an old patch which I have already submitted and never seen
in the sources. It corrects the datatype oids used in some iterator
functions. This bug has been reported to me by many other people.
contrib-datetime.patch
some code contributed by Reiner Dassing <dassing@wettzell.ifag.de>
contrib-makefiles.patch
fixes all my contrib makefiles which don't work with some compilers,
as reported to me by another user.
contrib-miscutil.patch
an old patch for one of my old contribs.
contrib-string.patch
a small change to the c-like text output functions. Now the '{'
is escaped only at the beginning of the string to distinguish it
from arrays, and the '}' is no more escaped.
elog-lineno.patch
adds the current lineno of CopyFrom to elog messages. This is very
useful when you load a 1 million tuples table from an external file
and there is a bad value somehere. Currently you get an error message
but you can't know where is the bad data. The patch uses a variable
which was declared static in copy.c. The variable is now exported
and initialized to 0. It is always cleared at the end of the copy
or at the first elog message or when the copy is canceled.
I know this is very ugly but I can't find any better way of knowing
where the copy fails and I have this problem quite often.
plperl-makefile.patch
fixes a typo in a makefile, but the error must be elsewhere because
it is a file generated automatically. Please have a look.
tprintf-timestamp.patch
restores the original 2-digit year format, assuming that the two
century digits don't carry much information and that '000202' is
easier to read than 20000202. Being only a log file it shouldn't
break anything.
Please apply the patches before the next scheduled code freeze.
I also noticed that some of the contribs don't compile correcly. Should we
ask people to fix their code or rename their makefiles so that they are
ignored by the top makefile?
Bruce Momjian [Sun, 13 Feb 2000 13:21:11 +0000 (13:21 +0000)]
2. trigger.c fails to compile due to a syntax error. It contains
a switch statement that has an empty default label. A label of a
switch statement must be followed by a statement (or a label which
is followed by a statement (or a label which ...)).
3. Files include stringinfo.h failed to compile. The macro,
'appendStringInfoCharMacro' is implemented with a '?:' operation
that returns a void expression for the true part and a char expresion
for the false part. Both the true and false parts of the '?:' oper-
ator must return the same type.
Bruce Momjian [Wed, 9 Feb 2000 16:23:44 +0000 (16:23 +0000)]
I checked the WinNT port yesterday (a few days old snapshot from CVS) and I
am including a patch to get it compile.
changes to psql:
- added less as default pager when compiling on Cygwin
- need to declare "filename_completion_function" because it is not exported
from readline -> added to include/port/win.h
changes to pg_id:
- include of <getopt.h>
- add .exe when installing
I think there is a problem with calling the regress tests on WinNT - it
should be called with PORTNAME not HOST as the parameter to regress.sh or
the check when to add "-h localhost" to psql has to be changed. Now it is
checked against the PORTNAME.
The results of the regress tests were OK with expected failures ;-)
Bruce Momjian [Tue, 8 Feb 2000 15:58:54 +0000 (15:58 +0000)]
yesterday I had a problem with initdb. I set bad environment values
and initdb crashs (I set pglib path to PG 6.5.3 directory instead to
7.0 and initdb take this BKI old templates ... (initdb not check
BKI version and BKI files not has any version comments (TODO?))
This patch add to the initdb --show option which show setting of all
initdb's values. It spare developers time if in setting is bug.
Karel
----------------------------------------------------------------------
Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/
Bruce Momjian [Tue, 8 Feb 2000 15:57:01 +0000 (15:57 +0000)]
I'm sending patch with new version of to_char numbers formatting.
The PostgreSQL's to_char() is very compatible with Oracle's to_char
now. I hope that to_char's 3000 rows of source is without bugs, but
will good if anyone test it, for me it works very well :-)
Karel
----------------------------------------------------------------------
Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/
Tom Lane [Mon, 7 Feb 2000 04:41:04 +0000 (04:41 +0000)]
Repair planning bugs caused by my misguided removal of restrictinfo link
fields in JoinPaths --- turns out that we do need that after all :-(.
Also, rearrange planner so that only one RelOptInfo is created for a
particular set of joined base relations, no matter how many different
subsets of relations it can be created from. This saves memory and
processing time compared to the old method of making a bunch of RelOptInfos
and then removing the duplicates. Clean up the jointree iteration logic;
not sure if it's better, but I sure find it more readable and plausible
now, particularly for the case of 'bushy plans'.
Tom Lane [Sun, 6 Feb 2000 03:27:35 +0000 (03:27 +0000)]
Rename same() to sameseti() to have a slightly less generic name. Move
nonoverlap_sets() and is_subset() to list.c, where they should have lived
to begin with, and rename to nonoverlap_setsi and is_subseti since they
only work on integer lists.
Tom Lane [Sat, 5 Feb 2000 18:26:09 +0000 (18:26 +0000)]
Further cleanup for OR-of-AND WHERE-clauses. orindxpath can now handle
extracting from an AND subclause just those opclauses that are relevant
for a particular index. For example, we can now consider using an index
on x to process WHERE (x = 1 AND y = 2) OR (x = 2 AND y = 4) OR ...