Subject: [PATCHES] sequences display in psql
Well, I am away at Progress training (not Postgres!!) and desided to do
this patch during a break. This will allow listing of sequences in
addition to listing of tables and indicies:
\d would should indicies, tables, and sequences
\ds would show sequences only.
Subject: [PATCHES] psql and large objects fix
Psql was broken by using "Inv[0-9]+" instead of "xin[xv][0-9]+" to not
show large object files. Been this way for a long time too. Relic of
an older naming convention, perhaps?
Subject: [PATCHES] More psql and libpq patches
Well..these would be the last patches until the release (I hope)...
I ran the regression tests while watching psql under purify, and it did
not leak even one byte.
In this patch:
* Plugged a major leak when PSQL reads files for input (either through
\i options or through -f option)
* Fixed the one remaining leak in PSQL in not clearing PGresult *results
everywhere it is supposed to. (Thanks Tymm)
* Fixed A small leak in PSQL not clearing all the PGsettings correctly.
* A not-so-obvious (but small) leak in Libpq when PQsetdb fails for any
reason.
* Added \n to some Libpq error messages to make them easier to digest..
* Finally, added /* PURIFY */ comment to some of the code indicating
the reason for why it was added/changed...for future developers.
psql.c: In function `HandleSlashCmds':
psql.c:1141: warning: `optarg3' might be used uninitialized in this function
psql.c:1157: warning: `optarg3' might be used uninitialized in this function
-> char *optarg3 = NULL;
Subject: [PATCHES] patch for a memory leak
Well...I screwed up and posted the wrong patch for psql originally..
The patch for that patch wposted below will fix it..
Subject: [PATCHES] Another destroydb patch
This is a patch to my previous destroydb patch cause some people wanted
slightly different behavior. After this patch is applied, destroydb
will destroy a database as usual, but if added -i flag (which could be
aliased like rm -i) would ask for confirmation.
Subject: [PATCHES] pg_dump memory leak patch
This patch fixes a HUGE memory leak problem in pg_dump.
Pretty much anything that was allocated was never freed and Purify
reported about 40% possible memory leak and 6% actual leak. I added
functions to clear out all the allocated structures. After the patch
Purify returns 0 for number of bytes leaked...
Subject: [PATCHES] psql - \dt,\di commands.
I sent this a couple of months ago in re a request by Maxim
Kozin, but I had the patch reversed, creating some confusion
over applying it.
Here's a more complete version.
Adds \dt to list only tables/views and \di to list only
indicies. \d will still work as before.
Subject: [PATCHES] destroydb patch
I am including a patch for destroydb to ask for confirmation before
deleting databases (after I accidentally deleted mine)...destroydb -y
would force delete without any confirmation.
Subject: [PATCHES] memory leak patches in libpq and psql
A couple of small memory leak patches (detected with Purify) primarily
in libpq.
* Fixed (NULL) border problem in psql (run psql, do \m, then select
something from a table...row separators will be nulls)
* Fixed memory leak with the abovementioned border not being freed
properly.
* Fixed memory leak in freePGconn() not freeing conn->port
* Fixed up PQclear() to free parts of PGresult only if these
parts are not null.
* Fixed a decent memory leak that occured after executing every command
in psql. PGresult *results was not freed most of the time.
There is still a leak being detected (2 bytes) in readline functions, but
I think this is old readline library. I will install new one and test it.
Subject: [PATCHES] Three small patches.
Hi,
Here are 3 small patches to the postgreSQL source sup'd on
the 6th May 1997.
The 1st 2 fix the shell backslash "c" handling used to suppress
the newline on some unix shells. (The \c needs to be inside quote.)
The 3rd may or may not be the correct way to fix the missing
define of INDEX_MAX_KEYS in pg_dump.h
FreeBSD
The Makefile(s) have all been cleaned up such that there is a single
LDFLAGS vs LD_ADD or LDADD or LDFLAGS or LDFLAGS_BE. The Makefile(s)
should be alot more straightforward then they were before...and
consistent
Subject: [HACKERS] password authentication
This patch adds support for plaintext password authentication. To use
it, you add a line like
host all 0.0.0.0 0.0.0.0 password pg_pwd.conf
to your pg_hba.conf, where 'pg_pwd.conf' is the name of a file containing
the usernames and password hashes in the format of the first two fields
of a Unix /etc/passwd file. (Of course, you can use a specific database
name or IP instead.)
Then, to connect with a password through libpq, you use the PQconnectdb()
function, specifying the "password=" tag in the connect string and also
adding the tag "authtype=password".
I also added a command-line switch '-u' to psql that tells it to prompt
for a username and password and use password authentication.
${DATADIR}. The file is left as pg_geqo.sample, since, unlike
pg_hba.conf, it isn't a required file...but this way ppl know that
its there, and that its where it is required, if they choose to
use it
Add a check to configure for strdup
Remove all the '-ltermcap' checks from psql/Makefile
Have {psql,pg_dump}/Makefile modified if strdup doesn't exist on the system
|by neglecting to quote them.
|
|I have made a minor change to pg_dump.c that will fix this.
|
|Dates are dumped and restored OK with pg_dump in V6
|
|We'll still need to fix the dump in both cases if the original dump is from V1.09.
From Keith Parks
be #ifdef'd into psql.c itself
From what I can tell, if USE_READLINE is true or false, psql works under
FreeBSD, without configure. Now to test it *again* under sparc_solaris
with configure and see if it works...
history.h doesn't...previously, it was assumed that both existed, or
didn't exist...but this assumption fails on the one sparc_solaris box
that I have access to, and could exist in other circumstances
Here is a trivial patch to get back the 1.09 behavior; it just removes trailing
newlines before printing the line out with a newline rather than after...
Thomas Lockhart
At least the first two should be fixed before the final release of 6.0.
1) There is a mismatch between the type declared in the catalog for
the input/output attributes of pg_type and the actual type of
values stored in the table. The type of typinput, typoutput,
typsend and typreceive are declared oid (26) while the values are
regproc (24). The error was there also in previous versions but
nobody noticed it until an Assert has been added in ExecEvalVar.
The effect is that it is now impossible to replace the typoutput
of existing data types with new procs.
2) The identd hba fails after the first time because the data read
from the identd socket is not zero-terminated and strlen reports
an incorrect length if the stack contains garbage, which usually
happens after the first connection has been made.
3) The new initdb wants to create itself the data directory. This
implies that the parent directory must be writable by postgres and
this may not always be desirable. A better solution would be to
allow the directory to be created by root and then filled by initdb.
It would also nice to have some reasonable default for PGLIB and
PGDATA like the previous version did. This applies also to the
postmaster executable.
gmake of the code without interruption.
There's also some tidy-up of the MAXPATHLEN stuff based on the assumption that
all supported platforms have MAXPATHLEN defined in <sys/param.h>.
(The only unknowns for the above are AIX and IRIX5.)
In particular, no more compiled-in default for PGDATA or LIBDIR. Commands
that need them need either invocation options or environment variables.
PGPORT default is hardcoded as 5432, but overrideable with options or
environment variables.
with some versions of sh, and a bug in the master make file that
causes it to issue the message "postgres has been built" at the wrong
time.
Submitted by: bryanh@giraffe.netgate.net (Bryan Henderson)
way one creates a database system. Parts that were in "make install"
are not either in "make all" or initdb. Nothing goes in the PGDATA
directory besides user data. Creating multiple database systems is
easier.
In addition to applying the patch, it is necessary to move the file
libpq/pg_hba to backend/libpq/pg_hba.sample.
Submitted by: Bryan Henderson <bryanh@giraffe.netgate.net>
It adds a WITH OIDS option to the copy command, which allows
dumping and loading of oids.
If a copy command tried to load in an oid that is greater than
its current system max oid, the system max oid is incremented. No
checking is done to see if other backends are running and have cached
oids.
pg_dump as its first step when using the -o (oid) option, will
copy in a dummy row to set the system max oid value so as rows are
loaded in, they are certain to be lower than the system oid.
pg_dump now creates indexes at the end to speed loading
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
pg_dump and load to 2.0. I haven't gotten any feedback on whether
people want it, so I am submitting it for others to decide. I would
recommend an install in 1.02.1.
I had said that the 2.0 pg_dump could dump a 1.02.1 database, but I was
wrong. The copy is actually performed by the backend, and the 2.0
database will not be able to read 1.02.1 databases because of the new
system columns.
This patch does several things. It copies nulls out as \N, so they can
be distinguished from '' strings. It fixes a problem where backslashes
in the input stream were not output as double-backslashes. Without this
patch, backslashes copied out were deleted upon input, or interpreted as
special characters. Third, input is now terminated by backslash-period.
This can not be part of a normal input stream.
I tested this by creating a database with all sorts of nulls, backslash,
and period fields and dumped the database and reloaded into a new
database and compared them.
Submitted by: Bruce
pg_dump and load to 2.0. I haven't gotten any feedback on whether
people want it, so I am submitting it for others to decide. I would
recommend an install in 1.02.1.
I had said that the 2.0 pg_dump could dump a 1.02.1 database, but I was
wrong. The copy is actually performed by the backend, and the 2.0
database will not be able to read 1.02.1 databases because of the new
system columns.
This patch does several things. It copies nulls out as \N, so they can
be distinguished from '' strings. It fixes a problem where backslashes
in the input stream were not output as double-backslashes. Without this
patch, backslashes copied out were deleted upon input, or interpreted as
special characters. Third, input is now terminated by backslash-period.
This can not be part of a normal input stream.
I tested this by creating a database with all sorts of nulls, backslash,
and period fields and dumped the database and reloaded into a new
database and compared them.
Submitted by: Bruce
|We're all too familiar with psql's "no response from backend" message.
|Users can't tell what this means, and psql continues prompting for
|commands after it even though the backend is dead and no commands can
|succeed. It eventually dies on a signal when the dead socket fills
|up. I extended the message to offer a better explanation and made
|psql exit when it finds the backend is dead.
|
|I also added a short message and newline when the user does a ctl-D so
|it doesn't mess up the terminal display.
|
|
Submitted by: Bryan Henderson <bryanh@giraffe.netgate.net>
don't indicate that the libpq.a library is a dependency of all the /bin
programs. So if the library changes, the /bin programs don't get remade.
Submitted by: Bryan Henderson <bryanh@giraffe.netgate.net>
does 2 things:
1) Make it hard to not notice the make failed. (As you recall, someone on
the mailing list had this problem. I've had it to some extent myself).
The 1.02 make files continue with the next subdirectory when a make
in a subdirectory fails. The patch makes the make stop in the
conventional way when a submake fails. It also adds a reassuring message
when the make succeeds and adds a note to the INSTALL file to expect it.
2) Include loader flags on all invocations of the linker.
The 1.02 make files omit the $(LDFLAGS) on some of the linker invocations.
On my system, I need one of those flags just to make it invoke the proper
version of the compiler/linker, so LDFLAGS has to be everywhere.
Submitted by: Bryan Henderson <bryanh@giraffe.netgate.net>
In postgres95/src/backend/nodes/readfuncs, lines 1188 and 1189,
local_node->relname is taken to point to a NameType, while its
defined as a pointer to char. Both the casting to Name and the
call of namestrcpy should, IMHO, be changed appropriately (first
patch).
As far as I could see from the Linux signal header file,
a signal handler is declared as
typedef void (*__sighandler_t)(int);
Few changes to postgres95/src/backend/storage/lmgr/proc.c seem
appropriate to comply with this.
Finally, postgres95/src/bin/pg_version/pg_version.c defines
a function GetDataHome (by default, returning an integer)
and returns NULL in the function, which isn't an integer...
Submitted by: ernst.molitor@uni-bonn.de
updates the psql.1 manual page for \ options
add row count and ties it to the header option
updated manual pages and comment for above change
got \? to display in one screen-full (almost, \? scrolls off top)
moved \r to \E, and \z to \r (for historical reasons with monitor)
small code alignment cleanup
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
case where the attribute length is variable (stored as -1). Previously,
you'd get output that looked like:
CREATE TABLE foo (bar varchar(-1));
Monitor and psql don't like this at all :). Here is a fix:
Submitted by: Adam Sussman <myddryn@vidya.com>
of my (proff) patch. This is the rest of it, with a few, mainly aesthetic
changes. I've removed a lot of redundency from the original code,
added support for the new PQprint() routines in libpq, expanded tables,
and a few generally nifty ways of massaging data in and out of the
backend. Still needs some good stress testing.
>
> We did some testing and found that if we name the table 'Inv' with
> anything appended to it, the table does not appear in the '\d' table list.
> It appears to be the capital I as a table named 'invItemsL' is created
> and displayed properly.
>
- submitted by: Jason Wright <jason@shiloh.vnet.net>
before (plus some optimisations/bug fixes et al). I've included a small
demo transcript below. Note that all of of the display
functionality/intelligence you see here, can be had merely by calling
the new LIBPQ PQprint() routine with the appropriate arguments/options,
including the HTML3 output guff.
submitted by: Julian Assange <proff@suburbia.net>