Commit Graph

6461 Commits

Author SHA1 Message Date
Peter Eisentraut 32163099d7 Add distprep target to take some of the job of the release_prep script.
The latter updated accordingly. Also add `dist' and `distcheck' targets
to play with, but caveat packager.

Updated backend/bootstrap and backend/parser makefile to make them
marginally builddir aware and fix the usual set of things.

Add rule to automatically remake config.h dependent on config.h.in and
config.status. (Adopted from Autoconf manual and about every other
package.) On a good day we should now have a complete and accurate set
of dependencies throughout everything.
2000-07-19 16:30:27 +00:00
Jan Wieck 79e6648649 Added untrusted PL/TclU (pltclu) language. Executes all procedures
in a non-safe interpreter, so with full OS access! Language is
restricted to be used by DB superusers.

Added "argisnull n" and "return_null" commands to gain full control
over NULL values from new FMGR capabilities.

Jan
2000-07-19 11:53:02 +00:00
Jan Wieck ec1ea5295a Fixed an ordering problem in test queries and
formatting differences due to new psql.

Jan
2000-07-18 11:28:20 +00:00
Tom Lane ba930a016c Add an opr_sanity check for misdefined aggregates that have transition
type different from input type but are expecting ExecAgg to insert the
first non-null input as the starting transition value.  This has always
been verboten, but wasn't checked for until now...
2000-07-18 05:02:19 +00:00
Tom Lane 8b1b34f6c0 Update pltcl regress test's expected output for 7.0 psql output format.
NOTE: this implementation of tcl_avg() fails with 'divide by zero'
for zero input rows.  It ought to return NULL, but pltcl does not
currently provide a way to do that, so I'm leaving the problem unsolved
for now.
2000-07-18 04:45:59 +00:00
Tom Lane 0d72b2d060 'const' decorations are fine, but not when they're inserted without
bothering to clean up the resulting warnings ...
2000-07-18 03:57:33 +00:00
Peter Eisentraut 44eaafe3f8 End users shouldn't have to invoke a separate command to install the
documentation. Therefore it's now installed by default. If there is no
documentation to be found (i.e., you are not using the distribution)
then this step is skipped.

Add --docdir option to configure to control installation directory.
2000-07-17 22:31:59 +00:00
Peter Eisentraut 5da7e533f7 Don't strip trailing backslashes from a line. Treat them more reasonably. 2000-07-17 18:24:33 +00:00
Tom Lane ba87ab548e I concur with Andreas: unconditionally including <sys/fcntl.h> is not
portable.  Seems to have been added for O_BINARY, which is only needed
for __CYGWIN32__, so include it here only in that case.
2000-07-17 04:35:55 +00:00
Tom Lane bec98a31c5 Revise aggregate functions per earlier discussions in pghackers.
There's now only one transition value and transition function.
NULL handling in aggregates is a lot cleaner.  Also, use Numeric
accumulators instead of integer accumulators for sum/avg on integer
datatypes --- this avoids overflow at the cost of being a little slower.
Implement VARIANCE() and STDDEV() aggregates in the standard backend.

Also, enable new LIKE selectivity estimators by default.  Unrelated
change, but as long as I had to force initdb anyway...
2000-07-17 03:05:41 +00:00
Tom Lane 139f19c302 update pltcl test to have at least some chance of running ... still
seems to be busted though ...
2000-07-17 02:22:50 +00:00
Tom Lane a2c6bf5a59 pltcl seems to be broken on HPUX with recent Tcl versions, because
link needs to specify -lc but doesn't.  Quick hack to make it better.
2000-07-17 01:26:42 +00:00
Bruce Momjian 8a70a1c75d Hmm. I didn't expect a change since I hadn't added tests for the new
stuff, but fixing the bug that existed in reporting the constraint name
changes the error line.  Patch to expected output enclosed.

Stephan Szabo
2000-07-16 19:27:29 +00:00
Peter Eisentraut 0d59dad770 Automatic dependency tracking
The .DEFAULT rule in backend/Makefile is harmful -- removed.
Replace `::' rules by `:'.
2000-07-16 14:50:44 +00:00
Peter Eisentraut 3eec6ee145 Rename templates to match names in makefiles/Makefile.* and include/port.
Read templates after compiler is detected. Convert all templates to real
shell scripts. Rename bsd->openbsd, alpha->osf.
2000-07-15 15:54:52 +00:00
Bruce Momjian 739a0566a6 This should be a slighly more complete patch for commands/command.c
AlterTableAddConstraint.  The major changes from the last patch
are that it should hopefully check for references to temp tables
(not in the shadow case, but at defination time) from permanent tables in
foreign keys and refuse them and that it doesn't allow the table(s)
being constrained to be views (because those cases don't currently
work).

Stephan SzaboThis should be a slighly more complete patch for commands/command.c
AlterTableAddConstraint.  The major changes from the last patch
are that it should hopefully check for references to temp tables
(not in the shadow case, but at defination time) from permanent tables in
foreign keys and refuse them and that it doesn't allow the table(s)
being constrained to be views (because those cases don't currently
work).

Stephan Szabo
2000-07-15 12:37:14 +00:00
Tom Lane f2e3f621c5 Update implementation notes for new memory management logic. 2000-07-15 00:52:22 +00:00
Tom Lane e40492ec6e Remove useless and dangerous 'opt_type' option from CREATE INDEX. 2000-07-15 00:01:41 +00:00
Tom Lane 6bfe64032e Cleanup of code for creating index entries. Functional indexes with
pass-by-ref data types --- eg, an index on lower(textfield) --- no longer
leak memory during index creation or update.  Clean up a lot of redundant
code ... did you know that copy, vacuum, truncate, reindex, extend index,
and bootstrap each basically duplicated the main executor's logic for
extracting information about an index and preparing index entries?
Functional indexes should be a little faster now too, due to removal
of repeated function lookups.
CREATE INDEX 'opt_type' clause is deimplemented by these changes,
but I haven't removed it from the parser yet (need to merge with
Thomas' latest change set first).
2000-07-14 22:18:02 +00:00
Peter Eisentraut a30bc7c75a Remove dangling else warning (Cyrillic recode stuff) 2000-07-14 16:41:44 +00:00
Peter Eisentraut 9533de72bf didn't compile 2000-07-14 16:40:40 +00:00
Peter Eisentraut e7545748b5 Remove references to symbols that no longer get defined 2000-07-14 16:39:35 +00:00
Thomas G. Lockhart be703cd9e8 Implement nested block comments in the backend and in psql.
Include updates for the comment.sql regression test.
Implement SET SESSION CHARACTERISTICS and SET DefaultXactIsoLevel.
Implement SET SESSION CHARACTERISTICS TRANSACTION COMMIT
 and SET AutoCommit in the parser only.
 Need to add code to actually do something.
Implement WITHOUT TIME ZONE type qualifier.
Define SCHEMA keyword, along with stubbed-out grammar.
Implement "[IN|INOUT|OUT] [varname] type" function arguments
 in parser only; INOUT and OUT throws an elog(ERROR).
Add PATH as a type-specific token, since PATH is in SQL99
 to support schema resource search and resolution.
2000-07-14 15:43:57 +00:00
Thomas G. Lockhart 1e901bbe84 Implement SET SESSION CHARACTERISTICS and SET DefaultXactIsoLevel. 2000-07-14 15:35:44 +00:00
Thomas G. Lockhart 2016898b6a Fix indenting in prototype declarations. No functional changes. 2000-07-14 15:33:33 +00:00
Thomas G. Lockhart a4d92053d8 Include rule to build include/parser/parse.h since nothing else can
build in this directory otherwise :(
2000-07-14 15:32:04 +00:00
Thomas G. Lockhart b4a3b6476c Change order of builds to get parser before commands.
This will ensure building parse.h for commands, though this is also
 covered with other build rules.
2000-07-14 15:30:56 +00:00
Peter Eisentraut b0f52abe36 Fix typo, from Keith Parks 2000-07-13 16:08:01 +00:00
Peter Eisentraut 8a3cbc84ef Repair parallel make in backend tree (and make it really parallel).
Make Gen_fmgrtab.sh reasonably robust against concurrent invocation.
2000-07-13 16:07:14 +00:00
Tom Lane 9191d684a7 Planner did the wrong thing with index-scan-backward plans: generated
them, but forgot to attach relevant restriction clauses, so that the
plan represented a scan over the whole table with restrictions applied
as qpquals not indexquals.  Another day, another bug...
2000-07-13 05:47:29 +00:00
Peter Eisentraut cb292206c5 Remove a bunch of unused configure tests, in particular cases where
* the result is not recorded anywhere
* the result is not used anywhere
* the result is only used in some places, whereas others have been getting away with it
* the result is used improperly

Also make command line options handling a little better (e.g., --disable-locale,
while redundant, should really still *dis*able).
2000-07-12 22:59:15 +00:00
Bruce Momjian dce43d22f0 Can you please apply the following patch to current CVS
to make AIX'ers happy with the changes to the version.o ?

Together with the patch I sent Tom, AIX now regresses ok.

Thanx
Andreas
2000-07-12 18:04:47 +00:00
Peter Eisentraut 648677c3a2 Add assert checking to GUC ("debug_assertions")
Rename settings net_server to tcpip_socket, max_backends to max_connections
Add --help and --version to postmaster, reformat help output
2000-07-12 17:38:53 +00:00
Tom Lane cbdaa27f97 Repair missing MEMORY_CONTEXT_CHECKING logic for realloc().
Doesn't anyone around here run regression tests before submitting
patches, or before committing them?
2000-07-12 05:15:20 +00:00
Tom Lane badce86a2c First stage of reclaiming memory in executor by resetting short-term
memory contexts.  Currently, only leaks in expressions executed as
quals or projections are handled.  Clean up some old dead cruft in
executor while at it --- unused fields in state nodes, that sort of thing.
2000-07-12 02:37:39 +00:00
Bruce Momjian 46fb9c29e2 Here is the patch with memory leak checker. This checker allow detect
in-chunk leaks, overwrite-next-chunk leaks and overwrite block-freeptr leaks.

A in-chunk leak --- if something overwrite space after wanted (via palloc()
size, but it is still inside chunk. For example

        x = palloc(12);         /* create 16b chunk */
        memset(x, '#', 13);

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?

                                                Karel
2000-07-11 14:30:37 +00:00
Bruce Momjian 0d32cdc38e Done. In backend/commands/define.c unused field is set to '-' for the
moment.

A patch for CVS is attached, and I have amended my BLOB dumping version
appropriately.

Philip Warner
2000-07-11 13:07:17 +00:00
Jan Wieck 793704d71e Some security checks that we've found an external value completely
when fetching toasted values.

Jan
2000-07-11 12:32:03 +00:00
Tom Lane f3e5d8620c Prevent creating a boatload of empty segments when md.c is asked to
access a ridiculously large block number within a relation.
2000-07-10 04:32:00 +00:00
Peter Eisentraut b54faa1b15 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
2000-07-09 21:30:21 +00:00
Peter Eisentraut f90771236d typo 2000-07-09 13:48:45 +00:00
Peter Eisentraut 2bbf34111f Fix handling of pre-existing LD_LIBRARY_PATH, from Keith Parks 2000-07-09 13:19:24 +00:00
Peter Eisentraut a746653493 Fix sed invocation, from Keith Parks 2000-07-09 13:16:12 +00:00
Peter Eisentraut 74618e2b82 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.
2000-07-09 13:14:19 +00:00
Tom Lane b59c03f842 Make view/rule permission checking behave properly with
subqueries in the rule.
2000-07-09 04:56:32 +00:00
Tom Lane 7c578904d7 Fix bogus DatumGetInt32 coercion. 2000-07-09 04:17:53 +00:00
Tom Lane 0552f8dfe7 Seems we need <errno.h> to be included explicitly now... 2000-07-08 05:30:33 +00:00
Tom Lane ba62fe32c3 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.
2000-07-08 03:04:41 +00:00
Tom Lane a98eaa0191 Put back separate install-bin target ... I was using that,
thank you ...
2000-07-08 02:40:27 +00:00
Tom Lane 65da0d66b4 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.
2000-07-07 21:12:53 +00:00