Commit Graph

8074 Commits

Author SHA1 Message Date
Bruce Momjian 385d271b81 Comment additions in parser. 2001-05-19 01:57:11 +00:00
Bruce Momjian 5e987038ce Move ParserFuncOrColumn function higher in the file. 2001-05-19 00:37:45 +00:00
Bruce Momjian 5ec8474323 New comment. This func/column things has always confused me.
/*
 *  parse function
 *  This code is confusing because the database can accept
 *  relation.column, column.function, or relation.column.function.
 *  In these cases, funcname is the last parameter, and fargs are
 *  the rest.
 *
 *  It can also be called as func(col) or func(col,col).
 *  In this case, Funcname is the part before parens, and fargs
 *  are the part in parens.
 *
 */
Node *
ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
                  bool agg_star, bool agg_distinct,
                  int precedence)
2001-05-19 00:33:20 +00:00
Bruce Momjian f61d70c2ac Undo \dT change. Not worth it. 2001-05-18 22:54:23 +00:00
Bruce Momjian 2fd831d323 Rename ParseFuncOrColumn() to ParseColumnOrFunc(). 2001-05-18 22:35:51 +00:00
Bruce Momjian dc0ff5c67a Small code cleanups,formatting. 2001-05-18 21:24:20 +00:00
Jan Wieck 27b0e8c0b0 Adding ELSIF support contributed by Klaus Reger.
Jan
2001-05-18 21:16:59 +00:00
Tom Lane a9da3fed30 Suppress compiler warnings about pid_t vs int. 2001-05-18 17:49:52 +00:00
Tom Lane 78b674ba35 Add regression test to catch future breakage of avg(interval). This
aggregate seems uniquely fragile, because it's the only one with an
agginitval that's at all likely to change in format.
2001-05-18 16:02:01 +00:00
Tom Lane 1945096324 Correct recently-broken avg(interval) definition. 2001-05-18 15:59:04 +00:00
Peter Eisentraut f000ffd28e Add -U and -W options to pg_dump and friends to support non-interactive
specification of username (like in psql).  pg_dumpall now works with
password authentication.
2001-05-17 21:12:49 +00:00
Peter Eisentraut 761a0bb69b Add dynamic_library_path parameter and automatic appending of shared
library extension.
2001-05-17 17:44:18 +00:00
Bruce Momjian 8266e8a84b OK, now pgindent has blank lines before comment blocks, except when
there is a brace on the line above it.
2001-05-17 16:11:08 +00:00
Bruce Momjian 2d7795ebb4 Prevent forced blank line before comment block in pgindent. 2001-05-17 15:55:24 +00:00
Bruce Momjian e044fc0599 Spacing cleanup. 2001-05-17 15:22:12 +00:00
Bruce Momjian 806aba49fd Small cleanup of spacing. 2001-05-17 14:59:31 +00:00
Bruce Momjian e4f2bea7fb Add HISTORY items for 7.1.2. 2001-05-17 13:28:30 +00:00
Bruce Momjian 8783d2a5bf Add missing space to sample cvs call. 2001-05-17 13:20:35 +00:00
Bruce Momjian a8a487df9f Fix pg_index statistics query to join proper relation. 2001-05-17 11:54:04 +00:00
Bruce Momjian f107174e8c Included is a patch that fixes a bug introduced in the lastest version
(1.22) of interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java.  That
change removed a line that set the variable s to the value of the
stringbuffer.   This fix changes the following if checks to check the
length of the stringbuffer instead of s, since s no longer contains the
string the if conditions are expecting.

The bug manifests itself in getTimestamp() loosing the timezone
information of timestamps selected from the database, thereby causing
the time to be incorrect.

Barry Lind
2001-05-17 04:10:02 +00:00
Bruce Momjian 2e3c56a0ea Cleanup of backpatch of jdbc2 improvements to jdbc1:
Here's what I came up with. The biggest difference api between JDK1.x and
later versions is the support for collections. The problem was with the
Vector class; in jdk1.x there is no method called add, so I changed the
calls to addElement. Also no addAll, so I rewrote the method slightly to not
require addAll. While reviewing this I notices some System.out.println
statements that weren't commented out. So I commented them out in both
versions.

The upshot of all of this is that I have clean compile, but no idea if the
code works ;(

Dave Cramer
2001-05-17 03:55:04 +00:00
Bruce Momjian 1ef5c99c85 Fix 'make clean' with jdbc and ant by using filesets. 2001-05-17 03:22:53 +00:00
Hiroshi Inoue e7ffdd4475 1) Decrease the size of some buffers.
2) Repair broken SQLStatistics().
2001-05-17 02:56:37 +00:00
Tom Lane 77f277575a Replace poorly-coded vac_find_eq routine with call to standard bsearch
library code.  Tweak progress messages to include elapsed real time,
not only CPU time.
2001-05-17 01:28:50 +00:00
Bruce Momjian 6c183005d3 Mark column as not used. 2001-05-17 00:29:52 +00:00
Bruce Momjian 8128ae686f Add missing paren. 2001-05-16 22:36:03 +00:00
Tom Lane 27336e4f7a Repair race condition introduced into heap_update() in 7.1 ---
PageGetFreeSpace() was being called while not holding the buffer lock, which
not only could yield a garbage answer, but even if it's the right answer there
might be less space available after we reacquire the buffer lock.

Also repair potential deadlock introduced by my recent performance improvement
in RelationGetBufferForTuple(): it was possible for two heap_updates to try to
lock two buffers in opposite orders.  The fix creates a global rule that
buffers of a single heap relation should be locked in decreasing block number
order.  Currently, this only applies to heap_update; VACUUM can get away with
ignoring the rule since it holds exclusive lock on the whole relation anyway.
However, if we try to implement a VACUUM that can run in parallel with other
transactions, VACUUM will also have to obey the lock order rule.
2001-05-16 22:35:12 +00:00
Bruce Momjian 5abaa779c4 Fix for HASH for index lookups in ODBC. 2001-05-16 17:47:27 +00:00
Bruce Momjian 7934c93cbe This patch fixes a bug which occurs when setObject(1,obj) is called and obj
is of type Object, and is null

Dave Cramer
2001-05-16 17:22:25 +00:00
Bruce Momjian 37b006e074 Add NUMERIC tests to jdbc code.
David Esposito
2001-05-16 17:09:26 +00:00
Bruce Momjian 863c9d11f1 I was trying to get a very nice FREE graphical db tool called DbVisualizer
(http://www.ideit.com/products/dbvis/) to work with Postgresql and I found
out the following bug: if database has views then getTables() gets the null
pointer exception ('order by relname' makes the listing tree in
DbVisualizer a lot useful !!)

This patch should propably be applied to the the jdbc1's
DatabaseMetaData.java, too.

Panu Outinen
2001-05-16 16:42:31 +00:00
Bruce Momjian 01cc344011 Change the line:
return ((c == 't') || (c == 'T'));
int the getBoolean function on line 184:ish to:
 return ((c == 't') || (c == 'T') (c == '1'));

Hunter Hillegas
2001-05-16 16:30:38 +00:00
Bruce Momjian 9cdf723142 Backpatch jdbc2 fixes to jdbc1, ANT fixes, from Peter Eisentraut 2001-05-16 16:20:53 +00:00
Bruce Momjian 1292467db1 Backpatch getImportedKeys to jdbc1. 2001-05-16 04:08:50 +00:00
Bruce Momjian aad93fb433 Backpatch ORDER BY fix to jdbc1. 2001-05-16 04:01:04 +00:00
Bruce Momjian c5039e059e Here's an easy patch for todays snapshot to sort the result of the
public ResultSet getTables(String catalog, String schemaPattern, String

Jeroen van Vianen
2001-05-16 03:50:08 +00:00
Bruce Momjian 41a20bbbdf jdbc2 implementation of getImportedKeys.
Ola Sundell
2001-05-16 03:40:25 +00:00
Bruce Momjian e046e1dfab The current implementation of BlobInputStream does
not properly handle 8-bit unsigned data as it blindly
casts the byte to an int, which java most helpfully
promotes to a signed type.  This causes problems when
you can only return -1 to indicated EOF.

The following patch fixes the bug and has been tested
locally on image data.

Chad David
2001-05-16 03:29:01 +00:00
Peter Eisentraut dbb219b896 Add missing dlfcn.h includes. Fix "" vs <>. 2001-05-15 16:55:27 +00:00
Tom Lane 6f3da9ae17 Remove unnecessary EvalPlanQual support code --- since this plan node
type never scans a relation directly, it can't be an EPQ target.
Explicitly drop subplan's tuple table to ensure we have no buffer pin
leaks.
2001-05-15 16:11:58 +00:00
Bruce Momjian d0e1091cfd we found a problem in GiST with massive insert/update operations
with many NULLs ( inserting of NULL into indexed field cause
ERROR: MemoryContextAlloc: invalid request size)
As a workaround 'vacuum analyze' could be used.

This patch resolves the problem, please upply to 7.1.1 sources and
current cvs tree.

Oleg Bartunov
2001-05-15 14:14:49 +00:00
D'Arcy J.M. Cain 9478206d32 Fix small thinko. 2001-05-15 13:28:56 +00:00
Bruce Momjian 0eacc60e23 Fix regression for new oids. 2001-05-15 04:12:56 +00:00
Bruce Momjian ed6998d0b3 Re-add pg_index.indhaskeytype. 2001-05-15 03:49:35 +00:00
Bruce Momjian f756acf8a8 Re-add pg_index.indisclustered in a minimalist way. Also fix BSDi
dynamic linker change.  #include must be before #ifdef test.
2001-05-15 01:12:59 +00:00
Tom Lane 7809cbf7e6 Some badly needed documentation about EvalPlanQual. 2001-05-15 00:35:50 +00:00
Tom Lane a4155d3bbd EvalPlanQual was thoroughly broken for concurrent update/delete on inheritance
trees (mostly my fault).  Repair.  Also fix long-standing bug in ExecReplace:
after recomputing a concurrently updated tuple, we must recheck constraints.
Make EvalPlanQual leak memory with somewhat less enthusiasm than before,
although plugging leaks fully will require more changes than I care to risk
in a dot-release.
2001-05-15 00:33:36 +00:00
Tom Lane e611348894 Let's stick to the documented number of digits in CATVERSION, shall we? 2001-05-15 00:00:15 +00:00
Bruce Momjian 9d17a1dd29 Update regression for new oids, some now two smaller. 2001-05-14 22:16:15 +00:00
Peter Eisentraut 70aa2ae6a5 Remove linking hacks now that dynloader is fixed. 2001-05-14 22:06:50 +00:00
Bruce Momjian 80d4ae931a Small include file fix for pg_variabie.h 2001-05-14 22:06:41 +00:00
Bruce Momjian 61ba9e685b Update catalog version for fix. 2001-05-14 21:59:19 +00:00
Bruce Momjian 7d9504d4e2 Pg_varaiable removal cleanup found from regression. 2001-05-14 21:58:10 +00:00
Bruce Momjian 783fbdab70 Remove columns pg_index.haskeytype and pg_index.indisclustered. Not used. 2001-05-14 21:53:16 +00:00
Peter Eisentraut c87bc779d4 Use RTLD_GLOBAL flag for dlopen-style dynamic loaders. 2001-05-14 21:45:53 +00:00
Bruce Momjian 1e7b79cebc Remove unused tables pg_variable, pg_inheritproc, pg_ipl tables. Initdb
forced.
2001-05-14 20:30:21 +00:00
Tom Lane 248182560c Current implementation of FOR UPDATE has no hope of working correctly
for relations on the nullable side of an OUTER JOIN.  For now I think
we'd better refuse such queries.
2001-05-14 20:25:00 +00:00
Peter Eisentraut 1f5191ef34 Cope with configure arguments that contain spaces. 2001-05-13 00:12:05 +00:00
Tom Lane e7c5639226 proisstrict must be assumed FALSE when dumping from a 7.0 database,
not TRUE.  Otherwise we break pl call handler functions.  fmgr_oldstyle
will take care of making sure the semantics are the same for C functions.
Clean up some slightly grotty coding in 7.0 pg_class reading, also.
2001-05-12 23:36:03 +00:00
Tom Lane eedb7d18fa Modify RelationGetBufferForTuple() so that we only do lseek and lock
when we need to move to a new page; as long as we can insert the new
tuple on the same page as before, we only need LockBuffer and not the
expensive stuff.  Also, twiddle bufmgr interfaces to avoid redundant
lseeks in RelationGetBufferForTuple and BufferAlloc.  Successive inserts
now require one lseek per page added, rather than one per tuple with
several additional ones at each page boundary as happened before.
Lock contention when multiple backends are inserting in same table
is also greatly reduced.
2001-05-12 19:58:28 +00:00
Peter Eisentraut d9f55edc2c Add provisions for using strdup replacement in the places that still
needed it.

from our fearless Ultrix porter, Alexander Klimov <ask@wisdom.weizmann.ac.il>
2001-05-12 19:49:48 +00:00
Peter Eisentraut b3f66d1980 Add command '\pset footer' to psql to turn off default "(x rows)" footer. 2001-05-12 19:44:46 +00:00
Peter Eisentraut bbc3920fe9 PL/Python should build portably now, if you can get over the fact that
there's no shared libpython.  Test suite works as well. Also, add some
documentation.
2001-05-12 17:49:32 +00:00
Tom Lane 02549a2d2c Add comment to explain need for bizarre-looking coding in HandleSlashCmds. 2001-05-12 17:37:15 +00:00
Peter Eisentraut 2e1579a99f Make bootstrap debug messages more readable. Clean up some clutter. 2001-05-12 01:48:49 +00:00
Peter Eisentraut c51b00a213 PL/Python integration: support in create/droplang, add CVS keywords,
remove useless files, beat some sense into Makefile.  For me it builds
and sort of runs, so it's a start.
2001-05-12 01:30:30 +00:00
Philip Warner bb30d49a2a - Don't dump COMMENTs in data-only dumps
- Fix view dumping SQL for V7.0
 - Fix bug when getting view oid with long view names
 - Treat SEQUENCE SET TOC entries as data entries rather than schema
   entries.
 - Make allowance for data entries that did not have a data dumper
   routine (eg. SEQUENCE SET)
2001-05-12 01:03:59 +00:00
Peter Eisentraut 5e19e14ecd Cleanups of pltcl unknown thingy. 2001-05-11 23:38:06 +00:00
Tom Lane 1c1eb0fa0e Suppress failures in parallel regress tests due to use of same table
name in two different tests.  This solution does not meet with universal
approval, so it may get changed later ...
2001-05-11 05:09:03 +00:00
Bruce Momjian 54d9099596 Stamp CVS as 7.2. Update all interface version numbers. This is the
time to do it, not during beta because people are using this stuff in
production sometimes.
2001-05-11 01:46:33 +00:00
Bruce Momjian d4dfef1cdb Stamp for 7.1.2. Ready when you are... 2001-05-11 01:34:14 +00:00
Bruce Momjian 1f7cb07905 BSD/OS has new precision, and negative zeros now. 2001-05-10 23:46:25 +00:00
Bruce Momjian 07dfc6970a Up version to force initdb to fix regression problems. 2001-05-10 22:39:24 +00:00
Tom Lane 642107d5ba Avoid unnecessary lseek() calls by cleanups in md.c. mdfd_lstbcnt was
not being consulted anywhere, so remove it and remove the _mdnblocks()
calls that were used to set it.  Change smgrextend interface to pass in
the target block number (ie, current file length) --- the caller always
knows this already, having already done smgrnblocks(), so it's silly to
do it over again inside mdextend.  Net result: extension of a file now
takes one lseek(SEEK_END) and a write(), not three lseeks and a write.
2001-05-10 20:38:49 +00:00
Bruce Momjian 72c8af51fd Move disabled message up to a higher makefile. 2001-05-10 03:00:11 +00:00
Tom Lane c23bc6fbb0 First cut at making indexscan cost estimates depend on correlation
between index order and table order.
2001-05-09 23:13:37 +00:00
Bruce Momjian 8ace5114dc This directory contains a module that implements the "Metaphone" code as
a PostgreSQL user-defined function.  The Metaphone system is a method of
matching similar sounding names (or any words) to the same code.

Metaphone was invented by Lawrence Philips as an improvement to the popular
name-hashing routine, Soundex.

This metaphone code is from Michael Kuhn, and is detailed at
   http://aspell.sourceforge.net/metaphone/metaphone-kuhn.txt

Joel Burton
2001-05-09 23:00:44 +00:00
Peter Eisentraut 2c6373fafa Add --echo option to createlang and droplang.
from Oliver Elphick
2001-05-09 22:08:19 +00:00
Bruce Momjian 91e3b85529 Wow, I am getting good at this Makefile stuff. Peter may be OK with it. 2001-05-09 21:42:29 +00:00
Bruce Momjian a1a12b8a0c I think I got the pltcl Makefile unknown rules working properly. 2001-05-09 21:35:11 +00:00
Bruce Momjian bea7a88576 I have modifed heap.c so that it won't automatically generate duplicate
constraint names.

> > A reasonable interpretation of DROP CONSTRAINT "foo" is to drop *all*
> > constraints named "foo" on the target table.
>
> Then it should probably be a good thing to avoid the automatic
> generation of
> duplicate names?  I might take a look at that, actually...
>

Christopher Kings-Lynne
2001-05-09 21:13:35 +00:00
Bruce Momjian 999a4d48d3 that's just me again, here's normal patch for KOI8_U to
jdbc/Connection.java

Andy
P.S. in Connection.java if encoding=="WIN" then dbEncoding is set to
"Cp1252".
What if it's Cyrillic "WIN"? Than it should be "Cp1251". Is there any
way to fix that without making different "WIN" encodings in
PostgreSQL?

Andy Rysin
2001-05-09 21:11:26 +00:00
Bruce Momjian 8678929c22 This patch should catch cases where the types
in referencing and referenced columns of an fk constraint
aren't comparable using '=' at constraint definition time
rather than insert/update time.

Stephan Szabo
2001-05-09 21:10:39 +00:00
Bruce Momjian 0007be5da7 More cleanups to generate tcl unknown from Makefile. 2001-05-09 20:30:09 +00:00
Bruce Momjian 36f41c7126 Make tcl unknown configure from Makefile, not configure. 2001-05-09 20:19:30 +00:00
Bruce Momjian 14536f591d More --enable-pltcl-unknown renames. 2001-05-09 20:08:08 +00:00
Bruce Momjian 27f17e1485 Change to enable_pltcl_unknown mention. 2001-05-09 19:57:33 +00:00
Bruce Momjian ec9cc733ca Add TODO file. 2001-05-09 19:55:22 +00:00
Bruce Momjian 0bef7ba549 Add plpython code. 2001-05-09 19:54:38 +00:00
Bruce Momjian f598201348 Noticed a small bug in the code. Probably been there for some time. Note
that the original code would consider things like UNIX domain sockets are
regular files.

Gavin Sherry
2001-05-09 19:28:31 +00:00
Bruce Momjian f7659a9c18 This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.


Also it adds substituting of tclsh with tclsh that was by configure in
pltcl_*mod scripts. For example, On freebsd, tclsh can be called
tclsh8.2 or
tclsh8.3 depending on installed version of Tcl.

After patching files
  src/pl/tcl/modules/pltcl_listmod
  src/pl/tcl/modules/pltcl_loadmod
  src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
  src/pl/tcl/modules/pltcl_listmod.in
  src/pl/tcl/modules/pltcl_loadmod.in
  src/pl/tcl/modules/pltcl_delmod.in

seva@sevasoft.kiev.ua
2001-05-09 19:19:00 +00:00
Bruce Momjian d8eade3784 Right-align \du user-id. 2001-05-09 17:57:42 +00:00
Bruce Momjian 68319f9103 Fix memory leak in new psql \du code. 2001-05-09 17:49:42 +00:00
Bruce Momjian b0546a2554 Fix libpq++'s FieldSize to return int, not short. 2001-05-09 17:46:11 +00:00
Bruce Momjian 9668b948f7 Add mention of getLength returning short. 2001-05-09 17:37:17 +00:00
Bruce Momjian a79b698adb Here's a version of my suggested diffs transplanted to 7.1 beta 5. I'm
still looking at the best way to integrate Tom Vijlbrief's fixes
(insofar as they're still needed); would 7.2 be a suitable time for
incompatible API changes?


Jeroen


Changes:

(*) Introduced bool, true, false (replacing some int, 1, 0)
(*) Made some member functions const
(*) Documented GetIsNull()
(*) Marked DisplayTuples() and PrintTuples() as obsolescent; fixed possible
    portability problem (assumed that NULL pointer equals all-zero bit pattern)
(*) PrintTuples(): renamed width parameter to fillAlign to conform with other
    usage; fixed memory leak and compile issue w.r.t. field separator (should
    also slightly improve performance)
(*) Fixed some minor compilation issues
(*) Moved "using namespace std;" out of headers, where they didn't belong; used
    new (temporary) preprocessor macro PGSTD to do this
(*) Made ToString() static, removed unneeded memset(), made buffer size adapt
    to sizeof(int)
(*) Made some constructors explicit
(*) Changed some const std::string & parameters to plain std::string
(*) Marked PgCursor::Cursor(std::string) as obsolescent (setter with same name
    as getter--bad style)
(*) Renamed some paramaters previously named "string"
(*) Introduced size_type typedef for number of tuples in result set
(*) PgTransaction now supports re-opening after closing, and aborts if not
    explicitly committed prior to destruction

J. T. Vermeulen
2001-05-09 17:29:10 +00:00
Peter Eisentraut c8db55f78a Use ColId instead of Ident for SET SESSION AUTHORIZATION. 2001-05-09 16:50:44 +00:00
Bruce Momjian 766a44f77f Mention new jdbc mailing list instead of interfaces list. 2001-05-09 15:51:37 +00:00
Tom Lane 6cda3ad8fe Cause planner to make use of average-column-width statistic that is now
collected by ANALYZE.  Also, add some modest amount of intelligence to
guesses that are used for varlena columns in the absence of any ANALYZE
statistics.  The 'width' reported by EXPLAIN is finally something less
than totally bogus for varlena columns ... and, in consequence, hashjoin
estimating should be a little better ...
2001-05-09 00:35:09 +00:00
Peter Eisentraut 1c1c58c76c Add SET SESSION AUTHORIZATION command. 2001-05-08 21:06:43 +00:00
Bruce Momjian c50aa9db70 Mention SHELL usage in initdb. 2001-05-08 20:38:00 +00:00
Tom Lane 5708a56729 Append and SubqueryScan nodes were not passing changed-parameter signals down
to their children, leading to misbehavior if they had any children that paid
attention to chgParam (most plan node types don't).  Append's bug has been
there a long time, but nobody had noticed because it used to be difficult
to create a query where an Append would be used below the top level of a
plan; so there were never any parameters getting passed down.  SubqueryScan
is new in 7.1 ... and I'd modeled its behavior on Append :-(
2001-05-08 19:47:02 +00:00
Peter Eisentraut c3fa600d8c Need to factor out strdup.o for separate treatment since it's in a
different directory.  This makes dependency tracking work and copes with
compilers that don't suport -c and -o together.
2001-05-08 19:38:57 +00:00
Bruce Momjian 82c9ce2c40 Small cleanup. 2001-05-08 19:00:26 +00:00
Bruce Momjian 857abb0e57 Add newlines around debug output in optimizer showing total costs. 2001-05-08 17:25:28 +00:00
Bruce Momjian 1c551683cb Run pgindent on ODBC code only, to reformat new comments. 2001-05-08 17:12:36 +00:00
Bruce Momjian 296e7ba2ba ODBC source code cleanup patch. Should match rest of PostgreSQL code better. 2001-05-08 17:06:18 +00:00
Bruce Momjian 062a79a990 Allow SHELL in Makefile.* to control initdb. 2001-05-08 16:28:46 +00:00
Bruce Momjian 0b68b89b02 Fix paren typo in java. 2001-05-08 15:29:14 +00:00
Tom Lane eb62f076d0 Un-break exec_move_row() for case that a NULL tuple and tupdesc are
passed, which occurs when no rows are retrieved by a SELECT.
Mea maxima culpa ... I should have caught this.
2001-05-08 01:00:53 +00:00
Bruce Momjian ef06003b06 Fix comment in file about 2*max_connections. 2001-05-07 23:32:55 +00:00
Peter Eisentraut f7bfb5518d Shared library and GCC support for SCO OpenServer. 2001-05-07 20:43:28 +00:00
Peter Eisentraut 465cf168eb Fix remaining RI permission problems (cascaded update/delete, restrict,
set null/default).
2001-05-07 19:57:24 +00:00
Peter Eisentraut 232724af0d Add \cd command to psql. 2001-05-07 19:31:33 +00:00
Bruce Momjian 415263b2d2 > Occasionally and without warning I get this from my daily vacuum
> cronjob:
> NOTICE:  RegisterSharedInvalid: SI buffer overflow
> NOTICE:  InvalidateSharedInvalid: cache state reset
> I don't understand what these mean. Should I be concerned about them
> and what do they signify?

No real need to worry.  Those should've been downgraded to DEBUG-level
messages a release or two back, but nobody bothered...

Tom Lane
2001-05-07 17:20:19 +00:00
Tom Lane f905d65ee3 Rewrite of planner statistics-gathering code. ANALYZE is now available as
a separate statement (though it can still be invoked as part of VACUUM, too).
pg_statistic redesigned to be more flexible about what statistics are
stored.  ANALYZE now collects a list of several of the most common values,
not just one, plus a histogram (not just the min and max values).  Random
sampling is used to make the process reasonably fast even on very large
tables.  The number of values and histogram bins collected is now
user-settable via an ALTER TABLE command.

There is more still to do; the new stats are not being used everywhere
they could be in the planner.  But the remaining changes for this project
should be localized, and the behavior is already better than before.

A not-very-related change is that sorting now makes use of btree comparison
routines if it can find one, rather than invoking '<' twice.
2001-05-07 00:43:27 +00:00
Peter Eisentraut 9583aea9d0 Fix collateral damage from previous (rev 1.49) patch. 2001-05-06 21:15:51 +00:00
Peter Eisentraut 7038554c4e Allow 'psql -f -' to read from standard input. 2001-05-06 17:38:32 +00:00
Peter Eisentraut 84e8e5b427 Make prompt customization work with changeable Unix socket location. 2001-05-06 17:21:11 +00:00
Tom Lane 28ac24e4dd Makefile should have automatic dependency for parser.o too, if it's
going to have any at all.
2001-05-04 22:01:03 +00:00
Tom Lane e2e19ca0cd Seems like we should not hold off cancel/die interrupts while we are
running deferred triggers.  They are really part of the regular
transaction, and they could take awhile.
2001-05-04 18:39:16 +00:00
Tom Lane f5ba72ea04 Consolidate several near-identical uses of mktime() into a single
routine DetermineLocalTimeZone().  In that routine, be more wary of
broken mktime() implementations than the original code was: don't allow
mktime to change the already-set y/m/d/h/m/s information, and don't
use tm_gmtoff if mktime failed.  Possibly this will resolve some of
the complaints we've been hearing from users of Middle Eastern timezones
on RedHat.
2001-05-03 22:53:07 +00:00
Bruce Momjian 0cec2bb0cd BTW it does not add encodign it just patches existing one (KOI8) to
support two - KOI8-R and KOI8-U (latter is superset of the former if
not to take to the account pseudographics)

Andy Rysin
2001-05-03 21:38:45 +00:00
Tom Lane d05b4bd7c6 Permission checking wasn't quite right for insert/update/delete rules,
either :-(.
2001-05-03 21:16:48 +00:00
Bruce Momjian 3f8e21c34a apply a little patch:
Oleg Bartunov
2001-05-03 19:20:24 +00:00
Tom Lane 2792374cff Ensure that btree sort ordering functions and boolean comparison operators
give consistent results for all datatypes.  Types float4, float8, and
numeric were broken for NaN values; abstime, timestamp, and interval
were broken for INVALID values; timetz was just plain broken (some
possible pairs of values were neither < nor = nor >).  Also clean up
text, bpchar, varchar, and bit/varbit to eliminate duplicate code and
thereby reduce the probability of similar inconsistencies arising in
the future.
2001-05-03 19:00:37 +00:00
Tom Lane f2122d092f Permissions were not checked correctly when one view invokes another.
Per bug report from Lieven Van Acker, 5/2/01.
2001-05-03 17:47:49 +00:00
Bruce Momjian 645553eaf6 Improve list. 2001-05-03 17:20:14 +00:00
Bruce Momjian 3bc0ab783b Updates for 7.1.1. Not done yet. 2001-05-03 16:47:58 +00:00
Tom Lane 8571e6c6e5 Correct pg_description entry for type macaddr. 2001-05-03 16:18:02 +00:00
Tom Lane f13cb7e524 Fixes to make ecpg work on Cygwin, from Jason Tishler <Jason.Tishler@dothill.com>. 2001-05-03 16:07:52 +00:00
Tom Lane d67a618e19 Previous commit mistakenly converted all newlines to DOS style (CR/LF).
Convert back to Unix style --- it seems some versions of nmake insist
on this.
2001-05-02 14:23:40 +00:00
D'Arcy J.M. Cain 57faa28740 Add note explaining why inserts take longer as tables grow. Also suggest
the way to handle this.
2001-05-02 11:21:57 +00:00
D'Arcy J.M. Cain 66feaa80dc Change "|zzlzzzz" argument specification to "|zzizzzz" so that the code works
properly on 64 bit systems.

Change submitted by Marc Poinot (Marc.Poinot@onera.fr)
2001-05-02 11:17:24 +00:00
Tom Lane ac2b9aee1c Synced gram.y and preproc.y. 2001-05-01 02:33:55 +00:00
Thomas G. Lockhart d63571a7f4 Allow a string argument to the EXTRACT() function.
This is an extension to the SQL9x standard, but is consistant with usage
 of the underlying date_part() function used to implement it.
 Example: EXTRACT('YEAR',...)
No impact on regression tests.
2001-05-01 01:36:10 +00:00
Hiroshi Inoue 892d46e7d0 1) fix bugs reported by Andrea Aime.
2) fix a bug reported by Jan Wieck.
psqlodbc is 7.01.0005 now.
2001-05-01 00:47:06 +00:00
Tom Lane 8bb3c8fe54 exec_move_row() should be more forgiving of tuples with a different
number of columns than it was expecting, for reasons that are now
documented in the code...
2001-04-30 20:05:40 +00:00
Tom Lane e2004dfc69 Suppress pull-up of subqueries that are in the nullable side of an outer
join.  This is needed to avoid improper evaluation of expressions that
should be nulled out, as in Victor Wagner's bug report of 4/27/01.
Pretty ugly solution, but no time to do anything better for 7.1.1.
2001-04-30 19:24:47 +00:00
Tatsuo Ishii c527366b60 Add missing Unicode support for Cyrillic encodings.
Patches contributed by Victor Wagner.
2001-04-29 07:27:38 +00:00
Tom Lane 2adff4b20e Remove bogus Assert from AbsoluteTimeIsBefore(). (If you don't think
it's bogus, try building a btree index on the regress tests' abstime_tbl.)
2001-04-26 21:52:17 +00:00
Tom Lane a43f20cb0a Tweak nestloop costing to weight restart cost of inner path more heavily.
Without this, it was making some pretty silly decisions about whether an
expensive sub-SELECT should be the inner or outer side of a join...
2001-04-25 22:04:37 +00:00
Philip Warner 8dc42a3aa2 - Fixed CONSTRAINT TRIGGER dump to record tgconstrelid properly
- pgsql v7.0 compatbility
2001-04-25 07:03:20 +00:00
Tom Lane e89bf1258b Undo pgindent brain damage, so that node type numbers can once again be
counted off by lines ...
2001-04-24 00:08:38 +00:00
Tom Lane 5c48b253af Behave sanely when database name is omitted from command line. 2001-04-23 23:36:33 +00:00
Peter Eisentraut fae92fba43 Send 'cd' output to /dev/null. 2001-04-23 20:27:55 +00:00
Tom Lane a933bceacf compatible_oper needs to do ReleaseSysCache in one path to avoid
complaints about 'Cache reference leak'.  Per report from Don Baccus.
2001-04-23 04:32:30 +00:00
Hiroshi Inoue e355992ff9 1) Decrease the size of needlessly large buffers. For example, it
resolved the stack over flow errors reported by Johann Zuschlag.
2) Support {oj syntax for 71. servers.
2001-04-23 01:41:06 +00:00
Hiroshi Inoue cc6bdb3e48 A patch to fix the following bugs.
1) [ODBC] Psqlodbc and Centura: here it is a patch
        posted by Matteo Cavalleli
2) [ODBC] pgsqODBC binding parameters II
        posted by Ludek Finstrle
3) Invalid Page Fault in PSQLODBC.DLL
        personal mail from Johann Zuschlag

   Hiroki Kataoka   kataoka@interwiz.koganei.tokyo.jp
2001-04-23 01:00:49 +00:00
Tom Lane 0e29d760f4 Don't bomb out on indexes on system attributes other than 'oid'.
(Not sure such an index is actually useful, but just because it's
useless doesn't mean pg_dump should coredump.)
2001-04-22 21:34:13 +00:00
Tom Lane 8407bb3c72 Remove useless setuid() call, instead add a check that real and effective
userids are the same.  Per today's pghackers discussion.
2001-04-21 18:29:29 +00:00
Peter Eisentraut 9ae6819038 Make sure that the postmaster options (from postmaster.opts[.default] or
-o option) are properly dequoted.  Also, always pass an explicit -D option
to postmaster, don't rely on it being set in postmaster.opts.
2001-04-21 11:23:58 +00:00
Peter Eisentraut 47324d7689 Add extern int optreset declaration, per bug report from <info@decc.nl>. 2001-04-19 19:09:23 +00:00
Peter Eisentraut 7ff8d11065 Fix "off by VARHDRSZ" bug in (Cyrillic) recode support. 2001-04-19 19:01:23 +00:00
Tom Lane 2dbdba86db Kluge solution for Alex Pilosov's report of problems with whole-tuple
function arguments in join queries: copy the tuples into
TransactionCommandContext so they don't get recycled too soon.  This is
horrid, but not any worse than 7.0 or before, which also leaked such
tuples until end of query.  A proper fix will require allowing tuple
datums to be physically stored inside larger tuple datums, which opens
up a bunch of issues that can't realistically be solved for 7.1.1.
2001-04-19 04:29:02 +00:00
Tatsuo Ishii b9be04e63d Add a crash gurard to pg_encoding_mblen in case of an invalid encoding
given.
2001-04-19 02:34:35 +00:00
Tom Lane 23436bd530 Further tweaking of error messages for cases involving attributes &
functions of join or subselect aliases.  It'd be awfully nice if this
code knew for sure whether it was dealing with 'x.f' or 'f(x)' syntax;
maybe we can fix that in a future cycle.
2001-04-18 22:25:31 +00:00
Peter Eisentraut 645ebc0403 Repair misbehavior of \! with immediately following argument that contains
spaces (e.g., '\!ls -l').  Also correct a comment.
2001-04-18 20:53:08 +00:00
Tom Lane d5096af2c4 Make the world safe for passing whole rows of views to functions. This
already worked fine for whole rows of tables, but not so well for views...
2001-04-18 20:42:56 +00:00
Tom Lane 40136f4465 Make rule lister do the right thing with Vars representing whole tuples. 2001-04-18 17:04:24 +00:00
Hiroshi Inoue 9609a875bb The renewal of README thanks to Dave Page. 2001-04-17 07:30:53 +00:00
Tom Lane c273e8b13c Add some defenses to guard against case where a rule refers to a table
or view that's been dropped and then recreated with the same name (but,
perhaps, different columns).  Eventually we'd like to support this but
for now all we can do is fail cleanly, rather than possibly coredumping
if we proceed using the obsolete rule.
2001-04-17 00:32:58 +00:00
Tom Lane cdcaec5c53 Avoid reversing user-given order of WHERE clauses while attaching clauses
to specific base or join RelOptInfo nodes during planning.  This preserves
the more-intuitive behavior of 7.0.* --- if you write an expensive clause
(such as a sub-select) last, it should get evaluated last.  Someday we
ought to try to have some intelligence about the order of evaluation of
WHERE clauses, but for now we should not override what the user wrote.
2001-04-16 19:44:10 +00:00
Tatsuo Ishii 722f7efdd9 Correction for mathematical properties in Unicode converison maps.
Patches contributed by Eiji Tokuya (e-tokuya@sankyo-unyu.co.jp)
2001-04-16 06:10:19 +00:00
Tom Lane fbee97664e getdatabaseencoding() and PG_encoding_to_char() were being sloppy about
converting char* strings to type 'name'.  Imagine my surprise when 7.1
release coredumped upon start when compiled --enable-multibyte ...
2001-04-16 02:42:01 +00:00
Tom Lane 6ccb2af725 Remove error report from pq_endmessage when pq_putmessage fails. The
only possible failure is in pq_flush, which will log a (better!) report
anyway --- so pq_endmessage is just cluttering the log with a redundant
entry.  This matters when a client crashes partway through a large query,
since we will emit many broken-pipe reports before finishing the query
and exiting.
2001-04-16 01:46:57 +00:00
Tom Lane 382a429d84 Add LDFLAGS_SL to AIX shlib building command, per report from
Rocco Altier <roccoa@routescape.com>.
2001-04-15 03:25:07 +00:00
Tom Lane ffbeafb19a Constant expressions that appear in ORDER BY, GROUP BY, DISTINCT ON
lists should be reverse-compiled into targetlist index numbers, because
that's the only interpretation the parser allows for a constant in these
clauses.  (Ergo, the only way they could have gotten into the list in
the first place is to have come from the targetlist; so this should always
work.)  Per problem report from Peter E.
2001-04-15 03:14:18 +00:00
Tom Lane f9094c44c0 Prevent generation of invalid plans for RIGHT or FULL joins with multiple
join clauses.  The mergejoin executor wants all the join clauses to appear
as merge quals, not as extra joinquals, for these kinds of joins.  But the
planner would consider plans in which partially-sorted input paths were
used, leading to only some of the join clauses becoming merge quals.
This is fine for inner/left joins, not fine for right/full joins.
2001-04-15 00:48:17 +00:00
Peter Eisentraut 15a6cd0091 If the password prompt goes to stderr, then the trailing newline should
also go there.
2001-04-15 00:43:37 +00:00
Peter Eisentraut eb1b164317 Work with Readline 4.2. 2001-04-14 22:55:02 +00:00
Bruce Momjian 25efda227d Add debug_query_string global variable for pgmonitor and debugging use. 2001-04-14 19:11:45 +00:00
Philip Warner 232d8fa3c4 - Get view OID based on rule OID not base table OID
- Fix crash due to null string pointer in some tar files with some libs
2001-04-14 13:11:03 +00:00
Tom Lane 83c94a886c Another try at making numeric MODULO operator produce the right answer.
Although it was now using the right equation, it was making bogus choices
of the precision to compute intermediate results to.  I'm not sure this
is really right even yet, but it's better than before ...
2001-04-14 02:10:57 +00:00
Tom Lane ca224d2ba4 Suppress compiler warnings in Vax and NS32K assembly code: 'register foo'
is not a complete declaration.
2001-04-13 23:32:57 +00:00
D'Arcy J.M. Cain d3d35e9b25 I just noticed the beta comment. That's not actually true any more
so I removed it.
2001-04-12 09:49:37 +00:00
Hiroshi Inoue 7bba7a5c06 Sorry my previous change was a mistake. 2001-04-06 15:31:28 +00:00
Hiroshi Inoue ef4a163afd 1) Fit the precision of floating point to that of server side
(fix by Hiroki kataoka).
2) Ensure the definition of atof()(#include stdlib.h).
  (suggestion by Masaaki Sakaida).
2001-04-06 09:23:44 +00:00
Thomas G. Lockhart 9c3bbf256b Alter the previous test for "time with time zone" implicit time zone
(which failed miserably during DST) to just compare against a time
 derived from a timestamp value.
Certainly not a direct check for a correct result, but should work
 at any time of year.
2001-04-06 05:50:29 +00:00
Tom Lane a3ed622b63 Since plpgsql keeps its compiled function parsetrees until backend exit,
it needs to ensure that data structures attached to fmgr info records in
the trees will stick around that long, too.  Current code was crashing
on cases like datatypes with old-style I/O functions.
2001-04-06 02:06:48 +00:00
Tom Lane f10596c3ec Fix comment that Vadim found confusing. 2001-04-05 16:55:21 +00:00
Vadim B. Mikheev 3092869233 StartupXLOG(): initialize XLogCtl->Insert to new page if there is
no room for a record on last log page.
2001-04-05 09:34:32 +00:00
Michael Meskes 495fe1214c Hopefully fixed the long long problem. 2001-04-05 08:21:14 +00:00
Tom Lane 3ced3cfff9 pg_dump needs to use ONLY when selecting data from user tables, in case
they have children.  As it stood, -d dump mode was badly broken.
2001-04-05 02:50:01 +00:00
Tom Lane 011f1e3169 Clean up AIX makefile to recognize subversions of AIX 4.1 correctly.
This patch is Peter E's, but I'm applying it on his behalf so it'll get
into 7.1RC3 tonight (I'm guessing Peter went to bed already).
2001-04-04 22:57:45 +00:00
Tom Lane 6faf150a30 Fix/cleanup DLLLIBS handling for Cygwin port. If it works it's to
Jason Tishler's credit, if it's broken it's my fault ...
2001-04-04 21:15:56 +00:00
Tom Lane 71d578ab68 Remove daylight-savings-time-dependent tests of 'time with time zone'
datatype.  Perhaps someday we can figure out a way of getting reproducible
results from testing this type, but for now ...
2001-04-04 20:03:11 +00:00
Vadim B. Mikheev 278aa680fc Have to lock buffer while changing page' LSN.
Thanks to Tom.
2001-04-04 15:43:25 +00:00
Philip Warner a51d560d94 Don't dump CHECK constraints with same source and names both
starting with '$'.
2001-04-04 06:47:30 +00:00
Vadim B. Mikheev 1d9819d69e Log sequence creation (to initialize magic number on recovery). 2001-04-03 21:58:00 +00:00
Tom Lane 1c68f27877 Correct bogus mktime() calls. 2001-04-03 18:05:53 +00:00
Philip Warner ab17fd190c - Handle overridden attrs as per discussions 2-Apr-2001
- Dump CHECK constraints in OID order
2001-04-03 08:52:59 +00:00
Tom Lane 08bf4d797b Check for failure of malloc() and realloc() when allocating space for
VFD entries.  On platforms where dereferencing a null pointer doesn't
lead to coredump, it's possible that this omission could have led to
unpleasant behavior like deleting the wrong file.
2001-04-03 04:07:02 +00:00
Tom Lane 6cc6f18d15 open(2) flags saved for re-opening a virtual file should probably not
include O_CREAT.
2001-04-03 02:31:52 +00:00
Tom Lane 503c80d2a0 Restore pre-7.1 behavior of allowing DROP of a table whose underlying
physical file has disappeared.  There is no really good reason why
relcache should be opening the underlying file at all, AFAICS.
In any case we needn't raise a hard error here.
2001-04-02 23:30:04 +00:00
Tom Lane 244fd47124 _mdfd_getrelnfd() should include kernel error code in failure message. 2001-04-02 23:20:24 +00:00
Tom Lane e18f5011aa Complain if the same column name is inherited from multiple parents
with different default values, unless the child table redeclares the
column with an explicit default.  This was judged to be the approach
least likely to cause unpleasant surprises.
2001-04-02 18:30:49 +00:00
Bruce Momjian 97c04fad82 Disable creation of indexes on system tables. 2001-04-02 14:34:25 +00:00
Michael Meskes e6851f056a Synced pgc.l with scan.l. 2001-04-02 08:17:24 +00:00
Tom Lane ba8b844f5a Remove duplicate definition of DLLLIBS, per gripe from Fred Yankowski. 2001-04-02 03:21:23 +00:00