Commit Graph

6591 Commits

Author SHA1 Message Date
Tom Lane 742cd87999 Ensure that if the OID counter wraps around, we will not generate 0,
nor any OID in the reserved range (1-16383).
2000-07-25 20:18:19 +00:00
Tom Lane 667d5ed206 Fix confusion between sizeof(long) and sizeof(long*), as well as
failure to MAXALIGN the start of shmem allocable space.  No reports
of trouble here, just compulsive tidiness.
2000-07-25 20:17:02 +00:00
Tom Lane dc73e25a5e Add commentary about varying usage of scankeys in btree code. 2000-07-25 05:26:40 +00:00
Tom Lane 916b2321ad Clean up and document btree code for ordering keys. Neat stuff,
actually, but who could understand it with no comments?  Fix bug
while at it: _bt_orderkeys would try to invoke comparisons on
NULL inputs, given the right sort of redundant quals.
2000-07-25 04:47:59 +00:00
Tom Lane da1ad323b7 Update comments. 2000-07-25 04:30:42 +00:00
Bruce Momjian b9e6f068dc Update bsdi template 2000-07-24 13:53:16 +00:00
Philip Warner 93802c88bb pg_backup_plain_text.c replaced by pg_backup_null.c 2000-07-24 06:30:16 +00:00
Philip Warner bb080400f8 - no longer put ACLs at end of dump
- connect as appropriate user in pg_restore with db connection
- dump owner of rule in pg_dump
2000-07-24 06:24:26 +00:00
Tom Lane cd9f0ca545 Deduce equality constraints that are implied by transitivity of
mergejoinable qual clauses, and add them to the query quals.  For
example, WHERE a = b AND b = c will cause us to add AND a = c.
This is necessary to ensure that it's safe to use these variables
as interchangeable sort keys, which is something 7.0 knows how to do.
Should provide a useful improvement in planning ability, too.
2000-07-24 03:11:01 +00:00
Peter Eisentraut c39c198bc3 Unset locale variables before running regression tests. (All of them!)
Don't do config.status substitutions into the regression test makefile.
2000-07-23 13:01:11 +00:00
Tom Lane 8d77c1a8aa Clean up some sloppy casts --- Oid vs. Datum, that sort of thing. 2000-07-23 03:50:26 +00:00
Tom Lane e4e6459c0f Further cleanup of array behavior. Slice assignments to arrays with
varlena elements work now.  Allow assignment to previously-nonexistent
subscript position to extend array, but only for 1-D arrays and only
if adjacent to existing positions (could do more if we had a way to
represent nulls in arrays, but I don't want to tackle that now).
Arrange for assignment of NULL to an array element in UPDATE to be a
no-op, rather than setting the entire array to NULL as it used to.
(Throwing an error would be a reasonable alternative, but it's never
done that...)  Update regress test accordingly.
2000-07-23 01:36:05 +00:00
Peter Eisentraut ef2a6b8b83 Shed some light onto SysV IPC configuration. 2000-07-22 14:49:01 +00:00
Jan Wieck f67e79045d 2nd try for the index tuple toast hack. This time as suggested
by Tom.

Jan
2000-07-22 11:18:47 +00:00
Tom Lane a5a12887a1 Make update lists like 'UPDATE tab SET foo[1] = bar, foo[3] = baz'
work as expected.  THe underlying implementation is essentially
'SET foo = array_set(foo, 1, bar)', so we have to turn the items
into nested invocations of array_set() to make it work correctly.
Side effect: we now complain about 'UPDATE tab SET foo = bar, foo = baz'
which is illegal per SQL92 but we didn't detect it before.
2000-07-22 06:19:04 +00:00
Tom Lane 4bdb348628 Remove 'Array' node type, which has evidently been dead code for
a very long time.
2000-07-22 04:22:47 +00:00
Tom Lane 1afdccc8b2 Missed some array updates ... 2000-07-22 04:16:13 +00:00
Tom Lane d0e17e2112 Arrays are toastable. (At least if you initdb, which I didn't force.)
Remove a bunch of crufty code for large-object-based arrays, which is
superseded by TOAST and likely hasn't worked in a long time anyway.
Clean up array code a little, and in particular eliminate its habit
of scribbling on the input array (ie, modifying the input tuple :-().
2000-07-22 03:34:43 +00:00
Peter Eisentraut bb13830d6f maintainer-clean and distclean ought to remove dependency information as well. 2000-07-22 01:48:53 +00:00
Tom Lane cf14ccd0ea Fix typo in version-mismatch error report. 2000-07-21 22:27:29 +00:00
Tom Lane 421f0baaff Further cleanup of btbuild (CREATE INDEX). Avoid storing unneeded
left keys during bottom-up index build, and leave some free space
instead of packing the pages to the brim (so as to avoid vast numbers
of page splits during the first interactive insertions).
2000-07-21 22:14:09 +00:00
Tom Lane 1ea912e16d Fix sloppiness about alignment requirements in findsplitloc() space
calculation, also make it stop when it has a 'good enough' split instead
of exhaustively trying all split points.
2000-07-21 19:21:00 +00:00
Philip Warner c3e18804ff - Support for TAR output
- Support for BLOB output from pg_dump and input via pg_restore
- Support for direct DB connection in pg_restore
- Fixes in support for --insert flag
- pg_dump now outputs in modified OID order
2000-07-21 11:43:26 +00:00
Philip Warner e8f69be054 - Support for BLOB output from pg_dump and input via pg_restore
- Support for direct DB connection in pg_restore
- Fixes in support for --insert flag
- pg_dump now outputs in modified OID order
- various other bug fixes
2000-07-21 11:40:08 +00:00
Jan Wieck 0143d391c6 Need to switch to tuples memory context when replacing the toasted
one with the plain one.

Jan
2000-07-21 11:18:51 +00:00
Jan Wieck 82f3945a67 Temporary fix to make TOAST vacuum-safe. All values are forced to be
in memory (plain or compressed) in the tuple returned from the heap-am.
So no index will ever contain an external reference.

Jan
2000-07-21 10:31:31 +00:00
Tom Lane 9e85183bfc Major overhaul of btree index code. Eliminate special BTP_CHAIN logic for
duplicate keys by letting search go to the left rather than right when an
equal key is seen at an upper tree level.  Fix poor choice of page split
point (leading to insertion failures) that was forced by chaining logic.
Don't store leftmost key in non-leaf pages, since it's not necessary.
Don't create root page until something is first stored in the index, so an
unused index is now 8K not 16K.  (Doesn't seem to be as easy to get rid of
the metadata page, unfortunately.)  Massive cleanup of unreadable code,
fix poor, obsolete, and just plain wrong documentation and comments.
See src/backend/access/nbtree/README for the gory details.
2000-07-21 06:42:39 +00:00
Peter Mount 9eddc7519d Fixed DatabaseMetaData.getTableTypes() 2000-07-20 15:30:05 +00:00
Jan Wieck 9b0fe4eee2 Fixed memory allocation problems when compressing multi-MB
items. Lookup history is now a double linked list, used in
a wrap-around style.

Jan
2000-07-20 14:23:28 +00:00
Peter Eisentraut 6a00a7eb72 Don't need this anymore. It's now handled in the Makefile. 2000-07-19 22:47:13 +00:00
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
Peter Eisentraut de85dd1d51 - format_type function, in use by psql
- added bigint as synonym of int8
- set typelem of varlen non-array types to 0
2000-07-07 19:24:43 +00:00
Bruce Momjian 364985542b Rename cash_words_out to cash_words. 2000-07-07 18:49:56 +00:00
Bruce Momjian 16e948781c |> 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?

Andreas Schwab
2000-07-07 01:23:44 +00:00
Tom Lane 9f442cbf13 Correct unsafe use of strcmp(). See rant of same date posted to pghackers. 2000-07-06 23:03:37 +00:00
Peter Eisentraut f0b4ae697f 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.
2000-07-06 21:33:45 +00:00
Jan Wieck b027ad9a7a Added comments about the compression algorithm as requested by Tom
Jan
2000-07-06 21:02:07 +00:00
Jan Wieck 43f6ab8654 Please find attached a patch for the pg_dump directory which addresses:
- The problems Jan reported

- incompatibility with configure (now uses HAVE_LIBZ instead of HAVE_ZLIB)

- a problem in auto-detecting archive file format on piped archives

Philip Warner
2000-07-06 18:39:39 +00:00
Jan Wieck 2a225ebf18 Bugfix. If toasted tuple containted NULLs, DataFill() was handed
a wrong pointer causing the bitmap overwriting the tuple header.

Jan
2000-07-06 18:22:45 +00:00
Tom Lane 8ecac94bb2 Functions on 'text' type updated to new fmgr style. 'text' is
now TOAST-able.
2000-07-06 05:48:31 +00:00
Tom Lane 40f64064ff 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.
2000-07-05 23:12:09 +00:00
Tom Lane 282713a836 Make the regression tests safe for TOAST. 2000-07-05 23:02:37 +00:00
Tom Lane 6d1ae0c91b Fix typo (extraneous semicolon) in fd.c patch to avoid excess seeks.
Now it skips useless SEEK_CUR 0 calls too, as intended.
2000-07-05 21:10:05 +00:00
Jan Wieck 98fe670360 Enable pg_rewrite to be toasted (unlimited size of views and rules).
Jan
2000-07-05 19:51:03 +00:00
Marc G. Fournier 8bef689043 add check for libz compression library for pg_dump 2000-07-05 17:44:29 +00:00
Jan Wieck 6534444d19 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.

Jan
2000-07-05 16:17:43 +00:00
Bruce Momjian 411cf2da3f 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.

Reinhard Max
2000-07-05 16:09:31 +00:00
Jan Wieck 972604ec60 Small fix for ALTER TABLE xxx* ADD COLUMN ...
Inherited child tables must not be open during creation of TOAST table

Jan
2000-07-05 13:50:59 +00:00
Jan Wieck 93e1f5de0b Automatically create toast tables on ALTER TABLE ... ADD COLUMN
and SELECT ... INTO ... too.

Jan
2000-07-05 13:22:25 +00:00
Jan Wieck 030962da26 Bugfix in ALTER TABLE CREATE TOAST TABLE
Automatically create toast table at CREATE TABLE if new table
has toastable attributes.

Jan
2000-07-05 12:45:31 +00:00
Jan Wieck f2dfd5616c Fixed lztextlen() bug in MULTIBYTE, still thinking that lztext
does compression itself the old way.

Jan
2000-07-05 10:09:53 +00:00
Bruce Momjian 0971d894b9 New resultmap for Alpha, from Ryan Kirkpatrick 2000-07-05 04:28:19 +00:00
Peter Eisentraut b5e2dafd39 Fix broken pg_dump makefile 2000-07-04 19:52:00 +00:00
Jan Wieck d819f5fe83 Moving toaster out of NO ELOG area in heap_update().
Jan
2000-07-04 17:11:40 +00:00
Bruce Momjian 651e98b17f make TEMP -> TEMPORARY 2000-07-04 16:57:49 +00:00
Bruce Momjian edbe00a720 Make pgdump_oid a temp table. Rename to pg_dump_oid. 2000-07-04 16:57:18 +00:00
Peter Eisentraut 554e56e628 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.)
2000-07-04 16:32:01 +00:00
Peter Eisentraut 1c2f735aa7 Fix thinko in my last pg_dumpall change 2000-07-04 16:29:59 +00:00
Bruce Momjian 500b62b057 pg_dump patch from Philip Warner 2000-07-04 14:25:28 +00:00
Tom Lane cdeca5f590 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.
2000-07-04 06:11:54 +00:00
Tom Lane 3b61ba6d5c DataFill() has no business resetting xact status bits
in the infomask of the provided tuple.
2000-07-04 02:40:56 +00:00
Vadim B. Mikheev d0273c07ac misc 2000-07-04 01:49:44 +00:00
Vadim B. Mikheev e1a118e5e6 unlock buffer before releasing in heap_insert
+unlock buffer in heap_fetch under !ItemIdIsUsed().
2000-07-04 01:39:24 +00:00
Tom Lane 13647ad6aa tuptoaster.h should surely not #include postgres.h. 2000-07-04 00:04:03 +00:00
Tom Lane e81fe1e8a0 Add missing #include for TOAST. 2000-07-03 23:58:32 +00:00
Jan Wieck 2f12c9f182 TOAST changes to catalog
Jan
2000-07-03 23:19:04 +00:00
Jan Wieck 57d8080a40 TOAST
WARNING: This is actually broken - we have self-deadlocks
	         due to concurrent changes in buffer management.
			 Vadim and me are working on it.

Jan
2000-07-03 23:10:14 +00:00
Peter Eisentraut ef5bea51e1 Move global internal files to PGDATA/global. 2000-07-03 20:48:46 +00:00
Peter Eisentraut e2d3932e0e 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.
2000-07-03 20:46:10 +00:00
Peter Eisentraut 51afb9305c 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.
2000-07-03 16:35:39 +00:00
Bruce Momjian efcff3da16 In the attache is new (correct) version. I add TZ (timezone) support
for
to_char() too.

Karel
2000-07-03 16:01:33 +00:00
Hiroshi Inoue 61768d8cac Add a check of HEAP_MARKED_FOR_UPDATE in HeapTupleSatisfiesDirty().
This enables unique constraint check in case of SELECT FOR UPDATEd.
2000-07-03 04:45:09 +00:00
Tom Lane c4f9eaa608 Clean up memory-context stuff, other minor infelicities. 2000-07-03 03:57:03 +00:00
Tom Lane 6ac19b165d Remove unused variable. (Hey Peter, you use gcc, why didn't you
notice this warning?)
2000-07-03 03:27:31 +00:00
Vadim B. Mikheev 1b67fe17b8 heap' logging 2000-07-03 02:54:21 +00:00
Bruce Momjian 80c646958a Attached is a new patch which addresses this problem. (oids in
regression tests).

Chris Bitmead
2000-07-02 22:01:27 +00:00
Peter Eisentraut 6fb9d2e347 Version number now set in configure, available through Makefile.global
and config.h. Adjusted all referring code.

Scrapped pg_version and changed initdb accordingly. Integrated
src/utils/version.c into src/backend/utils/init/miscinit.c. Changed all
callers.

Set version number to `7.1devel'. (Non-numeric version suffixes now allowed.)
2000-07-02 15:21:27 +00:00
Tom Lane 07dfe97731 Don't run in CacheMemoryContext more than necessary. 2000-07-02 05:38:40 +00:00
Tom Lane d003213225 Don't run in CacheMemoryContext longer than necessary. 2000-07-02 04:46:09 +00:00
Tom Lane 72164e86a6 Remove memory leak from VACUUM parsing. 2000-07-02 04:04:09 +00:00
Tom Lane 57eeb0d315 New memmgr logic in xact.c failed if AbortTransaction() is called when
there is no open transaction.
2000-07-02 02:28:38 +00:00
Bruce Momjian e225260440 Back out Karels to_char changes. 2000-07-01 21:27:14 +00:00
Peter Eisentraut b150906b89 We don't need config.status substituting anything into Gen_fmgrtab.sh, we
just pass in CPP and AWK via the environment from the Makefile.
2000-07-01 21:16:44 +00:00
Peter Eisentraut 191870388d A little bit of clean-up/bug fix in Tcl build. Handle gracefully cases
where someone wants to build these but hasn't configured for Tcl.
2000-07-01 15:02:31 +00:00
Bruce Momjian 99212a4847 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.

                                        Karel
~
~
2000-07-01 14:10:32 +00:00
Bruce Momjian 2f131ca588 Fix select '1--2'; for PEter. 2000-06-30 18:03:40 +00:00
Peter Eisentraut 385470f8c6 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.
2000-06-30 16:11:02 +00:00
Tom Lane 3513f4d162 RemoveView was doing things the hard way... 2000-06-30 07:06:05 +00:00
Tom Lane b41f4ab8c4 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.
2000-06-30 07:04:23 +00:00
Bruce Momjian c9ec78a6b8 Fix quotes in /* */ comments in psql. 2000-06-29 16:27:57 +00:00
Tom Lane 43ba1b4420 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.
2000-06-29 07:35:57 +00:00
Tom Lane 6a7b40d909 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.
2000-06-29 05:50:29 +00:00
Tom Lane d1080d19b1 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).
2000-06-29 02:26:23 +00:00
Tom Lane feb48f41af Add SIGFPE to list of signals never to block. #ifdef all signals in
that list to cope with platforms that don't have them all.
2000-06-29 02:17:42 +00:00
Bruce Momjian 932d1e5f9e Add #ifdef for LC_MESSAGES, because it is not ANSI C standard, and BSDI
does not have it.
2000-06-29 01:19:36 +00:00
Peter Eisentraut 44f64dd3ea Makefile cleanup for interface tree. Now essentially with all the
standard targets and behaviour. Replaced Makefile.in's with
Makefile's and declared the respective variables in Makefile.global.

maintainer-clean target now available at top level, although it does
not work in the backend tree yet.

Cleanup pass over Makefile.shlib, renamed some targets and variables.
The shared library symlink tests are now done by make, not the shell.

ecpg: Remove one warning in sloppy flex output.

PL/Perl and Perl interface: the MakeMaker documentation is confusing,
the realclean target *does* "delete derived files", but it also
uninstalls them. Don't use that.

The submake targets in the various bin directories that update libpq
should `make all', not `make libpq.a'. That is a) unportable, and
b) doesn't build the shared library.
2000-06-28 18:30:16 +00:00
Tom Lane 5ac1eac2a6 Suppress memory leak in COPY WITH OIDS TO wherever. 2000-06-28 06:05:36 +00:00
Tom Lane 13612a97b9 Repair incorrect assumption that all versions of 'install' know
how to install multiple files in one invocation.
2000-06-28 05:09:37 +00:00
Tom Lane 1aebc3618a First phase of memory management rewrite (see backend/utils/mmgr/README
for details).  It doesn't really do that much yet, since there are no
short-term memory contexts in the executor, but the infrastructure is
in place and long-term contexts are handled reasonably.  A few long-
standing bugs have been fixed, such as 'VACUUM; anything' in a single
query string crashing.  Also, out-of-memory is now considered a
recoverable ERROR, not FATAL.
Eliminate a large amount of crufty, now-dead code in and around
memory management.
Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and
backend startup.
2000-06-28 03:33:33 +00:00
Bruce Momjian b601c8d882 Tamotsu Nakagawa has posted a fix for this to a local mail list in
Japan. Can someone comment on this? According to him, with the patch
now only the geometry test fails.

 Tatsuo Ishii
2000-06-27 18:08:49 +00:00
Peter Eisentraut 5bb8b62983 Makefile cleanup for bin and pl subtrees. They should now support
all the standard semantics. Also get rid of Makefile.in's on the
way and instead declare all variables in Makefile.global.
2000-06-27 00:32:06 +00:00