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;
start time equal to tuple->t_tmax.
Privent shrinking if there are tuples modifyed by running transactions
(it concerns system relations only, currently).
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] pqcomprim.c patch
This is the patch by Robert Bruccoleri to fix the endian problem.
(Actually, it's the reverse of his patch. He must have gotten the
order wrong.)
/*
* RelationFlushRelation () below will flush relation information
* from the cache. We must call smgrclose to flush relation
* information from SMGR & FMGR, too. We assume that for temp
* relations smgrunlink is already called by heap_destroyr
* and we skip smgrclose for them. - vadim 05/22/97
*/
smgrclose(reln->rd_rel->relsmgr, reln);
- it avoids memory leaks in SMGR & VFD.
RelationFlushRelation():
there is no more call FileInvalidate(RelationGetSystemPort(relation));
- invalid (FileInvalidate() expects File, not SMGR' fd)
- unuseful anyway.
mdunlink() and mdclose() (too !!!) now free MdfdVec for relation
and add it to free list, so it may be re-used for another relation
later.
2. Fix VFD-manager memory leak (found by Massimo ... and me):
mdunlink() has to call FileUnlink() to free allocation for fileName
and add the Vfd slot to the free list.
/*
** You can have as many strategies as you please in GiSTs, as
** long as your consistent method can handle them
*/
#define GISTNStrategies 100
^^^
- too big number:
strat.h->StrategyEvaluationData->StrategyExpression expression[12]
^^
- so 12 is real max # of strategies, or StrategyEvaluationIsValid
crashes backend (called if CASSER defined).
To: pgsql-patches@postgreSQL.org
Subject: [PATCHES] DROP AGGREGATE gram.y typo...
Somehow I dropped a comma in the gram.y part (line 129) of my
patch for drop aggregate. Here's a correct patch for gram.y.
PS. I hope I got the right comma, manually applied :) (scrappy)
Subject: [PATCHES] AIX make patch resubmitted.
Misc patches for AIX from Darren:
1) New src/makefiles/Makefile.aix This patch should only be
applied if the following patch (4) is applied to backend/Makefile!
Still looking into having configure determine the last line to do
the shared link. The 325 code will work for 41, so I put that in
as the default. Included a commented out 41 line for completeness.
*and*
4) Patch the backend Makefile. I've reviewed this patch with respect to the
other ports that use MAKE_EXPORTS (svr4 and univel) as closely as I could
and I don't see where it will break them. If it does, please let me know
and I'll rework it somehow.
Subject: [PATCHES] Re: [PORTS] AIX 6.1 fixes...
Here are the patches for the two things that wouldn't make it thru the AIX
compiler. The geo_ops.c change is harmless I believe. The nbtcompare.c patch
fixes me, but I don't know about any other ports. Maybe wait on that one
until Vadim decides what to do about the unsigned vs signed chars varlena
issue.
all local buffers @ xact commit, so accordingly nextFreeLocalBuf
is first local buffer now.
It helps to avoid unnecessary local buffer allocations in LocalBufferAlloc()
latter ("memmory leaks" in 'order by').
2. ResetLocalBufferPool() lost allocated local buffers:
memset(LocalBufferDescriptors, 0, sizeof(BufferDesc) * NLocBuffer);
(local buffers leak @ xact aborts).
Bring optional new-storage date and time up to date and test.
This new storage format should fix the "Sparc gcc -O2 bug".
(Enable new code with USE_NEW_DATE and USE_NEW_TIME in dt.h)
Subject: [PORTS] minor fix for DGUX port
src/include/port/dgux.h needs the following three lines appended:
#ifndef BYTE_ORDER
#define BYTE_ORDER BIG_ENDIAN
#endif
I believe this to be correct for DG/UX on M88k processors. I don't have one of
the new Intel-based boxes to check on.
Include some additional path functions which were coded but omitted here.
Add translation and rotation/scaling operators for some geometric types.
Fix bugs in some geometry comparison operator declarations.
Add type conversion functions for floating point numbers.
Check for zero in unary minus floating point code (IEEE allows an
explicit negative zero which looks ugly in a query result!).
Ensure circle type has non-negative radius.
Subject: [PATCHES] libpq patch
Hi,
here is a small patch which fixes two problems:
1. libpq/libpq-fe.h:
somehow disappeared the line
#define DefaultOption ""
now compilation stops with an error complainig an
unknown DefaultOption (970508).
2. Same patch as I sent already twice, but it never made it
into the source tree: there is no default value for
AuthType and Password. This way any libpq-application
(i.e. perl-scripts) which use the function PQconnectdb
will break with PostgreSQL-6.1. The patch simply uses
an empty string as default value.
Subject: [PATCHES] Patches for boolean, timespan and reltime regression tests.
Hi All,
Here are a couple of patches to the regression tests to introduce
some specific ordering to the results.
I've only made changes to the queries that were exhibiting differences
on my regression runs.
This will also have the side effect of testing the ordering code for
the boolean and some of the time types.
Subject: [PATCHES] libpq SET var TO patch
One last, I hope. This one corrects a bogus format string, and
actually sends the contents of PG_DATESTYLE to the backend. That
means, you can do a setenv PG_DATESTYLE 'iso', and your libpq
will pick that up and tell the backend.
Subject: [PATCHES] port patch: ultrix4
ultrix4 doesn't compile without this. this also fixes a problem
with dynamic loading (ultrix relocatable objects must be loaded
with -G 0).
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
fd = FileNameOpenFile(path, O_RDWR|O_CREAT|O_EXCL, 0600);
/*
* If the file already exists and is empty, we pretend that the
* create succeeded. During bootstrap processing, we skip that check,
* because pg_time, pg_variable, and pg_log get created before their
* .bki file entries are processed.
*
> * As the result of this pretence it was possible to have in
> * pg_class > 1 records with the same relname. Actually, it
> * should be fixed in upper levels, too, but... - vadim 05/06/97
> */
when btree used in innerscan with run-time key which value
passed by pointer.
Fix: keys ordering stuff moved to _bt_first().
Pointed by Thomas Lockhart.
Subject: [HACKERS] Inputting money
I notice that I have to put single quotes around money amounts if there
is a decimal point in the value. I appears to be happening because there
is something changing things like "123.45" to "123.450000" and the code
has a problem with that. There may be a better way to fix this but here
is a simple change to cash.c that lets it accept trailing zeroes.
Add mixed-case #define synonyms to avoid changing more source code.
Add comparison operators for boolean.
Add aggregate min() and max() for datetime and timespan.
Add comparison operators to boolean and smaller/larger operators to datetime
and timespan. Fix int4 overflow math problem in timespan comparison operators.
Subject: [PATCHES] to make regress.sh shell friendly to echo.
Hi,
I needed to make the following change to regress.sh to make it more
shell friendly.
The Solaris /bin/sh, and others, use \c to supress the newline.
the DROP TABLE calls from the destroy.sql file to the 'types' .sql files,
so that they are self-contained
btree_index, hash_index and misc all fail as there seems to be missing
a 'misc.out' expected file...have asked Thomas for one...
=============== destroying old regression database... =================
=============== creating new regression database... =================
=============== running regression queries... =================
create_function_1 .. ok
create_type .. ok
create_table .. ok
create_function_2 .. ok
Here are patches which should help fix timezone problems in the
datetime and abstime code. Also, I repatched varlena.c to add in
some comments and a little error checking on top of Vadim's earlier
repairs. There are slight mods to the circle data type to have the
distance operator between circles measure the distance between
closest points rather than between centers.
Subject: [PATCHES] Patches for compiling 6.1 on Digital Unix 3.2c
Attached to this message are the patches I needed to compile 6.1 cleanly
under Digital Unix 3.2c with DEC cc.
I hope these are the last ones. At least, the number of files needing a
patch has decreased noticeably since I sent my previous patches. Nice work
:-)
One of the patches is a bug fix, but I'm including it here anyway.
With these patches applied, the beast seems to work properly. However,
I've done only some preliminary tests. More on this later (but hopefully
before the April 30 deadline... :-)
postgres backend processes end up as so called zombies. It seems that
only Linux a.out (libc.4.6.27) systems are affected.
By:
Wolfgang Roth <roth@statistik.uni-mannheim.de>
nestloop's join clauses doesn't work in some cases:
* 1. fix_indxqual_references may change varattno-s in
* inner_indxqual;
* 2. clauses may be commuted
Subject: Re: [PATCHES] SET DateStyle patches
On Tue, 22 Apr 1997, Thomas Lockhart wrote:
> Some more patches! These (try to) finish implementing SET variable TO value
> for "DateStyle" (changed the name from simply "date" to be more descriptive).
> This is based on code from Martin and Bruce (?), which was easy to modify.
> The syntax is
>
> SET DateStyle TO 'iso'
> SET DateStyle TO 'postgres'
> SET DateStyle TO 'sql'
> SET DateStyle TO 'european'
> SET DateStyle TO 'noneuropean'
> SET DateStyle TO 'us' (same as "noneuropean")
> SET DateStyle TO 'default' (current same as "postgres,us")
>
> ("european" is just compared for the first 4 characters, and "noneuropean"
> is compared for the first 7 to allow less typing).
>
> Multiple arguments are allowed, so SET datestyle TO 'sql,euro' is valid.
>
> My mods also try to implement "SHOW variable" and "RESET variable", but
> that part just core dumps at the moment. I would guess that my errors
> are obvious to someone who knows what they are doing with the parser stuff,
> so if someone (Bruce and/or Martin??) could have it do the right thing
> we will have a more complete set of what we need.
>
> Also, I would like to have a floating point precision global variable to
> implement "SET precision TO 10" and perhaps "SET precision TO 10,2" for
> float8 and float4, but I don't know how to do that for integer types rather
> than strings. If someone is fixing the SHOW and RESET code, perhaps they can
> add some hooks for me to do the floats while they are at it.
>
> I've left some remnants of variable structures in the source code which
> I did not use in the interests of getting something working for v6.1.
> We'll have time to clean things up for the next release...
Subject: [PORTS] Configure for DEC-Alpha
Configure script properly detects alpha-dec-osf4.0 machine, but
sets a default GENERIC template for it. I modified tempplate/.similar to
add alpha-dec-osf4.0=alpha. Then configure properly set the template to
alpha.
Subject: [PATCHES] Patch for configure.in to not ask for CASSERT
The following patch defaults to CASSERT, so it doesn't ask you. You can
still use --enable-cassert and --disable-cassert to do it explicitly.
Default: disabled
Subject: [PATCHES] date/time timezone patches (mail bounced?)
Here are some hacks to get timezone behavior for the various time
data types to be compatible with v6.0. Although we have some hooks
already installed to get timezone info from the client to the
server, it still isn't clear if that can correctly transfer enough
timezone info to make the behavior the same as if timezone info
were derived from the server as is now the case. We certainly
won't resolve it in a day, so I think we are stuck with server-only
timezones for v6.1.
OK, here are a passel of patches for the geometric data types.
These add a "circle" data type, new operators and functions
for the existing data types, and change the default formats
for some of the existing types to make them consistant with
each other. Current formatting conventions (e.g. compatible
with v6.0 to allow dump/reload) are supported, but the new
conventions should be an improvement and we can eventually
drop the old conventions entirely.
For example, there are two kinds of paths (connected line segments),
open and closed, and the old format was
'(1,2,1,2,3,4)' for a closed path with two points (1,2) and (3,4)
'(0,2,1,2,3,4)' for an open path with two points (1,2) and (3,4)
Pretty arcane, huh? The new format for paths is
'((1,2),(3,4))' for a closed path with two points (1,2) and (3,4)
'[(1,2),(3,4)]' for an open path with two points (1,2) and (3,4)
For polygons, the old convention is
'(0,4,2,0,4,3)' for a triangle with points at (0,0),(4,4), and (2,3)
and the new convention is
'((0,0),(4,4),(2,3))' for a triangle with points at (0,0),(4,4), and (2,3)
Other data types which are also represented as lists of points
(e.g. boxes, line segments, and polygons) have similar representations
(they surround each point with parens).
For v6.1, any format which can be interpreted as the old style format
is decoded as such; we can remove that backwards compatibility but ugly
convention for v7.0. This will allow dump/reloads from v6.0.
These include some updates to the regression test files to change the test
for creating a data type from "circle" to "widget" to keep the test from
trashing the new builtin circle type.
Subject: [HACKERS] Another patch to configure.in
I heard very little in objections/approvals to defaulting some of the
parameters to configure. Enclosed is a patch to configure.in which
removes the questions for
PGPORT
USE_LOCALE
NOHBA
By default (i.e. assuming you don't put anything extra in the configure
command line), it assumes PGPORT=5432, USE_LOCAL=no and NOHBA=no (i.e.
HBA is turned on)
--with-pgport=PGPORT_NO Over-rides the PGPORT value
--enable-locale enables USE_LOCALE
--disable-hba disables HBA
Just for completeness:
--prefix=BASEDIR Defaults to /usr/local/pgsql
--with-template=TEMPLATE Defaults to asking you
Subject: [PATCHES] 970417: some large object patches
Two patches here, made against 970417. Both have to do with large
objects:
1. lobjfuncs was not initialized in PQconnectdb. This causes
failure later if large objects are used. (Someone already
caught this error in PQsetdb.)
2. Postgres functions lo_import and lo_export sometimes
produce garbage for the file names because the filename
strings aren't always terminated by \0. (VARDATA isn't
necessarily null terminated.)
Subject: [PATCHES] 970417: two more patches for large objects
Here are two more patches:
1. pg_getint doesn't properly set the status flag when
calling pqGetShort or pqGetLong. This is required when
accessing large objects via libpq. This, combined with
problem 1 above causes postgres to crash when postgres
tries to print out the message that the status was not
good.
2. ExceptionalCondition crashes when called with detail =
NULL. This patch prevents dereferencing the NULL.
Subject: [HACKERS] Patch: set date to euro/us postgres/iso/sql
Here a patch that implements a SET date for use by the datetime
stuff. The syntax is
SET date TO 'val[,val,...]'
where val is us (us dates), euro (european dates), postgres,
iso or sql.
Thomas is working on the integration in his datetime module.
I just needed to get the patch out before it went stale :)
table. The table name is de-allocated by the CommitTransactionCommand()
in vc_init() before it is copied in VacRel.data and sometimes this causes
a SIGSEGV. My patch simply moves the strcpy before vc_init.
Submitted by Massimo Dal Zotto <dz@cs.unitn.it>.
index tuple (logical position within A LEVEL). bti_oid & bti_dummy
taken off from BTItemData.
2. Fix for multi-column indices (nbtsearch.c):
_bt_binsrch() - for searches on internal pages having keysize <
number of attrs we point at the last item < the scankey, not at the
first item = the scankey;
_bt_moveright() - if keysize < number of attrs we compare scankey with
_last_ item on current page to decide should we move right or
not.
Subject: [HACKERS] Money integration patches
Here are patches to integrate the money data type. I have included
some math and aggregate functions and have made the locale support optional
by #ifdef USE_LOCALE bracketing of functions.
Modules affected are:
builtins.h.patch
cash.c.patch
cash.h.patch
main.c.patch
pg_aggregate.h.patch
pg_operator.h.patch
pg_proc.h.patch
pg_type.h.patch
I changed the data type to be pass-by-reference rather than by-value
to pave the way for a larger internal representation (64-bit ints?).
Also, I changed the tabbing of cash.c and cash.h to match most of
the other Postgres source code files (4 space indent, 8 spaces == 1 tab).
The locale stuff should be tested under another convention (Russian?)
but I don't know what the correct results should be so perhaps someone
else can give them a try. Will update docs and regression tests in
the next few days.
invalid macro definitions, the compiler complains about:
"pqcomprim.c", line 48.9: 1506-275 (S) Unexpected text ';' ignored.
"pqcomprim.c", line 61.9: 1506-275 (S) Unexpected text ';' ignored.
The ';' terminating the macro definition ntoh_s(n) on line 27 and
ntoh_l(n) on line 28 should be removed.
Pointed out by: Olaf Mittelstaedt <MSTAEDT@va-sigi.va.fh-ulm.de>
Makefile.global and move them to seperate 'include' makefiles
Over time, should become even more port specific:
ie. Makefile.BSD44_derived should be broken down into netbsd/freebsd
specific ports