Peter Eisentraut [Sat, 28 Oct 2000 22:14:14 +0000 (22:14 +0000)]
Make initdb safe against using
a) mismatching backend program, by checking --version output
b) mismatching bki files, by putting a version-identifying comment atop
those files.
Bruce Momjian [Sat, 28 Oct 2000 15:44:04 +0000 (15:44 +0000)]
Okay, here's my attempt at fixing the problems with parentheses in
subqueries. It passes the normal 'runcheck' tests, and I've tried
a few simple things like
select 1 as foo union (((((select 2))))) order by foo;
There are a few things that it doesn't do that have been talked
about here at least a little:
1) It doesn't allow things like "IN(((select 1)))" -- the select
here has to be at the top level. This is not new.
2) It does NOT preserve the odd syntax I found when I started looking
at this, where a SELECT statement could begin with parentheses. Thus,
(SELECT a from foo) order by a;
fails.
I have preserved the ability, used in the regression tests, to
have a single select statement in what appears to be a RuleActionMulti
(but wasn't -- the parens were part of select_clause syntax).
In my version, this is a special form.
This may cause some discussion: I have differentiated the two kinds
of RuleActionMulti. Perhaps nobody knew there were two kinds, because
I don't think the second form appears in the regression tests. This
one uses square brackets instead of parentheses, but originally was
otherwise the same as the one in parentheses. In this version of
gram.y, the square bracket form treats SELECT statements the same
as the other allowed statements. As discussed before on this list,
psql cannot make sense out of the results of such a thing, but an
application might. And I have designs on just such an application.
Peter Eisentraut [Fri, 27 Oct 2000 23:59:39 +0000 (23:59 +0000)]
Make use of system-specific linker option to embed shared library search
path into executables and shared libraries (-rpath or -R for most). Can be
disabled with --disable-rpath, since some binary packaging standards do not
like this option.
Tom Lane [Fri, 27 Oct 2000 01:55:23 +0000 (01:55 +0000)]
Disallow bits beyond the mask length for CIDR values, per discussion
on pghackers. Arrange for the sort ordering of general INET values
to be network part as major sort key, host part as minor sort key.
I did not force an initdb for this change, but anyone who's running
indexes on general INET values may need to recreate those indexes.
Tom Lane [Thu, 26 Oct 2000 21:38:24 +0000 (21:38 +0000)]
Re-implement LIMIT/OFFSET as a plan node type, instead of a hack in
ExecutorRun. This allows LIMIT to work in a view. Also, LIMIT in a
cursor declaration will behave in a reasonable fashion, whereas before
it was overridden by the FETCH count.
Tom Lane [Wed, 25 Oct 2000 19:44:44 +0000 (19:44 +0000)]
Support SET/SHOW/RESET client_encoding and server_encoding even when
MULTIBYTE support is not compiled (you just can't set them to anything
but SQL_ASCII). This should reduce interoperability problems between
MB-enabled clients and non-MB-enabled servers.
Tom Lane [Wed, 25 Oct 2000 18:56:16 +0000 (18:56 +0000)]
Accept CREATE DATABASE WITH ENCODING 'SQL_ASCII' even when MULTIBYTE
support is not present. This allows a non-MB server to load a pg_dumpall
script produced by an MB-enabled server, so long as only ASCII encoding
was used.
Peter Eisentraut [Wed, 25 Oct 2000 16:13:52 +0000 (16:13 +0000)]
Rearrange handling of -L linker options so that they are always before all
the -l options. (This was not the case when using the OpenSSL or Kerberos
options.) Also make sure that shared library links get to see all the -L
options. Get Kerberos 5 support to compile on Redhat 7.0. Add OpenSSL and
-lsocket (if used/found) to libpq link.
From Zoltan Kovacs back in April (sorry for the delay Zoltan!):
I modified the current ODBC driver for
* referential integrity error reporting,
* SELECT in transactions and
* disabling autocommit.
I tested these changes with Borland C++ Builder -> ODBCExpress ->
WinODBC driver (DLL) -> Postgres 7.0beta1 and Borland C++ Builder -> BDE ->
WinODBC driver (DLL) -> Postgres 7.0beta1. The patch is based on snapshot of
22th April (I don't think that someone has modified it since that: Byron
hasn't gave any sign of living for about a month and I didn't find any
comments about the ODBC driver on the list).
Tom Lane [Tue, 24 Oct 2000 20:59:35 +0000 (20:59 +0000)]
Do not execute fastpath function calls if in transaction ABORT state.
Just like queries, doing nothing is better than possibly getting weird
error messages. Also, improve comments.
Tom Lane [Tue, 24 Oct 2000 20:06:39 +0000 (20:06 +0000)]
Fix AbortOutOfAnyTransaction logic to avoid notice about
'AbortTransaction and not in in-progress state' when client disconnects
just after an error. Notice seems pretty harmless, so I'm not going
to worry about back-patching this into 7.0.* ...
Peter Eisentraut [Tue, 24 Oct 2000 17:41:50 +0000 (17:41 +0000)]
Don't call AC_SUBST (in libtool.m4) before AC_INIT. The m4 diversions get
messed up and we end up with the comments from included files in the output
"configure".
Tom Lane [Tue, 24 Oct 2000 03:34:53 +0000 (03:34 +0000)]
Reconsider page size for large objects: rather than stuffing disk pages
as full as possible, seems better to use a tuple size around BLCKSZ/4
so that less space is wasted when a LO tuple is updated. Also, this
lets us use a logical page size that's an exact power of two, avoiding
partial-page writes when client is sending us stuff in power-of-2
buffer chunks.
Tom Lane [Tue, 24 Oct 2000 03:14:08 +0000 (03:14 +0000)]
Remove arbitrary limit on number of simultaneously open large objects.
This used to make some sense under the old implementation, but now an
open LO is pretty darn cheap, so why restrict it?
Tom Lane [Tue, 24 Oct 2000 01:38:44 +0000 (01:38 +0000)]
Major overhaul of large-object implementation, by Denis Perchine with
kibitzing from Tom Lane. Large objects are now all stored in a single
system relation "pg_largeobject" --- no more xinv or xinx files, no more
relkind 'l'. This should offer substantial performance improvement for
large numbers of LOs, since there won't be directory bloat anymore.
It'll also fix problems like running out of locktable space when you
access thousands of LOs in one transaction.
Also clean up cruft in read/write routines. LOs with "holes" in them
(never-written byte ranges) now work just like Unix files with holes do:
a hole reads as zeroes but doesn't occupy storage space.
INITDB forced!
Tom Lane [Mon, 23 Oct 2000 23:42:04 +0000 (23:42 +0000)]
If a field is incompressible ('compressed' data is actually larger than
source, due to addition of header overhead), store it as plain data
rather than pseudo-compressed data. This saves a few microseconds when
reading it out, but much more importantly guarantees that the toaster
won't actually expand tuples that contain incompressible data. That's
essential to avoid 'Tuple too big' failures with large objects.
Peter Eisentraut [Mon, 23 Oct 2000 21:44:12 +0000 (21:44 +0000)]
Polish shared library build to reduce number of special hacks. In
particular, allow linking with arbitrary commands rather than only $(AR) or
$(LD), and treat C++ without hacks.
Add option to disable shared libraries. This takes the place of the
BSD_SHLIB variable. The regression test driver ignores the plpgsql test
if there are no shared libraries available.
Vadim B. Mikheev [Mon, 23 Oct 2000 04:10:24 +0000 (04:10 +0000)]
New relcache hash table with RelFileNode as key to be used
from bufmgr - it would be nice to have separate hash in smgr
for node <--> fd mappings, but for the moment it's easy to
add new hash to relcache.
Fixed small bug in xlog.c:ReadRecord.
Tom Lane [Sun, 22 Oct 2000 23:32:48 +0000 (23:32 +0000)]
Some small polishing of Mark Hollomon's cleanup of DROP command: might
as well allow DROP multiple INDEX, RULE, TYPE as well. Add missing
CommandCounterIncrement to DROP loop, which could cause trouble otherwise
with multiple DROP of items affecting same catalog entries. Try to
bring a little consistency to various error messages using 'does not exist',
'nonexistent', etc --- I standardized on 'does not exist' since that's
what the vast majority of the existing uses seem to be.
Peter Eisentraut [Sun, 22 Oct 2000 22:15:13 +0000 (22:15 +0000)]
Makeover for Unixware 7.1.1
* Makefile: Add more standard targets. Improve shell redirection in GNU
make detection.
* src/backend/access/transam/rmgr.c: Fix incorrect(?) C.
* src/backend/libpq/pqcomm.c (StreamConnection): Work around accept() bug.
* src/include/port/unixware.h: ...with help from here.
* src/backend/nodes/print.c (plannode_type): Remove some "break"s after
"return"s.
* src/backend/tcop/dest.c (DestToFunction): ditto.
* src/backend/nodes/readfuncs.c: Add proper prototypes.
* src/backend/utils/adt/numutils.c (pg_atoi): Cope specially with strtol()
setting EINVAL. This saves us from creating an extra set of regression test
output for the affected systems.
* src/include/storage/s_lock.h (tas): Correct prototype.
* src/interfaces/libpq/fe-connect.c (parseServiceInfo): Don't use variable
as dimension in array definition.
* src/makefiles/Makefile.unixware: Add support for GCC.
* src/template/unixware: same here
* src/test/regress/expected/abstime-solaris-1947.out: Adjust whitespace.
* src/test/regress/expected/horology-solaris-1947.out: Part of this file
was evidently missing.
* src/test/regress/pg_regress.sh: Fix shell. mkdir -p returns non-zero if
the directory exists.
* src/test/regress/resultmap: Add entries for Unixware.
Tom Lane [Sun, 22 Oct 2000 20:20:49 +0000 (20:20 +0000)]
Fix incorrect logic for clearing BufferDirtiedByMe in ReleaseRelationBuffers
and DropBuffers. Formerly we cleared the flag for each buffer currently
belonging to the target rel or database, but that's completely wrong!
Must look at BufferTagLastDirtied to see whether the BufferDirtiedByMe
flag is relevant to target rel or not; this is *independent* of the
current contents of the buffer. Vadim spotted this problem, but his
fix was only partially correct...
Tom Lane [Sun, 22 Oct 2000 19:49:43 +0000 (19:49 +0000)]
Patch VACUUM problem with moving chain of update tuples when source
and destination of a tuple lie on the same page.
(Previously fixed in REL7_0 branch, now apply to current.)
Philip Warner [Sun, 22 Oct 2000 17:55:49 +0000 (17:55 +0000)]
Add new datlastsysoid to pg_database.
This field stores the last allocated OID after the database was created.
Used by pg_dump in deciding what is user-defined vs. system-defined.
Peter Eisentraut [Sat, 21 Oct 2000 22:36:14 +0000 (22:36 +0000)]
Move DLSUFFIX, AROPT, and CFLAGS_SL settings from template to
Makefile.port, since they are of no use to configure and much of the
library magic happens in Makefile.port anyway.
Use __alpha, not __alpha__, since the former is universally available.
Remove -DNOFIXADE from the compile command line and put it in the port
include file.
Bruce Momjian [Sat, 21 Oct 2000 15:55:29 +0000 (15:55 +0000)]
here it is as requested by Bruce.
I tested it restoring my database with > 100000 BLOBS, and dumping it out.
But unfortunatly I can not restore it back due to problems in pg_dump.
Peter Eisentraut [Fri, 20 Oct 2000 21:04:27 +0000 (21:04 +0000)]
Add support for VPATH builds, that is, building somewhere else than in the
source directory. This involves mostly makefiles using $(srcdir) when they
might have used ".". (Regression tests don't work with this, yet.)
Sort out usage of CPPFLAGS, CFLAGS (and CXXFLAGS). Add "override" keyword
in most places, to preserve necessary flags even when the user overrode the
flags.
Remove ZP4, ZP5, ZP6 from docs since the current parser won't accept
time zones with embedded numerals (parsing to a meaninless "ZP 4"
instead).
Support "SAT" as an Australian time zone if USE_AUSTRALIAN_RULES
is defined.
Fix units in exposition on Julian calendar (from Lazer Henry I think...)
Tom Lane [Fri, 20 Oct 2000 03:45:35 +0000 (03:45 +0000)]
Remove 'override' keyword, which breaks the build on HPUX, and probably
anywhere else that Makefile.shlib needs to modify CFLAGS to produce
valid code for a shared library. I'm not real clear on *why* the use
of override causes make to ignore the later attempt to assign
CFLAGS +=
but it indubitably does --- at least on gmake 3.79.1. gmake bug?