Commit Graph

5428 Commits

Author SHA1 Message Date
Tom Lane 77b7a740f9 Adjust costsize calculations to avoid introducing unnecessary roundoff
error.  This seems to explain the differing choice of plan that's been
causing geometry regress test to fail for the last few days.
2002-12-13 17:29:25 +00:00
Bruce Momjian 023ff17178 Remove strerror output for openssl SYSCALL error check. 2002-12-13 05:51:29 +00:00
Bruce Momjian 482ed836f7 Check SSL_get_error() value SSL_ERROR_SYSCALL to see if SSL_read()
returned -1, per SSL_get_error() documentation.

Nathan Mueller
2002-12-12 22:42:39 +00:00
Bruce Momjian 40c4472e22 TODO marked as done:
* Add schema, cast, and conversion backslash commands to psql

I had to create a new publically available function,
pg_conversion_is_visible, as it seemed to be missing from the catalogs.
This required me to do no small amount of hacking around in namespace.c

I have updated the \? help and sgml docs.

\dc - list conversions [PATTERN]
\dC - list casts
\dn list schemas

I didn't support patterns with casts as there's nothing obvious to match
against.

Catalog version incremented --- initdb required.

Christopher Kings-Lynne
2002-12-12 21:02:25 +00:00
Tom Lane b0422b215c Preliminary code review for domain CHECK constraints patch: add documentation,
make VALUE a non-reserved word again, use less invasive method of passing
ConstraintTestValue into transformExpr, fix problems with nested constraint
testing, do correct thing with NULL result from a constraint expression,
remove memory leak.  Domain checks still need much more work if we are going
to allow ALTER DOMAIN, however.
2002-12-12 20:35:16 +00:00
Tom Lane ff7349694f Guard against overrunning CTZName buffer when TZ is bogus. 2002-12-12 19:16:55 +00:00
Tom Lane a0bf885f9e Phase 2 of read-only-plans project: restructure expression-tree nodes
so that all executable expression nodes inherit from a common supertype
Expr.  This is somewhat of an exercise in code purity rather than any
real functional advance, but getting rid of the extra Oper or Func node
formerly used in each operator or function call should provide at least
a little space and speed improvement.
initdb forced by changes in stored-rules representation.
2002-12-12 15:49:42 +00:00
Bruce Momjian 92d77c69e5 Fix line count error reporting in config files, like pg_hba.conf, per
report from Oliver Elphick.

Backpatch to 7.3.
2002-12-11 22:17:11 +00:00
Tom Lane 9ee4891570 Some quick fixes for ALTER DOMAIN patch. It still needs a lot of work,
but at least it doesn't generate gcc warnings.
2002-12-09 20:31:05 +00:00
Peter Eisentraut 4ed6be54e2 Fix Latin9/Unicode conversion by selecting the right table. 2002-12-09 19:47:21 +00:00
Tom Lane d6161ba7ec Explain's code for showing quals of SubqueryScan nodes has been broken
all along; not noticed till now.  It's a scan not an upper qual ...
2002-12-06 19:28:03 +00:00
Bruce Momjian e87e82d2b7 Attached are two small patches to expose md5 as a user function -- including
documentation and regression test mods. It seemed small and unobtrusive enough
to not require a specific proposal on the hackers list -- but if not, let me
know and I'll make a pitch. Otherwise, if there are no objections please apply.

Joe Conway
2002-12-06 05:20:28 +00:00
Bruce Momjian 05a6b37912 Re-addd Rod's ALTER DOMAIN patch. 2002-12-06 05:00:34 +00:00
Bruce Momjian 38ffbb95d5 Back out V6 code, caused postmaster startup failure. 2002-12-06 04:37:05 +00:00
Bruce Momjian 4bfd1ad9e0 Add missing v6utils file. 2002-12-06 04:18:11 +00:00
Bruce Momjian 3bf160131d Updated IPv6 patch to fix netmask. 2002-12-06 03:49:19 +00:00
Bruce Momjian 8fc86dd593 We have just finished porting the old KAME IPv6 patch over to
postgresql version 7.3, but yea... this patch adds full IPv6
support to postgres. I've tested it out on 7.2.3 and has
been running perfectly stable.

CREDITS:
 The KAME Project  (Initial patch)
 Nigel Kukard  <nkukard@lbsd.net>
 Johan Jordaan  <johanj@lando.co.za>
2002-12-06 03:46:37 +00:00
Bruce Momjian 5b4c16e099 Back out ALTER DOMAIN patch until missing file appears. 2002-12-06 03:43:35 +00:00
Bruce Momjian 853153ca6d ALTER DOMAIN .. SET / DROP NOT NULL
ALTER DOMAIN .. SET / DROP DEFAULT
ALTER DOMAIN .. ADD / DROP CONSTRAINT

New files:
- doc/src/sgml/ref/alter_domain.sgml

Rod Taylor
2002-12-06 03:28:34 +00:00
Bruce Momjian ceab6f7283 As far as I figured from the source code this function only deals with
cleaning up locale names and nothing else. Since all the locale names
are in plain  ASCII I think it will be safe to use ASCII-only lower-case
conversion.

Nicolai Tufar
2002-12-05 23:21:07 +00:00
Tom Lane a2e8e15dd4 localbuf.c must be able to do blind writes. 2002-12-05 22:48:03 +00:00
Tom Lane 993b145d7f Avoid pulling up sublinks from a subselect's targetlist. Works around
problems that occur if sublink is referenced via a join alias variable.
Perhaps this can be improved later, but a simple and safe fix is needed
for 7.3.1.
2002-12-05 21:46:37 +00:00
Bruce Momjian f7a3d742df Clearify variables names so it is clear which variable is the
client-supplied password and which is from pg_shadow.
2002-12-05 18:52:43 +00:00
Bruce Momjian 44ab596b01 Allow 'password' encryption even when pg_shadow has MD5 passwords, per
report from Terry Yapt and Hiroshi.

Backpatch to 7.3.
2002-12-05 18:39:43 +00:00
Tom Lane 1fd0c59e25 Phase 1 of read-only-plans project: cause executor state nodes to point
to plan nodes, not vice-versa.  All executor state nodes now inherit from
struct PlanState.  Copying of plan trees has been simplified by not
storing a list of SubPlans in Plan nodes (eliminating duplicate links).
The executor still needs such a list, but it can build it during
ExecutorStart since it has to scan the plan tree anyway.
No initdb forced since no stored-on-disk structures changed, but you
will need a full recompile because of node-numbering changes.
2002-12-05 15:50:39 +00:00
Bruce Momjian 7816c7cb94 More cleanup of userid to be AclId rather than Oid. 2002-12-05 04:04:51 +00:00
Tom Lane 53e2b794f9 Repair oversight in recent change of dependency extraction code: when
recursing to handle a join alias var, the context had better be set to
be appropriate to the join var's query level.  Per report from Hristo Neshev.
2002-12-04 20:00:37 +00:00
Bruce Momjian 93902e9521 Make usesysid consistently int4, not oid.
Catalog patch from Alvaro Herrera for same.

catversion updated. initdb required.
2002-12-04 05:18:38 +00:00
Bruce Momjian 6f0ebe3fba Deal with cases where getpeereid _and_ another creditial method is
supported.
2002-12-03 22:09:20 +00:00
Bruce Momjian f988edb4e1 Add OpenBSD local indent credentials, from William Ahern. 2002-12-03 21:50:44 +00:00
Tom Lane 2802668159 Repair core dump when trying to delete an entry from an already-NULL
datconfig or useconfig field.  Per report from Dustin Sallings.
2002-12-02 05:20:47 +00:00
Tom Lane 8e3a87fbd4 Teach planner to expand sufficiently simple SQL-language functions
('SELECT expression') inline, like macros, during the constant-folding
phase of planning.  The actual expansion is not difficult, but checking
that we're not changing the semantics of the call turns out to be more
subtle than one might think; in particular must pay attention to
permissions issues, strictness, and volatility.
2002-12-01 21:05:14 +00:00
Tom Lane 02f8c9a382 Fix ExecMakeTableFunctionResult() to work with generic expressions as
well as function calls.  This is needed for cases where the planner has
constant-folded or inlined the original function call.  Possibly we should
back-patch this change into 7.3 branch as well.
2002-12-01 20:27:32 +00:00
Tom Lane 3a18f01b7a Run COPY OUT in a temporary memory context that's reset once per row,
and eliminate its manual pfree() calls.  This solves the encoding-conversion
bug recently reported, and should be faster and more robust than the
original coding anyway.  For example, we are no longer at risk if
datatype output routines leak memory or choose to return a constant string.
2002-12-01 18:14:22 +00:00
Tom Lane 2b7ec402c4 Code review for IS DISTINCT FROM patch. Fix incorrect constant-folding
logic, dissuade planner from thinking that 'x IS DISTINCT FROM 42' may
be optimized into 'x = 42' (!!), cause dependency on = operator to be
recorded correctly, minor other improvements.
2002-11-30 21:25:08 +00:00
Tom Lane 36c356e799 Missed one place that can be simplified after recent Param/Const cleanup. 2002-11-30 18:28:49 +00:00
Tom Lane 935969415a Be more realistic about plans involving Materialize nodes: take their
cost into account while planning.
2002-11-30 05:21:03 +00:00
Tom Lane ddb2d78de0 Upgrade planner and executor to allow multiple hash keys for a hash join,
instead of only one.  This should speed up planning (only one hash path
to consider for a given pair of relations) as well as allow more effective
hashing, when there are multiple hashable joinclauses.
2002-11-30 00:08:22 +00:00
Tom Lane f68f11928d Tighten selection of equality and ordering operators for grouping
operations: make sure we use operators that are compatible, as determined
by a mergejoin link in pg_operator.  Also, add code to planner to ensure
we don't try to use hashed grouping when the grouping operators aren't
marked hashable.
2002-11-29 21:39:12 +00:00
Tom Lane 851a4c48fd Repair prehistoric logic error in lseg_eq and lseg_ne. 2002-11-29 19:25:33 +00:00
Tom Lane 0a013c843b Suppress compiler warning from newer gcc. 2002-11-29 19:03:01 +00:00
Tom Lane ea0b5c8569 Use Params, rather than run-time-modified Const nodes, to handle
sublink results and COPY's domain constraint checking.  A Const that
isn't really constant is just a Bad Idea(tm).  Remove hacks in
parse_coerce and other places that were needed because of the former
klugery.
2002-11-26 03:01:59 +00:00
Tatsuo Ishii ac47950238 Guard against 0 length string encoding conversion case. 2002-11-26 02:22:29 +00:00
Tom Lane f893ee271f Remove unused constisset and constiscast fields of Const nodes. Clean
up code and documentation associated with Param nodes.
2002-11-25 21:29:42 +00:00
Tom Lane dbe100c402 Restructure outfuncs and readfuncs to use macros in the same style as
just done for copyfuncs/equalfuncs.  Read functions in particular get
a lot shorter than before, and it's much easier to compare an out function
with the corresponding read function to make sure they agree.
initdb forced due to small changes in nodestring format (regularizing
a few cases that were formerly idiosyncratic).
2002-11-25 18:12:12 +00:00
Tom Lane 0aa5b6866e Un-break triggers declared for INSERT OR DELETE OR UPDATE. This worked
okay in 7.3, so I think it must have been busted in the recent triggers
patch.
2002-11-25 03:36:50 +00:00
Tom Lane 2eafcf68d5 Restructure the code in copyfuncs and equalfuncs to put much heavier
reliance on macros, in hopes of eliminating silly typos (like copying
to the wrong field) and just generally making it easier to see the forest
instead of the trees.  As an example, here is the new code for A_Indices:

static A_Indices *
_copyAIndices(A_Indices *from)
{
	A_Indices  *newnode = makeNode(A_Indices);

	COPY_NODE_FIELD(lidx);
	COPY_NODE_FIELD(uidx);

	return newnode;
}

static bool
_equalAIndices(A_Indices *a, A_Indices *b)
{
	COMPARE_NODE_FIELD(lidx);
	COMPARE_NODE_FIELD(uidx);

	return true;
}

I plan to redo outfuncs/readfuncs in a similar style, but am committing
what I've got.
2002-11-25 03:33:27 +00:00
Tom Lane 04c8785c7b Restructure planning of nestloop inner indexscans so that the set of usable
joinclauses is determined accurately for each join.  Formerly, the code only
considered joinclauses that used all of the rels from the outer side of the
join; thus for example
	FROM (a CROSS JOIN b) JOIN c ON (c.f1 = a.x AND c.f2 = b.y)
could not exploit a two-column index on c(f1,f2), since neither of the
qual clauses would be in the joininfo list it looked in.  The new code does
this correctly, and also is able to eliminate redundant clauses, thus fixing
the problem noted 24-Oct-02 by Hans-Jürgen Schönig.
2002-11-24 21:52:15 +00:00
Tom Lane 4c61c827d3 Fix compile warnings from truncate patch. 2002-11-23 18:26:45 +00:00
Bruce Momjian d46f3de363 Transaction safe Truncate
Rod Taylor
2002-11-23 04:05:52 +00:00