I see someone missed an ancient bit of shell-scripting lore:
on some older shells, if your script's argument list is empty,
then "$@" generates an empty-string word rather than no word
at all. You need to write ${1+"$@"} to get the latter behavior.
(Read your shell man page to see exactly how that works,
but it does the Right Thing on every Bourne shell.)
In particular, pg_dumpall fails when invoked without any switches
on HPUX 9.*, because pg_dump gets an empty-string argument that it
thinks is the name of the database to dump. I expect this bug
also affects some other OSes, but couldn't tell you just which ones.
Patch attached.
The attached patches respond to discussion that was on pgsql-hackers
around the beginning of June (see thread "libpgtcl bug (and symptomatic
treatment)"). The changes are:
1. Remove code in connectDB that throws away the password after making
a connection. This doesn't really add much security IMHO --- a bad guy
with access to your client's address space can likely extract the
password anyway, to say nothing of what he might do directly. And
there's the serious shortcoming that it prevents PQreset() from working
if the database requires a password.
2. Fix coredump problem: fe_sendauth did not guard against being handed
a NULL password pointer. (This is the proximate cause of the coredump-
during-PQreset problem that Magosanyi Arpad complained of last month.)
I believe the consensus of the discussion last month was in favor of
#1 and #3, but I'm just now getting around to making the change.
I realized that #2 was a bug in process of looking at the change.
Attached are diffs (from current cvs sources) to bring libpq.sgml
and libpq.3 up to date.
It appears that at various times in the past, people have made edits to
one or the other of these files but not both. I propagated some changes
from each into the other, but I don't think I caught every
inconsistency. It'd be real nice if the man pages could be
automatically generated from the SGML...
Making PQrequestCancel safe to call in a signal handler turned out to be
much easier than I feared. So here are the diffs.
Some notes:
* I modified the postmaster's packet "iodone" callback interface to allow
the callback routine to return a continue-or-drop-connection return
code; this was necessary to allow the connection to be closed after
receiving a Cancel, rather than proceeding to launch a new backend...
Being a neatnik, I also made the iodone proc have a typechecked
parameter list.
* I deleted all code I could find that had to do with OOB.
* I made some edits to ensure that all signals mentioned in the code
are referred to symbolically not by numbers ("SIGUSR2" not "2").
I think Bruce may have already done at least some of the same edits;
I hope that merging these patches is not too painful.
Allow floating point constants for "def_arg" numeric arguments.
Used in the generic "CREATE xxx" parsing.
Do some automatic type conversion for inserts from other columns.
Previous trouble with "resjunk" regression test remains for now.
From: "Dr. Michael Meskes" <meskes@online-club.de>
+ Thu Jul 2 20:30:14 CEST 1998
+
+ - Changed new style db name to allow connection types "tcp" and
+ "unix" only
+
+ Tue Jul 7 15:14:14 CEST 1998
+
+ - Fixed some bugs in preproc.y
+ - Set version to 2.3.4
Bruce Momjian [Fri, 3 Jul 1998 04:24:16 +0000 (04:24 +0000)]
Hello!
Through some minor changes, I have been able to compile the libpq
client libraries on the Win32 platform. Since the libpq communications
part has been rewritten, this has become much easier. Enclosed is
a patch that will allow at least Microsoft Visual C++ to compile
libpq into both a static and a dynamic library. I will take a look
at porting the psql frontend as well, but I figured it was a good
idea to send in these patches first - so no major changes are done
to the files before it gets applied (if it does).
Marc G. Fournier [Fri, 19 Jun 1998 11:40:46 +0000 (11:40 +0000)]
From: t-ishii@sra.co.jp
As mentioned around line 1153 in backend/commands/copy.c, the method
of array checking is not perfect.
test=> create table t1 (i text);
test=> insert into t1 values('{\\.}');
INSERT 2645600 1
test=> select * from t1;
i
-----
{\\.}
(2 rows)
test=> copy t1 to '/tmp/aaa';
test=> copy t1 from '/tmp/aaa';
ERROR: CopyReadAttribute - end of record marker corrupted
Bruce Momjian [Tue, 16 Jun 1998 17:53:44 +0000 (17:53 +0000)]
> Sure send it in, we can put it in contrib. > > > > > I wrote a
real small function to revoke update on a column. The function >
> doesn't do anything > > fancy like checking user ids. > > > >
I copied most of it from the refint.c in the contrib directory.
> > > > Should I post this somewhere? It really isn't very big.
> >
Here it is...
--
| Email - rick@rpacorp.com
Rick Poleshuck | Voice - (908) 653-1070 Fax - (908) 653-0265
| Mail - RPA Corporation | - 308 Elizabeth
Avenue, Cranford, New Jersey 07016
Bruce Momjian [Tue, 16 Jun 1998 07:29:54 +0000 (07:29 +0000)]
Hi, here are the patches to enhance existing MB handling. This time
I have implemented a framework of encoding translation between the
backend and the frontend. Also I have added a new variable setting
command:
SET CLIENT_ENCODING TO 'encoding';
Other features include:
Latin1 support more 8 bit cleaness
See doc/README.mb for more details. Note that the pacthes are
against May 30 snapshot.
Bruce Momjian [Tue, 16 Jun 1998 07:18:16 +0000 (07:18 +0000)]
Here is the long awaited optimized version of the S_LOCK patch.
This incorporates all the precedeing patches and emailed suggestions
and the results of the performance testing I posted last week. I
would like to get this tested on as many platforms as possible so
I can verify it went in correctly (as opposed to the horrorshow
last time I sent in a patch).
Once this is confirmed, I will make a tarball of files that can be
dropped into a 6.3.2 source tree as a few people have asked for
this in 6.3.2 as well.
Bruce Momjian [Tue, 16 Jun 1998 06:52:15 +0000 (06:52 +0000)]
I've hacked up pg_dump so that it generates CONSTRAINT and CHECK
syntax that can be read back in with psql. I did this by adding
a
"-c" switch that controls moving the CONTSTRAINT statements inside
the CREATE TABLE statements and adding () around the CHECK arguments.
Here's diffs against the 6.3.2 version of pg_dump.c.
Bruce Momjian [Tue, 16 Jun 1998 06:42:02 +0000 (06:42 +0000)]
Hello!
Attached to the mail is locale-patch.tar.gz. In the archive
there are:
file README.locale
short description
directory src/test/locale
test suite; currently only koi8-r tests, but the suite can be
easily extended
file locale.patch
the very patch; to apply: patch < locale.patch; should be applied
to postgres-6.3.2 (at least I created it with 6.3.2 without any
additional
patches)
Files touched by the patch: src/include/utils/builtins.h
src/backend/utils/adt/char.c src/backend/utils/adt/varchar.c
src/backend/utils/adt/varlena.c
Bruce Momjian [Tue, 16 Jun 1998 04:34:30 +0000 (04:34 +0000)]
I investigated carefully POSTGRES data base (in idea to use it for
our internal IP routing data base, and because I have participated
in Ingres development here in Russia in RUBIN/DEMOS project -
through it was not freeware work - and it was very interesting for
me too see such good freeware data base as PostgreSQL), and I
modified 'ipaddr' data type library in accordance to our requests
and to allow SQL do indexing over ipaddr objects.
You can read description at 'http://relcom.EU.net/ipaddr.html' and
get sources at 'http://relcom.EU.net/ip_class.tar.gz'. It contains
sources, sql scripts for incorporating new data type into postgres
(including ipaddr_ops operator class incorporation) and 20,000
records based data test for the indexing.
I am not sure if it's proper mail list for this information, and
if it's interesting for anyone except me to get full-functional
ipaddress class. I am ready to make all modifications, bug fixing
and documentation for this data class if it's nessesary for it's
contribution to the Postgres data base.
Anyway, all my work was based at original 'ip&mac data type'
contribution, written by Tom Ivar Helbekkmo.
Be free to write me any questions or requests about this work.
==============================================================
Aleksei Roudnev, Network Operations Center, Relcom, Moscow (+7 095)
194-19-95 (Network Operations Center Hot Line),(+7 095) 239-10-10,
N 13729 (pager) (+7 095) 196-72-12 (Support), (+7 095) 194-33-28
(Fax)
Bruce Momjian [Tue, 16 Jun 1998 04:10:17 +0000 (04:10 +0000)]
The attached patch modifies libpgtcl per previous discussion: the
pg_notifies statement is eliminated, and callbacks defined by
pg_listen are instead invoked automatically from the Tcl idle loop
whenever a NOTIFY message is received.
I have done only cursory testing, so there may be problems still
lurking (particularly on non-Unix machines?). But it seems to
work.
Patch is against today's cvs sources. Note that this will not work
with the 6.3.2 release since it depends on the new libpq.
The diffs are a bit large so I've gzipped them. A patch to update
libpgtcl.sgml is included too.
Bruce Momjian [Tue, 16 Jun 1998 03:28:58 +0000 (03:28 +0000)]
Here are two patches to fix up the c++ (and c) support in the
configuration system. The idea is to make the configure arguments
that specify compilers to be compatible with the other --with
options. The main point, though, is that the c++ support is on by
default, but can easily be disabled by the --without-CXX option
for those few(?) that don't want it.