Bruce Momjian [Fri, 9 Jun 2000 17:27:57 +0000 (17:27 +0000)]
This patch fixes the 0-based/1-based result set indexing problem for
absolute. It also makes it more compliant with the interface
specification in Sun's documentation;
1. absolute(0) should throw an exception.
2. absolute(>num-records) should set the current row to after the last
record in addition to returning false.
3. absolute(<num-records) should set the current row to before the first
record in addition to returning false.
These operations in the existing code just return false and don't change
current_row.
These changes required a minor change to relative(int) since it calls
absolute(int)
The attached patch is against the cvs repository tree as of this morning.
Also, who is in charge of maintaining the jdbc driver? I'm working on
getArray for the jdbc2 driver, but it's going to require three more
classes to be added to the driver, and thus three more source files
in the repository. Is there someone I can contact directly to ask about
this?
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
Bruce Momjian [Fri, 9 Jun 2000 15:51:02 +0000 (15:51 +0000)]
I have large database and with this DB work more users and I very need
more restriction for fretful users. The current PG allow define only
NO-CREATE-DB and NO-CREATE-USER restriction, but for some users I need
NO-CREATE-TABLE and NO-LOCK-TABLE.
This patch add to current code NOCREATETABLE and NOLOCKTABLE feature:
Bruce Momjian [Fri, 9 Jun 2000 03:18:34 +0000 (03:18 +0000)]
The enclosed patch changes the behaviour of the "ordinal" ('TH') format for
to_char. I don't know about the rest of the world, but the "standard" in
Australia is the following:
I think you see the trend. The current code works fine except that it
produces:
111st, 112nd, 113rd, 114th - 119th
211st, 212nd, 213rd, 214th - 219th ... and so on.
Without knowing anything about what's supported (and what isn't) in the usual
I18N libraries, should this type of behaviour be defined within the locales?
Tom Lane [Fri, 9 Jun 2000 01:29:28 +0000 (01:29 +0000)]
If we're gonna have people running make from the top directory now,
we'd better have a Makefile here to prevent the mistake of using
vannilla make instead of gmake. (But let's leave src/Makefile where
it is, too.)
Bruce Momjian [Wed, 7 Jun 2000 20:01:20 +0000 (20:01 +0000)]
Here is a patch for interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java
It addresses three issues:
1. The problem with ResultSet's interface specifying 1-based indexing was
not quite fixed in 7.0.2. absolute would stop the user form moving to the
first record (record 0 internally).
2. Absolute did not set current_row
3. For field.mod=-1, GetObject would try to return numeric values with a
precision of around 65000. Now GetObject detects when field.mod==-1, and
passes that as the scale to getBigDecimal. getBigDecimal detects when a
-1 is passed and simply does not scale the value returned. You still get
the correct value back, it simply does not tweak the precision.
I'm working off of a source tree I just checked out from the
repository. The diff is based on what was in the repository about ten
minutes ago.
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------
Gen_fmgrtab.sh is strange: it is a platform dependent way (because it uses
CPP) to create platform independent files. Unfortunately, that means that
every config.status (or configure) run invariably causes a relink of the
postmaster and also that we can't put these files in the distribution
(usefully). So we make it a little smarter: when the output files already
exist and it notices that it would recreate them in identical form, it
doesn't touch them. In order to avoid re-running the make rule all the time
we update a timestamp file instead.
Update release_prep accordingly. Also make Gen_fmgrtab.sh use the awk that
is detected at configure time, not necessarily named `awk' and have it check
for exit statuses a little better.
In other news... Remove USE_LOCALE from the templates, it was set to `no'
everywhere anyway. Also remove YACC and YFLAGS from the templates, configure
is smart enough to find bison or yacc itself. Use AC_PROG_YACC for that
instead of the hand-crafted code. Do not set YFLAGS to `-d'. The make rules
that need this flag should explicitly invoke it. YFLAGS should be a user
variable. Update the makefiles to that effect.
Moved configure script from src/ to the top level directory. Moved
configuration helper things into config/ dir. Adjusted some relative paths
in makefiles.
Tom Lane [Tue, 6 Jun 2000 17:44:25 +0000 (17:44 +0000)]
init_fcache was being careless about using SearchSysCacheTuple result
over multiple lookups --- it should use SearchSysCacheTupleCopy instead.
This accounts for rare failures like 'init_fcache: null probin for procedure 481'
when running concurrently with a VACUUM.
Tom Lane [Tue, 6 Jun 2000 16:50:37 +0000 (16:50 +0000)]
typeTypeName() must return a pstrdup'd copy of the type name, not a
direct pointer into the syscache entry for the type. In some cases
the syscache entry might get flushed before we are done using the
returned type name. This bug accounts for difficult-to-repeat
failures seen when INSERTs into columns of certain data types are
run in parallel with VACUUMs of system tables. There may be related
problems elsewhere --- we need to take a harder look at uses of
syscache data.
Peter Mount [Tue, 6 Jun 2000 11:06:09 +0000 (11:06 +0000)]
Added org/postgresql/DriverClass.java to the list of files removed by make clean (it's dynamically built)
Fixed Statement, so that the update count is valid when an SQL DELETE operation is done.
While fixing the update count, made it easier to get the OID of the last insert as well. Example is in example/basic.java
Tom Lane [Mon, 5 Jun 2000 07:29:25 +0000 (07:29 +0000)]
Latest round of fmgr updates. All functions with bool,char, or int2
inputs have been converted to newstyle. This should go a long way towards
fixing our portability problems with platforms where char and short
parameters are passed differently from int-width parameters. Still
more to do for the Alpha port however.
Tom Lane [Mon, 5 Jun 2000 07:16:13 +0000 (07:16 +0000)]
Simplify build/install process for bki and description files. There's
no reason for them to be copied into src/backend rather than being
installed straight from the catalog subdirectory. This also avoids
some peculiar behavior (bugs?) present in at least gmake 3.78.1: it
won't always update the bki files in backend/ even when the ones in
backend/catalog/ are newer.
Tom Lane [Sun, 4 Jun 2000 22:08:53 +0000 (22:08 +0000)]
If user re-DECLAREs an existing cursor name, close the old cursor of
that name and issue a NOTICE to the effect that we did. Previously,
code would try to assign the new cursor declaration to the old portal,
but this didn't work reliably since new parsetree is still sitting in
blank portal and is likely to get clobbered.
Tom Lane [Sun, 4 Jun 2000 20:50:50 +0000 (20:50 +0000)]
Repair bug reported by ldm@apartia.com: Append nodes, which don't
actually use their targetlist, are given a targetlist that is just a
pointer to the first appended plan's targetlist. This is OK, but what
is not OK is that any sub-select expressions in said tlist were being
entered in the subPlan lists of both the Append and the first appended
plan. That led to two startup and two shutdown calls for the same
plan node at exec time, which led to crashes. Fix is to not generate
a list of subPlans for an Append node. Same problem and fix apply
to other node types that don't have a real, functioning targetlist:
Material, Sort, Unique, Hash.
Tom Lane [Fri, 2 Jun 2000 04:04:54 +0000 (04:04 +0000)]
If create/drop database are going to call closeAllVfds(), they ought
to do it at the last moment before calling system() ... not at some
randomly-chosen earlier point in the routine ...
Tom Lane [Fri, 2 Jun 2000 03:58:34 +0000 (03:58 +0000)]
Create an fd.c entry point that is just like plain open(2) except that
it will close VFDs if necessary to surmount ENFILE or EMFILE failures.
Make use of this in md.c, xlog.c, and user.c routines that were
formerly vulnerable to these failures. In particular, this should
handle failures of mdblindwrt() that have been observed under heavy
load conditions. (By golly, every other process on the system may
crash after Postgres eats up all the kernel FDs, but Postgres will
keep going!)
Tom Lane [Fri, 2 Jun 2000 02:00:28 +0000 (02:00 +0000)]
Correct portability problem introduced by yours truly --- I used a
conditional expression x?y:z in an awk program. Seems old versions
of awk don't have that ...
Tom Lane [Wed, 31 May 2000 15:38:53 +0000 (15:38 +0000)]
Tweak recognition of range-clause pairs so that 'var > $1 AND var < $2'
(ie, parameters instead of consts) will be treated as a range query.
We do not know the actual selectivities involved, but it seems like
a good idea to use a smaller estimate than we would use for two unrelated
inequalities.
Peter Eisentraut [Wed, 31 May 2000 00:28:42 +0000 (00:28 +0000)]
The heralded `Grand Unified Configuration scheme' (GUC)
That means you can now set your options in either or all of $PGDATA/configuration,
some postmaster option (--enable-fsync=off), or set a SET command. The list of
options is in backend/utils/misc/guc.c, documentation will be written post haste.
pg_options is gone, so is that pq_geqo config file. Also removed were backend -K,
-Q, and -T options (no longer applicable, although -d0 does the same as -Q).
Tom Lane [Tue, 30 May 2000 04:25:00 +0000 (04:25 +0000)]
Third round of fmgr updates: eliminate calls using fmgr() and
fmgr_faddr() in favor of new-style calls. Lots of cleanup of
sloppy casts to use XXXGetDatum and DatumGetXXX ...
Tom Lane [Mon, 29 May 2000 20:18:30 +0000 (20:18 +0000)]
Tweak fmgrtab generation so that the F_XXX macros that give OIDs for
built-in procedures are named after the prosrc field of pg_proc (ie,
the actual C function name), not the proname field. This did not use
to make a difference back when the two were always the same, but in the
presence of overloaded proname values we'd best try to use the C name
instead. AFAICT this change affects no existing code, but it is
necessary to be able to get at some built-in functions that no macro
was being generated for before.
Tom Lane [Mon, 29 May 2000 19:16:57 +0000 (19:16 +0000)]
Repair problems with overrun of timezone name length. Increase MAXTZLEN
to 10, and be consistent about whether it counts the trailing null (it
does not). Also increase MAXDATELEN to be sure no buffer overflows are
caused by the longer MAXTZLEN.