this leak is in the current source total invisible, because chunk is 16b and
leak is in the "align space".
For this feature I add data_size to StandardChunk, and all memory which go
from AllocSetAlloc() is marked as 0x7F.
The MemoryContextCheck() is compiled '#ifdef USE_ASSERT_CHECKING'.
I add this checking to 'tcop/postgres.c' and is active after each backend
query, but it is probably not sufficient, because some MemoryContext exist
only during memory processing --- will good if someone who known where
it is needful (Tom:-) add it for others contexts;
A problem in the current source is that we have still some malloc()
allocation that is not needful and this allocation is total invisible for
all context routines. For example Dllist in backend (pretty dirty it is in
catcache where values in Dllist are palloc-ed, but list is malloc-ed).
--- and BTW. this Dllist design stand in the way for query cache :-)
Tom, if you agree I start replace some mallocs.
BTW. --- Tom, have you idea for across transaction presistent allocation for
SQL functions? (like regex - now it is via malloc)
I almost forget. I add one if() to AllocSetAlloc(), for 'size' that are
greater than ALLOC_BIGCHUNK_LIMIT is not needful check AllocSetFreeIndex(),
because 'fidx' is always 'ALLOCSET_NUM_FREELISTS - 1'. It a little brisk up
allocation for very large chunks. Right?
oidvectortypes: use SQL type names and separate by commas
psql \df: use format_type and oidvectortypes
map type REAL to float4, not float8
psql \dd :work around UNION bug
Another round of those unportable config/build changes :-/
* Add option to build with OpenSSL out of the box. Fix thusly exposed
bit rot. Although it compiles now, getting this to do something
useful is left as an exercise.
* Fix Kerberos options to defer checking for required libraries until
all the other libraries are checked for.
* Change default odbcinst.ini and krb5.srvtab path to PREFIX/etc.
* Install work around for Autoconf's install-sh relative path anomaly.
Get rid of old INSTL_*_OPTS variables, now that we don't need them
anymore.
* Use `gunzip -c' instead of g?zcat. Reportedly broke on AIX.
* Look for only one of readline.h or readline/readline.h, not both.
* Make check for PS_STRINGS cacheable. Don't test for the header files
separately.
* Disable fcntl(F_SETLK) test on Linux.
* Substitute the standard GCC warnings set into CFLAGS in configure,
don't add it on in Makefile.global.
* Sweep through contrib tree to teach makefiles standard semantics.
... and in completely unrelated news:
* Make postmaster.opts arbitrary options-aware. I still think we need to
save the environment as well.
Tom Lane [Sat, 8 Jul 2000 03:04:41 +0000 (03:04 +0000)]
Remove long-dead support for invoking queries from dynamically loaded
backend functions via backend PQexec(). The SPI interface has long
been our only documented way to do this, and the backend pqexec/portal
code is unused and suffering bit-rot. I'm putting it out of its misery.
Tom Lane [Fri, 7 Jul 2000 21:12:53 +0000 (21:12 +0000)]
Fix misuse of StrNCpy to copy and add null to non-null-terminated data.
Does not work since it fetches one byte beyond the source data, and when
the phase of the moon is wrong, the source data is smack up against the
end of backend memory and you get SIGSEGV. Don't laugh, this is a fix
for an actual user bug report.
Bruce Momjian [Fri, 7 Jul 2000 01:23:44 +0000 (01:23 +0000)]
|> The Makefile.shlib changes will have to be discussed with other Linux
|> developers so we are sure it will work on all platforms.
The problem with the current settings is that the linker is called
directly. This is wrong, it should always be called through the
compiler
driver (the only exception is `ld -r'). This will make sure that the
necessary libraries like libgcc are linked in.
But there is still a different problem with the setting of LDFLAGS_ODBC.
The psqlodbc module defines the functions _init and _fini which are
reserved for the shared library initialisation. These should be changed
to constructor functions. Then LDFLAGS_ODBC can be changed to be just
`-lm'. Btw, why does it use -Bsymbolic?
Backend makefile cleanup. make maintainer-clean is now completely
functional.
Handle include file installation in src/include/Makefile
genbki.sh improvements: Don't substitute anything by config.status,
instead pass in AWK and CPP through environment. Change calling
convention to support named output files, so we get to see error
messages on stderr.
Rename bootstrap template files and install them into PREFIX/share.
Update initdb to that effect and other readability improvements
in initdb.
Tom Lane [Wed, 5 Jul 2000 23:12:09 +0000 (23:12 +0000)]
Update textin() and textout() to new fmgr style. This is just phase
one of updating the whole text datatype, but there are so dang many
calls of these two routines that it seems worth a separate commit.
Jan Wieck [Wed, 5 Jul 2000 16:17:43 +0000 (16:17 +0000)]
Changed TOAST relations to have relkind RELKIND_TOASTVALUE.
Special handling of TOAST relations during VACUUM. TOAST relations
are vacuumed while the lock on the master table is still active.
The ANALYZE flag doesn't propagate to their vacuuming because the
toaster access routines allways use index access ignoring stats, so
why compute them at all.
Protection of TOAST relations against normal INSERT/UPDATE/DELETE
while offering SELECT for debugging purposes.
Bruce Momjian [Wed, 5 Jul 2000 16:09:31 +0000 (16:09 +0000)]
attached to this mail is a patch from a colleague that makes
PostgreSQL-7.0.2 run on Linux for the Intel-IA64 architecture. It also
fixes a bug in the configure scripts that caused configure to fail on
the fcntl(F_SETLK) test.
This fix triggered a bug in the fcntl(F_SETLK) code of the Linux
kernel when used on unix domain sockets resulting in postmaster to
segfault immediately after startup. There is a fix available and
included in the kernel that will be on SuSE Linux 7.0, but kernels <=
2.2.16 still have this bug.
Expand secondary password file feature, so that you can use these
files to restrict the set of users that can connect to a database
but can still use the pg_shadow password. (You just leave off the
password field in the secondary file.)
Tom Lane [Tue, 4 Jul 2000 06:11:54 +0000 (06:11 +0000)]
Make toast-table creation and deletion work somewhat reliably.
Don't go through pg_exec_query_dest(), but directly to the execution
routines. Also, extend parameter lists so that there's no need to
change the global setting of allowSystemTableMods, a hack that was
certain to cause trouble in the event of any error.
Move PGPORT envar handling to ResetAllOptions(). Improve long options
parsing to not clobber the optarg string -- so that we can bring
SetOptsFile() up to speed.
Have pg_dumpall write CREATE USER and CREATE GROUP commands instead of raw
COPYs of pg_shadow and pg_group.
It also turns out that pg_dumpall was all but broken for multiple servers
running at non-standard port numbers. You might get the users and groups
from one server and the databases from another. Fixed that.
A little user interface and code cleanup along with that. This also takes
care of the portability bug discussed in "[BUGS] pg_dumpall" in March 2000.
Bruce Momjian [Sat, 1 Jul 2000 14:10:32 +0000 (14:10 +0000)]
In the attache is new to_date()/to_timestamp() version.
Now the to_timestamp() support WW,W,J,SSSS,DDD conversion from strings and
the am/pm bug is fixed, the to_char() use week-of-year (WW) full compatible
with Oracle.
This patch update relevant regress-tests and docs too.
Peter Eisentraut [Fri, 30 Jun 2000 16:11:02 +0000 (16:11 +0000)]
Fixes for Solaris/cc suggested by <pgsql-hackers@thewrittenword.com>
Don't use DISABLE_COMPLEX_MACRO on Solaris. Don't define the
replacement function in the header file. Use -KPIC, not -K PIC.
Use CC to link C++ libraries, not ld/ar.
Eliminate file not found warnings in tcl build code.
Tom Lane [Fri, 30 Jun 2000 07:04:23 +0000 (07:04 +0000)]
Use a private memory context to store rule information in each relcache
entry that has rules. This allows us to release the rule parsetrees
on relcache flush without needing a working freeObject() routine.
Formerly, the rule trees were leaked permanently at relcache flush.
Also, clean up handling of rule creation and deletion --- there was
not sufficient locking of the relation being modified, and there was
no reliable notification of other backends that a relcache reload
was needed. Also, clean up relcache.c code so that scans of system
tables needed to load a relcache entry are done in the caller's
memory context, not in CacheMemoryContext. This prevents any
un-pfreed memory from those scans from becoming a permanent memory
leak.
Tom Lane [Thu, 29 Jun 2000 07:35:57 +0000 (07:35 +0000)]
Add test code to copy all parse/plan trees. Repair essential omissions
in copyfuncs and equalfuncs exposed by regression tests. We still have
some work to do: these modules really ought to handle most or all of
the utility statement node types. But it's better than it was.
Tom Lane [Thu, 29 Jun 2000 05:50:29 +0000 (05:50 +0000)]
Rearrange config.h entries into a more sensible order, and add some
documentation. Let's try to keep this file a bit neater in future,
hmm? Also (to get back to the original point) update info about
FUNC_MAX_ARGS, and add additional config symbols for debugging
new memory management changes.
Tom Lane [Thu, 29 Jun 2000 02:26:23 +0000 (02:26 +0000)]
Remove freefuncs.c, which hasn't been used in a long time and is not
worth the effort to continue to maintain. Since freeObject() is not
capable of coping with cases like multiple links to a node, it's
unlikely that it ever will be useful again. We now have memory
context management that offers a faster and more reliable way of
getting rid of arbitrary node trees (at the cost of having to know
in advance of building the tree that you'll want to get rid of it).