Commit Graph

5646 Commits

Author SHA1 Message Date
Jan Wieck 582ec175c9 Small bugfix for DROP TABLE if table is self-referenced by
a FOREIGN KEY constraint.

Jan
2000-02-04 23:45:04 +00:00
Jan Wieck ddd596d386 Added ALTER TABLE ... ADD CONSTRAINT (provided by Stephan Szabo).
Added constraint dumping capability to pg_dump (also from Stephan)

Fixed DROP TABLE -> RelationBuildTriggers: 2 record(s) not found for rel
error.

Fixed little error in gram.y I made the last days.

Jan
2000-02-04 18:49:34 +00:00
Jan Wieck 74d53d7838 Made prototypes for yyerror() consistent with Bruce's last changes
Jan
2000-02-04 18:45:23 +00:00
Tom Lane b64826a47d Squash longstanding memory leak: when catcache.c copied a tuple into
the cache context, it didn't bother to free the tuple that
CatalogIndexFetchTuple had allocated in the transaction context.
Do enough cache lookups in the same xact, and you start to notice...
2000-02-04 03:16:03 +00:00
Tom Lane d24ef0d08f Make EXPLAIN results for Append, Group, Agg, Unique nodes more plausible.
Group and Unique use an arbitrary assumption that there will be about
10% as many groups as input tuples --- perhaps someday we can refine this.
2000-02-03 06:12:19 +00:00
Tom Lane 40055db1eb Repair relation refcount leakage caused by SELECT FOR UPDATE. 2000-02-03 00:02:58 +00:00
Jan Wieck 31a8996ba4 Inconsistency in CREATE CONSTRAINT TRIGGER with the
actions performed by analyse.c when creating table constraints.

Jan
2000-02-02 20:54:17 +00:00
Peter Eisentraut 2ea31fabe7 *** empty log message *** 2000-02-02 13:20:15 +00:00
Jan Wieck c823143f8a Fixed bug in NO ACTION trigger proc entries.
Jan
2000-01-31 14:02:27 +00:00
Tom Lane a152ebeec6 Fix problems seen in parallel regress tests when SI buffer overruns (causing
syscache and relcache flushes).  Relcache entry rebuild now preserves
original tupledesc, rewrite rules, and triggers if possible, so that pointers
to these things remain valid --- if these things change while relcache entry
has positive refcount, we elog(ERROR) to avoid later crash.  Arrange for
xact-local rels to be rebuilt when an SI inval message is seen for them,
so that they are updated by CommandCounterIncrement the same as regular rels.
(This is useful because of Hiroshi's recent changes to process our own SI
messages at CommandCounterIncrement time.)  This allows simplification of
some routines that previously hacked around the lack of an automatic update.
catcache now keeps its own copy of tupledesc for its relation, rather than
depending on the relcache's copy; this avoids needing to reinitialize catcache
during a cache flush, which saves some cycles and eliminates nasty circularity
problems that occur if a cache flush happens while trying to initialize a
catcache.
Eliminate a number of permanent memory leaks that used to happen during
catcache or relcache flush; not least of which was that catcache never
freed any cached tuples!  (Rule parsetree storage is still leaked, however;
will fix that separately.)
Nothing done yet about code that uses tuples retrieved by SearchSysCache
for longer than is safe.
2000-01-31 04:35:57 +00:00
Tom Lane ca0f1435ec Hmm, equalfuncs didn't know about SortClause or GroupClause
nodes...
2000-01-31 01:21:39 +00:00
Byron Nikolaidis 44035918bb Added numeric and int8 types.
Bug fix for LongVarBinary -- begin transaction
2000-01-30 21:14:25 +00:00
Tom Lane 3a1218dced Delete unused and long-dead header file. 2000-01-29 21:13:23 +00:00
Tom Lane 04103e00f1 Modify uses of RelationFlushRelation and RelationCacheInvalidate so that
we *always* rebuild, rather than deleting, an invalidated relcache entry
that has positive refcount.  Otherwise an SI cache overrun leads to
dangling Relation pointers all over the place!
2000-01-29 19:51:59 +00:00
Peter Eisentraut 2b84cbb60f A few minor psql enhancements
Initdb help correction
Changed end/abort to commit/rollback and changed related notices
Commented out way old printing functions in libpq
Fixed a typo in alter table / alter column
2000-01-29 16:58:54 +00:00
Bruce Momjian c5b02a7a26 Attached is a uuencoded tarball that contains
3 new files and two patches for the plperl subdir.

These changes add the ability for plperl functions
to call 'elog'. It also sets up the frame work to
allow me to add access to the SPI functions.


--
Mark Hollomon
2000-01-29 01:58:50 +00:00
Bruce Momjian 1380921e65 Patch from Hiroshi for overflow btree comparison. 2000-01-28 17:23:47 +00:00
Tom Lane 003dd965d2 Apply the heuristic proposed by Taral (see pgsql-general archives for
2-Oct-98 or TODO.detail/cnfify) to decide whether we want to reduce
WHERE clause to CNF form, DNF form, or neither.  This is a HUGE win.
The heuristic conditions could probably still use a little tweaking to
make sure we don't pick CNF when DNF would be better, or vice versa,
but the risk of exponential explosion in cnfify() is gone.  I was able
to run ten-thousand-AND-subclause queries through the planner in a
reasonable amount of time.
2000-01-28 03:22:36 +00:00
Michael Meskes b53955f38a *** empty log message *** 2000-01-27 19:01:35 +00:00
Tom Lane dd979f66be Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is now
SELECT DISTINCT ON (expr [, expr ...]) targetlist ...
and there is a check to make sure that the user didn't specify an ORDER BY
that's incompatible with the DISTINCT operation.
Reimplement nodeUnique and nodeGroup to use the proper datatype-specific
equality function for each column being compared --- they used to do
bitwise comparisons or convert the data to text strings and strcmp().
(To add insult to injury, they'd look up the conversion functions once
for each tuple...)  Parse/plan representation of DISTINCT is now a list
of SortClause nodes.
initdb forced by querytree change...
2000-01-27 18:11:50 +00:00
Bruce Momjian 3f0074e403 fix for compile. 2000-01-27 05:33:51 +00:00
Tom Lane 91250f3854 Remove duplicate extern declaration. 2000-01-26 23:48:05 +00:00
Bruce Momjian 2d5dd7557b Update files. 2000-01-26 16:10:01 +00:00
Bruce Momjian 02d83c4475 Add include for float.h. 2000-01-26 06:33:49 +00:00
Bruce Momjian 5c25d60244 Add:
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.
2000-01-26 05:58:53 +00:00
Bruce Momjian b866d2e2d7 as attache of this mail is patch (to the main tree) with to_char's
family functions. Contain:

  conversion from a datetype to formatted text:

	to_char( datetime, 	text)
	to_char( timestamp,	text)
	to_char( int4,		text)
	to_char( int8,		text)
	to_char( float4,	text)
	to_char( float8,	text)
	to_char( numeric,	text)

  vice versa:

	to_date		( text, text)
	to_datetime	( text, text)
	to_timestamp	( text, text)
	to_number	( text, text)	   (convert to numeric)


  PostgreSQL to_char is very compatible with Oracle's to_char(), but not
total exactly (now). Small differentions are in number formating. It will
fix in next to_char() version.


! If will this patch aplly to the main tree, must be delete the current
  to_char version in contrib (directory "dateformat" and note in contrib's
  README), this patch not erase it (sorry Bruce).



The patch patching files:

	doc/src/sgml/func.sgml
                     ^^^^^^^^
   Hmm, I'm not sure if my English... :( Check it anyone (volunteer)?

   Thomas, it is right? SGML is not my primary lang  and compile
   the current PG docs tree is very happy job (hard variables setting in
   docs/sgml/Makefile --> HSTYLE= /home/users/t/thomas/....  :-)

   What add any definition to global configure.in and set Makefiles in docs
   tree via ./configure?

	src/backend/utils/adt/Makefile
	src/backend/utils/adt/formatting.c
	src/include/catalog/pg_proc.h
	src/include/utils/formatting.h
Karel Zak <zakkr@zf.jcu.cz>              http://home.zf.jcu.cz/~zakkr/
2000-01-25 23:53:56 +00:00
Tatsuo Ishii 6f843e8dd8 Fix pg_euccn_mblen() so that it always returns 2 if data is not ascii.
(EUC_CN does have only code set 0 and 1)
2000-01-25 02:12:27 +00:00
Tom Lane a39c6ab4cb Forgot that expr assumes regexp is anchored-left; therefore need .*
in front of any platform name pattern that's not supposed to match
beginning at the start of the machine type name...
2000-01-25 01:59:27 +00:00
Peter Eisentraut 306ada82c2 Removed alter table drop column. 2000-01-24 23:40:35 +00:00
Peter Eisentraut bdb41ad0e7 Made abstime/reltime use int4 instead of time_t (TODO item)
Made type equivalency apply to aggregates (TODO item)
Fixed parsing bug in psql
Reverted some stupid options changes I made to pg_dump
2000-01-24 19:34:19 +00:00
Tom Lane 0dbffa704a First cut at making useful selectivity estimates for range queries
(ie, WHERE x > lowbound AND x < highbound).  It's not very bright yet
but it does something useful.  Also, rename intltsel/intgtsel to
scalarltsel/scalargtsel to reflect usage better.  Extend convert_to_scalar
to do something a little bit useful with string data types.  Still need
to make it do something with date/time datatypes, but I'll wait for
Thomas's datetime unification dust to settle first.  Eventually the
routine ought not have any type-specific knowledge at all; it ought to
be calling a type-dependent routine found via a pg_type column; but
that's a task for another day.
2000-01-24 07:16:52 +00:00
Bruce Momjian 8bcac56086 Update for index change. Semes it didn't work the first time. 2000-01-24 03:08:27 +00:00
Bruce Momjian da5aba105f Remove Ops parameter from STATRELID cache lookup, for Tom Lane and
optimizer.
2000-01-24 02:12:58 +00:00
Tatsuo Ishii b2ff7d08ad Change format of postmaster.opts.default.
Executable file name (postmaster) no more included in the file.
2000-01-23 08:20:24 +00:00
Tatsuo Ishii 2605ceb704 Fix error messages for the lack of multi-byte support.
Since --with-mb has been removed from configure, previous
messages were not appropriate.
2000-01-23 08:16:37 +00:00
Tatsuo Ishii cfe717714c char_length()/octet_length for char() type now returns length of
the charcter including trailing blanks.
2000-01-23 08:13:34 +00:00
Tom Lane 27fee810ff Replace SearchSysCacheGetAttribute with SysCacheGetAttr, which fetches
an attribute of a tuple previously fetched with SearchSysCacheTuple.
This avoids a lot of redundant cache lookups, particularly in selfuncs.c.
Also, remove SearchSysCacheStruct, which was unused and grotty.
2000-01-23 03:43:24 +00:00
Tom Lane 8449df8a67 First cut at unifying regular selectivity estimation with indexscan
selectivity estimation wasn't right.  This is better...
2000-01-23 02:07:00 +00:00
Peter Eisentraut 49581f9848 updated install file
updated date/time types doc
fixed small psql bug
removed libpq code that lower-cased db names
make notice when long identifier is truncated
2000-01-23 01:27:39 +00:00
Tom Lane 978d2385a8 Update regress tests for change of pg_am/pg_amop. 2000-01-22 23:51:20 +00:00
Tom Lane 71ed7eb494 Revise handling of index-type-specific indexscan cost estimation, per
pghackers discussion of 5-Jan-2000.  The amopselect and amopnpages
estimators are gone, and in their place is a per-AM amcostestimate
procedure (linked to from pg_am, not pg_amop).
2000-01-22 23:50:30 +00:00
Peter Eisentraut fa5400c0a4 added ALTER TABLE DROP COLUMN, early version 2000-01-22 14:20:56 +00:00
Tom Lane 5c33b3c658 Change a few routines into macros to improve speed of COPY IN inner loop. 2000-01-22 03:52:04 +00:00
Tom Lane d32cd1bb25 Forgot to handle column length defaults in ALTER TABLE ADD COLUMN. 2000-01-22 01:22:48 +00:00
Tom Lane 7cc0d6ae9d Fix tab-complete so it works with old versions of readline that don't
have the rl_completion_append_character variable.  The tab completion
behavior doesn't seem to be quite perfect in that situation, but it's
better than failing to build at all...
2000-01-21 23:32:36 +00:00
Tom Lane e33f550bc0 Fix handleCopyIn's response to EOF seen mid-line, that is, input file
does not end with a newline.  I don't think this explains the recent
complaints, since this bug existed in 6.5 (and probably long before).
But might as well fix it now that I see it.
2000-01-21 04:21:12 +00:00
Tom Lane de56d999cd Simplify match patterns a little. 2000-01-21 01:48:02 +00:00
Tom Lane 68ba9835cb Bruce, you forgot to rename these files... 2000-01-21 01:39:54 +00:00
Bruce Momjian 481a7439fb plperl Makefile cleanup. Doesn't work on BSDI yet. 2000-01-20 23:00:40 +00:00
Bruce Momjian 22e7c06506 Update plperl makefile. 2000-01-20 22:31:23 +00:00
Peter Eisentraut 13f8875017 Added new pg_id to fix initdb problems
New INSTALL file
Fixed a copyright notice
2000-01-20 21:51:09 +00:00
Bruce Momjian a959e3f7c0 Cleanup vacuum names. 2000-01-20 20:01:25 +00:00
Bruce Momjian e6ed9f2c75 Fix typo in \z. 2000-01-20 15:29:20 +00:00
Bruce Momjian 8792af75f6 I have noticed that the geometry test's output for hppa1 and hppa2 are in
fact the same, so I suggest they could be the same file say
geometry-positive-zeros.out, as the main difference seems to be not printing
eg. (0,-0). In src/test/regress/expected, I propose

rm int2-i386-netbsd.out int4-i386-netbsd.out
mv geometry-hppa1.1.out geometry-positive-zeros.out
rm geometry-hppa2.0.out geometry-i386-netbsd.out

and the following patch to resultmap. I have only tested the netbsd results
on i386, but think that in all probability the differences will be the same
for other ports. If it turns out not to be the case, at least we might find
out.

Patrick Welche
2000-01-20 15:21:23 +00:00
Bruce Momjian e474dd182a Bruce,
Attached is a small fix for a stupid mistake I made in comment.c
- an attempt to drop a non-existent comment would dump core :-(.
Sometimes, I'm as sharp as a marble.

Sorry,

Mike Mascari
2000-01-20 15:13:19 +00:00
Tom Lane 8cfb8c68ea Clean up longstanding warnings. I think the remaining
'defined but not used' warnings would go away if the scanner didn't use
YY_REJECT.
2000-01-20 05:44:34 +00:00
Tom Lane 3888c62d5d Clean up longstanding gcc warnings by adding missing extern
declarations.
2000-01-20 05:34:32 +00:00
Tom Lane 1c15186747 Clean up longstanding gcc warnings by adding missing extern
declarations.
2000-01-20 05:26:54 +00:00
Tom Lane b6fdd14765 ecpg shouldn't depend on parser/gramparse.h. Also, eliminate some
compiler warnings caused by lack of extern declarations in extern.h.
I believe the remaining gcc warnings here would go away if the ecpg
grammar could be tweaked so it doesn't use REJECT ...
2000-01-20 05:23:26 +00:00
Bruce Momjian c02f1ead48 Well, I finally solved the linking problem
that kept me from making perl secure.

Attached is uuencoded tarball to add PL/perl
to postgresql.

Things I know don't work.
-- triggers
-- SPI


The README file has a _VERY_ short tutorial.

Mark Hollomon
2000-01-20 05:08:58 +00:00
Tom Lane d242b64ba2 Tweak includes to avoid compiler warning on HPUX. 2000-01-20 04:11:52 +00:00
Tom Lane 7476e3718b Assign a typmod of -1 to unadorned CHAR and NUMERIC type specs. This
allows casts without specific length requirements to continue to work
as they did before; that is, x::char will not truncate the value of x,
whereas x::char(1) will.  Likewise for NUMERIC precision/scale.
The column length defaults of char(1) and numeric(30,6) are now inserted
in analyze.c's processing of CREATE TABLE.
2000-01-20 02:24:50 +00:00
Tom Lane 08195a43f3 Fix bugs in NUMERIC ceil() and floor() functions. ceil(0) returned 1,
and both would insert random junk digits if given an input that was an
exact multiple of 10.
2000-01-20 02:21:44 +00:00
Tom Lane 6d1efd76fb Fix handling of NULL constraint conditions: per SQL92 spec, a NULL result
from a constraint condition does not violate the constraint (cf. discussion
on pghackers 12/9/99).  Implemented by adding a parameter to ExecQual,
specifying whether to return TRUE or FALSE when the qual result is
really NULL in three-valued boolean logic.  Currently, ExecRelCheck is
the only caller that asks for TRUE, but if we find any other places that
have the wrong response to NULL, it'll be easy to fix them.
2000-01-19 23:55:03 +00:00
Bruce Momjian 08fb7375e3 Update vacuum comments. 2000-01-19 22:23:00 +00:00
Bruce Momjian 2317e714c8 Update pg_dumpall. 2000-01-19 20:10:27 +00:00
Peter Eisentraut 65e0051843 another round of user interface cleanups
removed pg_id
fixed a few bugs in the scripts
2000-01-19 20:08:36 +00:00
Bruce Momjian ea1f6e00e6 autoconf 2000-01-19 17:27:04 +00:00
Bruce Momjian 0679a2c30e Fix >& csh-ism 2000-01-19 17:18:12 +00:00
Bruce Momjian 560e196bdd The latest source does not compile on Solaris 7 due to
a missing include from a modified file.

Here is a patch to fix it:-

Keith Parks.
2000-01-19 14:01:25 +00:00
Peter Eisentraut 533d516629 Removed MBFLAGS from makefiles since it's now done in include/config.h. 2000-01-19 02:59:03 +00:00
Tatsuo Ishii d4aab2c000 Revert back Makefile.global
Add check for --with-mb. It is now obsoleted.
2000-01-19 01:42:12 +00:00
Tatsuo Ishii 8ff9f85bd5 Fix for multibyte support. Since some function declarations
moved to miscadmin.h, we have to include it now.
2000-01-19 01:33:16 +00:00
Peter Eisentraut f565cf41ab another set of cleanups 2000-01-18 23:30:24 +00:00
Bruce Momjian 80c5fea99d Since this patch is not big I send it here instead. I do not have the
complete source checked out so I cannot commit it myself.

Michael
2000-01-18 19:08:13 +00:00
Bruce Momjian 0cb6bc70ce Hi!
Here is a patch to bring both libpq and psql to a state where it compiles on
win32 (native) again. A lot of things have changed, and I have not been able
to keep up with them all, so it has been broken for quite a while.
After this patch, at least it compiles. It also talks "basic talk" to the
server, but I have not yet tested all things. Sending queries, and using
e.g. \d or \dt works fine. The rest will have to be tested further.
It also bumps the version on libpq.dll to 7.0.

Everything should be enclosed in #ifdef WIN32, unless I have missed
something. Except for one or maybe two places where I have moved a #include
that should not be used on win32 from the "global area" into a "#ifndef
WIN32 area".


//Magnus
2000-01-18 19:05:31 +00:00
Bruce Momjian 2eebcddeaa Bruce,
Attached is a patch which patches cleanly against the Sunday afternoon
snapshot. It modifies pg_dump to dump COMMENT ON statements for
user-definable descriptions. In addition, it also modifies comment.c so
that the operator behavior is as Peter E. would like: a comment on an
operator is applied to the underlying function.

Thanks,

Mike Mascari
2000-01-18 18:09:02 +00:00
Tatsuo Ishii 6c25ea2342 Fix minor comple error 2000-01-18 13:46:10 +00:00
Tatsuo Ishii 716fb90bf6 Fix minor comping errors 2000-01-18 13:44:48 +00:00
Michael Meskes c80ba6a1b5 *** empty log message *** 2000-01-18 13:03:49 +00:00
Tom Lane 4cd086ce43 Fix quoting bugs and incorrect trigger argument printout. 2000-01-18 07:29:58 +00:00
Bruce Momjian e1cce4d5ea This corrects an error in current gram.y for ALTER TABLE ... ADD
CONSTRAINT

Oliver Elphick
2000-01-18 06:12:03 +00:00
Bruce Momjian 10d7287ab9 Libpq non-blocking mode, from Alfred Perlstein 2000-01-18 06:09:24 +00:00
Tatsuo Ishii b1e891dbd4 Remove compiler warnings 2000-01-18 05:14:24 +00:00
Tatsuo Ishii 449b4cc177 Show encoding name rather than encoding id in case of psql -l. 2000-01-18 05:11:38 +00:00
Tatsuo Ishii 5eb1d0deb1 Add builtin functions:
pg_char_to_encoding()
pg_encoding_to_char()
2000-01-18 05:10:29 +00:00
Tom Lane d58fa7611b numeric_in accepts exponents; numeric to int4 rounds; float4/8 to numeric
is considerably more robust and accurate than it used to be.
Also, get rid of numeric's private allocation freelist, which is no longer
a win since Jan rewrote palloc.
2000-01-18 03:44:41 +00:00
Tatsuo Ishii 8da316291f Fix multibyte support 2000-01-18 03:01:40 +00:00
Tatsuo Ishii beba98d14a Adopt for new psql 2000-01-18 03:00:37 +00:00
Peter Eisentraut 28125ed5e0 Updated user interfaces on initdb, initlocation, pg_dump, ipcclean to a GNU-compliant'ish state.
Made ipcclean work on Linux.
2000-01-18 00:03:37 +00:00
Tom Lane 9e0b463473 setheapoverride() is history. Uses replaced with CommandCounterIncrement()
where necessary --- several of them didn't really need it, though.
tqual-checking macros simplified accordingly.
2000-01-17 23:57:48 +00:00
Tom Lane fb0627d972 Correct minor typos. 2000-01-17 04:47:05 +00:00
Bruce Momjian e3354ab320 Update subquery error message. 2000-01-17 04:43:56 +00:00
Tom Lane 72cec86235 Add .cvsignore so cvs update doesn't complain about derived
files being left around.
2000-01-17 04:38:49 +00:00
Tom Lane 2fd4e7762c Modify libpq's pqexpbuffer to eliminate length restriction on how much
data can be formatted per call.  This requires relying on vsnprintf().
On machines that haven't got vsnprintf, link in the version from
backend/port/.
2000-01-17 02:59:46 +00:00
Tom Lane ac4878a060 Pass atttypmod to CoerceTargetExpr, so that it can pass it on to
coerce_type, so that the right things happen when coercing a previously-
unknown constant to a destination data type.
2000-01-17 02:04:16 +00:00
Tom Lane ceca03600e Hmm, numeric array type was missing too. Added.
Of the standard types, only 'timestamp' seems not to have an array type;
should it be added, or are we going to remove that type for 7.0 anyway?
2000-01-17 01:29:07 +00:00
Hiroshi Inoue 1500e262b5 Fix for TODO item * spinlock stuck problem when elog(FATAL)
and elog(ERROR) inside bufmgr.
2000-01-17 01:15:19 +00:00
Tom Lane 116ba5d814 Update unused_oids script so it works with non-GNU awk --- /* ... */
comment style apparently isn't portable to other awks.
2000-01-17 00:53:11 +00:00
Tom Lane 90b883425a Apparently, no one's ever used float4abs(), because it's got incorrect
data in its pg_proc entry.  abs() doesn't require two arguments, last
I heard.
2000-01-17 00:40:51 +00:00