Tom Lane [Sat, 6 Oct 2001 23:21:45 +0000 (23:21 +0000)]
Rearrange fmgr.c and relcache so that it's possible to keep FmgrInfo
lookup info in the relcache for index access method support functions.
This makes a huge difference for dynamically loaded support functions,
and should save a few cycles even for built-in ones. Also tweak dfmgr.c
so that load_external_function is called only once, not twice, when
doing fmgr_info for a dynamically loaded function. All per performance
gripe from Teodor Sigaev, 5-Oct-01.
Bruce Momjian [Fri, 5 Oct 2001 19:05:54 +0000 (19:05 +0000)]
files attached are Traditional Chinese translations translated
and modified from Simplified Chinese translations for backend,
pgsql, pg_dump and libpq. I've appended their names to zh_TW.po.
Tom Lane [Fri, 5 Oct 2001 17:28:13 +0000 (17:28 +0000)]
Further cleanup of dynahash.c API, in pursuit of portability and
readability. Bizarre '(long *) TRUE' return convention is gone,
in favor of just raising an error internally in dynahash.c when
we detect hashtable corruption. HashTableWalk is gone, in favor
of using hash_seq_search directly, since it had no hope of working
with non-LONGALIGNable datatypes. Simplify some other code that was
made undesirably grotty by promixity to HashTableWalk.
Tom Lane [Thu, 4 Oct 2001 22:39:34 +0000 (22:39 +0000)]
Don't try to hack pg_description if not superuser. (Really want a
COMMENT ON LARGE OBJECT command instead, but no time for it now.)
Fix some code that would not work with OIDs > 2G.
Tom Lane [Thu, 4 Oct 2001 22:06:46 +0000 (22:06 +0000)]
Consider interpreting a function call as a trivial (binary-compatible)
type coercion after failing to find an exact match in pg_proc, but before
considering interpretations that involve a function call with one or
more argument type coercions. This avoids surprises wherein what looks
like a type coercion is interpreted as coercing to some third type and
then to the destination type, as in Dave Blasby's bug report of 3-Oct-01.
See subsequent discussion in pghackers.
Tom Lane [Thu, 4 Oct 2001 22:00:10 +0000 (22:00 +0000)]
Ooops, I was a little too enthusiastic about suppressing default
index opclasses; they might be default for some other datatype,
in which case we mustn't suppress 'em.
Bruce Momjian [Thu, 4 Oct 2001 15:47:41 +0000 (15:47 +0000)]
This patch adds reporting of tcl global variable errorInfo
which contains stack trace.
One problem, after this patch errors will generate multiline ERROR
messages. Is it acceptable or do I need split it and generate multiple
singleline messages?
Bruce Momjian [Thu, 4 Oct 2001 15:46:49 +0000 (15:46 +0000)]
Attached is a patch which deals with
select 'id' as xxx from table
The issue is:
When the driver gets a data type which does not map into the SQL.Types
it attempts to load the object into a java object. Eventually throwing
an exception indicating that the type "unknown" was not found.
Since the backend defaults "unknown" types to text it was suggested that
the jdbc driver do the same.
This patch does just that.
I have tested it on the above select statement as well as a small
program that serializes, and deserializes a class
Bruce Momjian [Thu, 4 Oct 2001 15:45:49 +0000 (15:45 +0000)]
Using strtol() on int8 values (input parameters or result sets) in
plpython would result in numeric overflows causing the backend to
terminate abruptly.
Bruce Momjian [Thu, 4 Oct 2001 15:44:14 +0000 (15:44 +0000)]
I've just finished the Chinese NLS support(zh_CN part) files
translation,
the attachement is those four files.
(.tar.gz file, with the directory, root is $PGSRC).
Tested on some Linux platform.
Bruce Momjian [Thu, 4 Oct 2001 15:38:28 +0000 (15:38 +0000)]
Attached please find an initiation of the
NLS effort for the 'postgresql' component.
It includes 'ru.po', which should be added
to /src/backend/po/ and a typical patch for
nls.mk with the 'ru' entry added in
the AVAIL_LANGUAGES.
I'll submit a patch with more translations
for pg_dump once CVSweb becomes available.
CVSweb for me right now is the only way
to get to the source code until my system
is completely setup by the end of the week.
Tom Lane [Wed, 3 Oct 2001 21:58:28 +0000 (21:58 +0000)]
Consistently use gcc's __attribute__((format)) to check sprintf-style
format strings wherever possible. Remarkably, this exercise didn't
turn up any inconsistencies, but it seems a good idea for the future.
Tom Lane [Wed, 3 Oct 2001 20:54:22 +0000 (20:54 +0000)]
DROP AGGREGATE and COMMENT ON AGGREGATE now accept the expected syntax
'aggname (aggtype)'. The old syntax 'aggname aggtype' is still accepted
for backwards compatibility. Fix pg_dump, which was actually broken for
most cases of user-defined aggregates. Clean up error messages associated
with these commands.
Tom Lane [Wed, 3 Oct 2001 17:22:05 +0000 (17:22 +0000)]
Some further kibitzing on cachability of datetime functions.
In particular, mark all I/O functions that can produce or consume
a date as noncachable, in light of existence of DateStyle variable.
Tom Lane [Wed, 3 Oct 2001 15:50:48 +0000 (15:50 +0000)]
AdjustTimestampForTypmod does not work (at least not portably) on
-infinity and +infinity. Put TIMESTAMP_NOT_FINITE guard into the routine,
instead of forgetting it at some call sites. Fixes regression test
failures here.
Implement precision support for timestamp and time, both with and without
time zones.
SQL99 spec requires a default of zero (round to seconds) which is set
in gram.y as typmod is set in the parse tree. We *could* change to a
default of either 6 (for internal compatibility with previous versions)
or 2 (for external compatibility with previous versions).
Evaluate entries in pg_proc wrt the iscachable attribute for timestamp and
other date/time types. Try to recognize cases where side effects like the
current time zone setting may have an effect on results to decide whether
something is cachable or not.
Tom Lane [Tue, 2 Oct 2001 21:39:36 +0000 (21:39 +0000)]
Add CREATE OR REPLACE FUNCTION syntax to allow replacing a function
definition without changing the function's OID, thereby not breaking
rules, views, triggers, etc that depend on it. From Gavin Sherry.
Tom Lane [Mon, 1 Oct 2001 21:31:52 +0000 (21:31 +0000)]
Change pg_dump to produce CREATE INDEX commands by using the backend's
pg_get_indexdef() function, rather than reaching into the system catalogs
for itself. This eliminates a fair amount of redundant code. Also,
since I just changed pg_get_indexdef() to suppress display of default
index opclasses, this will mean that 7.2 and later dumps will not mention
opclasses unless they are non-default opclasses. Should make life easier
for future index opclass reorganizations.
Tom Lane [Mon, 1 Oct 2001 20:15:26 +0000 (20:15 +0000)]
Extend pg_get_indexdef() to know about index predicates. Also, tweak
it to suppress index opclass output for opclasses that are the default
for their datatype; only non-default opclasses are shown explicitly.
This is expected to improve portability of the CREATE INDEX command
across future versions of Postgres --- we've changed index opclasses
too often in the past to think we won't do so again.
Tom Lane [Mon, 1 Oct 2001 16:48:37 +0000 (16:48 +0000)]
Clean up a little more carefully around fork of pgstat subprocess.
Partial support for BEOS (not sure whether second fork of grandchild
process needs these extra calls or not; someone who has BEOS will need
to test it).
Bruce Momjian [Mon, 1 Oct 2001 15:33:31 +0000 (15:33 +0000)]
> > > > > - PostgreSQL requires to be compiled with --enable-multibyte
> > > > > and --enable-unicode-convertion if it ought to work correctly
> > > > > with Tcl/Tk >= 8.1 (client or server side).
> > > > >
> > > > > - PL/Tcl needs to be changed to use pg_do_encoding_conversion
> > > > > if it runs on a Tcl version >= 8.1 .
> > >
> > > > I'll do pl/tcl part in the next version of patch. Using this approach we
> > > > can eliminate overhead for databases in UNICODE.
> > >
> > > Any progress on this? I'd prefer to get rid of this --enable-pltcl-utf
> > > option before release.
> >
> > Done
> >
> > Next version removes --enable-pltcl-utf switch and enables embedded
> > utf conversion of pgsql if tcl version >=8.1 and --enable-unicode-conversion
Tom Lane [Mon, 1 Oct 2001 05:36:17 +0000 (05:36 +0000)]
Another round of cleanups for dynahash.c (maybe it's finally clean of
portability issues). Caller-visible data structures are now allocated
on MAXALIGN boundaries, allowing safe use of datatypes wider than 'long'.
Rejigger hash_create API so that caller specifies size of key and
total size of entry, not size of key and size of rest of entry.
This simplifies life considerably since each number is just a sizeof(),
and padding issues etc. are taken care of automatically.
Tom Lane [Sun, 30 Sep 2001 22:30:37 +0000 (22:30 +0000)]
Make libpq++ safe again for older C++ compilers. Do 'using namespace std'
only if configure found it was safe to do so; do not assume const_cast
is available.