Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CVS log for pgsql/src/backend/rewrite/rewriteHandler.c

[BACK] Up to [PostgreSQL CVS Repository] / pgsql / src / backend / rewrite

Request diff between arbitrary revisions - Display revisions graphically


Keyword substitution: kv
Default branch: MAIN


Revision 1.194: download - view: text, markup, annotated - select for diffs
Fri Feb 26 02:00:58 2010 UTC (15 years, 3 months ago) by momjian
Branches: MAIN
CVS tags: REL9_1_ALPHA1, REL9_0_STABLE, REL9_0_RC1, REL9_0_BETA4, REL9_0_BETA3, REL9_0_BETA2, REL9_0_BETA1, REL9_0_ALPHA5_BRANCH, REL9_0_ALPHA5, REL9_0_0, HEAD
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +7 -7 lines
pgindent run for 9.0

Revision 1.193: download - view: text, markup, annotated - select for diffs
Sat Jan 2 16:57:51 2010 UTC (15 years, 5 months ago) by momjian
Branches: MAIN
CVS tags: REL9_0_ALPHA4_BRANCH, REL9_0_ALPHA4
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +2 -2 lines
Update copyright for the year 2010.

Revision 1.192: download - view: text, markup, annotated - select for diffs
Thu Nov 5 23:24:24 2009 UTC (15 years, 7 months ago) by tgl
Branches: MAIN
CVS tags: REL8_5_ALPHA3_BRANCH, REL8_5_ALPHA3
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +3 -3 lines
Don't treat NEW and OLD as reserved words anymore.  For the purposes of rules
it works just as well to have them be ordinary identifiers, and this gets rid
of a number of ugly special cases.  Plus we aren't interfering with non-rule
usage of these names.

catversion bump because the names change internally in stored rules.

Revision 1.191: download - view: text, markup, annotated - select for diffs
Wed Oct 28 17:36:50 2009 UTC (15 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +40 -18 lines
Fix AcquireRewriteLocks to be sure that it acquires the right lock strength
when FOR UPDATE is propagated down into a sub-select expanded from a view.
Similar bug to parser's isLockedRel issue that I fixed yesterday; likewise
seems not quite worth the effort to back-patch.

Revision 1.190: download - view: text, markup, annotated - select for diffs
Wed Oct 28 14:55:43 2009 UTC (15 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +14 -22 lines
When FOR UPDATE/SHARE is used with LIMIT, put the LockRows plan node
underneath the Limit node, not atop it.  This fixes the old problem that such
a query might unexpectedly return fewer rows than the LIMIT says, due to
LockRows discarding updated rows.

There is a related problem that LockRows might destroy the sort ordering
produced by earlier steps; but fixing that by pushing LockRows below Sort
would create serious performance problems that are unjustified in many
real-world applications, as well as potential deadlock problems from locking
many more rows than expected.  Instead, keep the present semantics of applying
FOR UPDATE after ORDER BY within a single query level; but allow the user to
specify the other way by writing FOR UPDATE in a sub-select.  To make that
work, track whether FOR UPDATE appeared explicitly in sub-selects or got
pushed down from the parent, and don't flatten a sub-select that contained an
explicit FOR UPDATE.

Revision 1.186.2.2: download - view: text, markup, annotated - select for diffs
Tue Oct 27 17:11:30 2009 UTC (15 years, 7 months ago) by tgl
Branches: REL8_4_STABLE
CVS tags: REL8_4_4, REL8_4_3, REL8_4_2
Diff to: previous 1.186.2.1: preferred, colored; branchpoint 1.186: preferred, colored; next MAIN 1.187: preferred, colored
Changes since revision 1.186.2.1: +2 -30 lines
Make FOR UPDATE/SHARE in the primary query not propagate into WITH queries;
for example in
  WITH w AS (SELECT * FROM foo) SELECT * FROM w, bar ... FOR UPDATE
the FOR UPDATE will now affect bar but not foo.  This is more useful and
consistent than the original 8.4 behavior, which tried to propagate FOR UPDATE
into the WITH query but always failed due to assorted implementation
restrictions.  Even though we are in process of removing those restrictions,
it seems correct on philosophical grounds to not let the outer query's
FOR UPDATE affect the WITH query.

In passing, fix isLockedRel which frequently got things wrong in
nested-subquery cases: "FOR UPDATE OF foo" applies to an alias foo in the
current query level, not subqueries.  This has been broken for a long time,
but it doesn't seem worth back-patching further than 8.4 because the actual
consequences are minimal.  At worst the parser would sometimes get
RowShareLock on a relation when it should be AccessShareLock or vice versa.
That would only make a difference if someone were using ExclusiveLock
concurrently, which no standard operation does, and anyway FOR UPDATE
doesn't result in visible changes so it's not clear that the someone would
notice any problem.  Between that and the fact that FOR UPDATE barely works
with subqueries at all in existing releases, I'm not excited about worrying
about it.

Revision 1.189: download - view: text, markup, annotated - select for diffs
Tue Oct 27 17:11:18 2009 UTC (15 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +2 -30 lines
Make FOR UPDATE/SHARE in the primary query not propagate into WITH queries;
for example in
  WITH w AS (SELECT * FROM foo) SELECT * FROM w, bar ... FOR UPDATE
the FOR UPDATE will now affect bar but not foo.  This is more useful and
consistent than the original 8.4 behavior, which tried to propagate FOR UPDATE
into the WITH query but always failed due to assorted implementation
restrictions.  Even though we are in process of removing those restrictions,
it seems correct on philosophical grounds to not let the outer query's
FOR UPDATE affect the WITH query.

In passing, fix isLockedRel which frequently got things wrong in
nested-subquery cases: "FOR UPDATE OF foo" applies to an alias foo in the
current query level, not subqueries.  This has been broken for a long time,
but it doesn't seem worth back-patching further than 8.4 because the actual
consequences are minimal.  At worst the parser would sometimes get
RowShareLock on a relation when it should be AccessShareLock or vice versa.
That would only make a difference if someone were using ExclusiveLock
concurrently, which no standard operation does, and anyway FOR UPDATE
doesn't result in visible changes so it's not clear that the someone would
notice any problem.  Between that and the fact that FOR UPDATE barely works
with subqueries at all in existing releases, I'm not excited about worrying
about it.

Revision 1.188: download - view: text, markup, annotated - select for diffs
Mon Oct 26 02:26:36 2009 UTC (15 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +3 -3 lines
Re-implement EvalPlanQual processing to improve its performance and eliminate
a lot of strange behaviors that occurred in join cases.  We now identify the
"current" row for every joined relation in UPDATE, DELETE, and SELECT FOR
UPDATE/SHARE queries.  If an EvalPlanQual recheck is necessary, we jam the
appropriate row into each scan node in the rechecking plan, forcing it to emit
only that one row.  The former behavior could rescan the whole of each joined
relation for each recheck, which was terrible for performance, and what's much
worse could result in duplicated output tuples.

Also, the original implementation of EvalPlanQual could not re-use the recheck
execution tree --- it had to go through a full executor init and shutdown for
every row to be tested.  To avoid this overhead, I've associated a special
runtime Param with each LockRows or ModifyTable plan node, and arranged to
make every scan node below such a node depend on that Param.  Thus, by
signaling a change in that Param, the EPQ machinery can just rescan the
already-built test plan.

This patch also adds a prohibition on set-returning functions in the
targetlist of SELECT FOR UPDATE/SHARE.  This is needed to avoid the
duplicate-output-tuple problem.  It seems fairly reasonable since the
other restrictions on SELECT FOR UPDATE are meant to ensure that there
is a unique correspondence between source tuples and result tuples,
which an output SRF destroys as much as anything else does.

Revision 1.186.2.1: download - view: text, markup, annotated - select for diffs
Wed Sep 2 17:52:33 2009 UTC (15 years, 9 months ago) by tgl
Branches: REL8_4_STABLE
CVS tags: REL8_4_1
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +7 -4 lines
Fix subquery pullup to wrap a PlaceHolderVar around the entire RowExpr
that's generated for a whole-row Var referencing the subquery, when the
subquery is in the nullable side of an outer join.  The previous coding
instead put PlaceHolderVars around the elements of the RowExpr.  The effect
was that when the outer join made the subquery outputs go to null, the
whole-row Var produced ROW(NULL,NULL,...) rather than just NULL.  There
are arguments afoot about whether those things ought to be semantically
indistinguishable, but for the moment they are not entirely so, and the
planner needs to take care that its machinations preserve the difference.
Per bug #5025.

Making this feasible required refactoring ResolveNew() to allow more caller
control over what is substituted for a Var.  I chose to make ResolveNew()
a wrapper around a new general-purpose function replace_rte_variables().
I also fixed the ancient bogosity that ResolveNew might fail to set
a query's hasSubLinks field after inserting a SubLink in it.  Although
all current callers make sure that happens anyway, we've had bugs of that
sort before, and it seemed like a good time to install a proper solution.

Back-patch to 8.4.  The problem can be demonstrated clear back to 8.0,
but the fix would be too invasive in earlier branches; not to mention
that people may be depending on the subtly-incorrect behavior.  The
8.4 series is new enough that fixing this probably won't cause complaints,
but it might in older branches.  Also, 8.4 shows the incorrect behavior
in more cases than older branches do, because it is able to flatten
subqueries in more cases.

Revision 1.187: download - view: text, markup, annotated - select for diffs
Wed Sep 2 17:52:24 2009 UTC (15 years, 9 months ago) by tgl
Branches: MAIN
CVS tags: REL8_5_ALPHA2_BRANCH, REL8_5_ALPHA2
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +7 -4 lines
Fix subquery pullup to wrap a PlaceHolderVar around the entire RowExpr
that's generated for a whole-row Var referencing the subquery, when the
subquery is in the nullable side of an outer join.  The previous coding
instead put PlaceHolderVars around the elements of the RowExpr.  The effect
was that when the outer join made the subquery outputs go to null, the
whole-row Var produced ROW(NULL,NULL,...) rather than just NULL.  There
are arguments afoot about whether those things ought to be semantically
indistinguishable, but for the moment they are not entirely so, and the
planner needs to take care that its machinations preserve the difference.
Per bug #5025.

Making this feasible required refactoring ResolveNew() to allow more caller
control over what is substituted for a Var.  I chose to make ResolveNew()
a wrapper around a new general-purpose function replace_rte_variables().
I also fixed the ancient bogosity that ResolveNew might fail to set
a query's hasSubLinks field after inserting a SubLink in it.  Although
all current callers make sure that happens anyway, we've had bugs of that
sort before, and it seemed like a good time to install a proper solution.

Back-patch to 8.4.  The problem can be demonstrated clear back to 8.0,
but the fix would be too invasive in earlier branches; not to mention
that people may be depending on the subtly-incorrect behavior.  The
8.4 series is new enough that fixing this probably won't cause complaints,
but it might in older branches.  Also, 8.4 shows the incorrect behavior
in more cases than older branches do, because it is able to flatten
subqueries in more cases.

Revision 1.186: download - view: text, markup, annotated - select for diffs
Thu Jun 11 14:49:01 2009 UTC (15 years, 11 months ago) by momjian
Branches: MAIN
CVS tags: REL8_5_ALPHA1_BRANCH, REL8_5_ALPHA1, REL8_4_RC2, REL8_4_RC1, REL8_4_0
Branch point for: REL8_4_STABLE
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +4 -4 lines
8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.

Revision 1.185: download - view: text, markup, annotated - select for diffs
Tue Jan 27 12:40:15 2009 UTC (16 years, 4 months ago) by petere
Branches: MAIN
CVS tags: REL8_4_BETA2, REL8_4_BETA1
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +7 -7 lines
Revert updatable views

Revision 1.184: download - view: text, markup, annotated - select for diffs
Thu Jan 22 20:16:06 2009 UTC (16 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +5 -1 lines
Support column-level privileges, as required by SQL standard.

Stephen Frost, with help from KaiGai Kohei and others

Revision 1.183: download - view: text, markup, annotated - select for diffs
Thu Jan 22 17:27:54 2009 UTC (16 years, 4 months ago) by petere
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +7 -7 lines
Automatic view update rules

Bernd Helmle

Revision 1.182: download - view: text, markup, annotated - select for diffs
Thu Jan 1 17:23:47 2009 UTC (16 years, 5 months ago) by momjian
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +2 -2 lines
Update copyright for 2009.

Revision 1.181: download - view: text, markup, annotated - select for diffs
Sat Oct 4 21:56:54 2008 UTC (16 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +52 -5 lines
Implement SQL-standard WITH clauses, including WITH RECURSIVE.

There are some unimplemented aspects: recursive queries must use UNION ALL
(should allow UNION too), and we don't have SEARCH or CYCLE clauses.
These might or might not get done for 8.4, but even without them it's a
pretty useful feature.

There are also a couple of small loose ends and definitional quibbles,
which I'll send a memo about to pgsql-hackers shortly.  But let's land
the patch now so we can get on with other development.

Yoshiyuki Asaba, with lots of help from Tatsuo Ishii and Tom Lane

Revision 1.158.2.4: download - view: text, markup, annotated - select for diffs
Wed Sep 24 16:53:07 2008 UTC (16 years, 8 months ago) by tgl
Branches: REL8_1_STABLE
CVS tags: REL8_1_21, REL8_1_20, REL8_1_19, REL8_1_18, REL8_1_17, REL8_1_16, REL8_1_15
Diff to: previous 1.158.2.3: preferred, colored; branchpoint 1.158: preferred, colored; next MAIN 1.159: preferred, colored
Changes since revision 1.158.2.3: +28 -1 lines
Fix more problems with rewriter failing to set Query.hasSubLinks when inserting
a SubLink expression into a rule query.  We missed cases where the original
query contained a sub-SELECT in a function in FROM, a multi-row VALUES list,
or a RETURNING list.  Per bug #4434 from Dean Rasheed and subsequent
investigation.

Back-patch to 8.1; older releases don't have the issue because they didn't
try to be smart about setting hasSubLinks only when needed.

Revision 1.168.2.2: download - view: text, markup, annotated - select for diffs
Wed Sep 24 16:53:00 2008 UTC (16 years, 8 months ago) by tgl
Branches: REL8_2_STABLE
CVS tags: REL8_2_17, REL8_2_16, REL8_2_15, REL8_2_14, REL8_2_13, REL8_2_12, REL8_2_11
Diff to: previous 1.168.2.1: preferred, colored; branchpoint 1.168: preferred, colored; next MAIN 1.169: preferred, colored
Changes since revision 1.168.2.1: +40 -1 lines
Fix more problems with rewriter failing to set Query.hasSubLinks when inserting
a SubLink expression into a rule query.  We missed cases where the original
query contained a sub-SELECT in a function in FROM, a multi-row VALUES list,
or a RETURNING list.  Per bug #4434 from Dean Rasheed and subsequent
investigation.

Back-patch to 8.1; older releases don't have the issue because they didn't
try to be smart about setting hasSubLinks only when needed.

Revision 1.177.2.1: download - view: text, markup, annotated - select for diffs
Wed Sep 24 16:52:53 2008 UTC (16 years, 8 months ago) by tgl
Branches: REL8_3_STABLE
CVS tags: REL8_3_9, REL8_3_8, REL8_3_7, REL8_3_6, REL8_3_5, REL8_3_11, REL8_3_10
Diff to: previous 1.177: preferred, colored; next MAIN 1.178: preferred, colored
Changes since revision 1.177: +40 -1 lines
Fix more problems with rewriter failing to set Query.hasSubLinks when inserting
a SubLink expression into a rule query.  We missed cases where the original
query contained a sub-SELECT in a function in FROM, a multi-row VALUES list,
or a RETURNING list.  Per bug #4434 from Dean Rasheed and subsequent
investigation.

Back-patch to 8.1; older releases don't have the issue because they didn't
try to be smart about setting hasSubLinks only when needed.

Revision 1.180: download - view: text, markup, annotated - select for diffs
Wed Sep 24 16:52:46 2008 UTC (16 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +40 -1 lines
Fix more problems with rewriter failing to set Query.hasSubLinks when inserting
a SubLink expression into a rule query.  We missed cases where the original
query contained a sub-SELECT in a function in FROM, a multi-row VALUES list,
or a RETURNING list.  Per bug #4434 from Dean Rasheed and subsequent
investigation.

Back-patch to 8.1; older releases don't have the issue because they didn't
try to be smart about setting hasSubLinks only when needed.

Revision 1.179: download - view: text, markup, annotated - select for diffs
Thu Aug 28 23:09:48 2008 UTC (16 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +5 -2 lines
Extend the parser location infrastructure to include a location field in
most node types used in expression trees (both before and after parse
analysis).  This allows us to place an error cursor in many situations
where we formerly could not, because the information wasn't available
beyond the very first level of parse analysis.  There's a fair amount
of work still to be done to persuade individual ereport() calls to actually
include an error location, but this gets the initdb-forcing part of the
work out of the way; and the situation is already markedly better than
before for complaints about unimplementable implicit casts, such as
CASE and UNION constructs with incompatible alternative data types.
Per my proposal of a few days ago.

Revision 1.178: download - view: text, markup, annotated - select for diffs
Mon Aug 25 22:42:34 2008 UTC (16 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +2 -3 lines
Move exprType(), exprTypmod(), expression_tree_walker(), and related routines
into nodes/nodeFuncs, so as to reduce wanton cross-subsystem #includes inside
the backend.  There's probably more that should be done along this line,
but this is a start anyway.

Revision 1.177: download - view: text, markup, annotated - select for diffs
Tue Jan 1 19:45:51 2008 UTC (17 years, 5 months ago) by momjian
Branches: MAIN
CVS tags: REL8_3_RC2, REL8_3_RC1, REL8_3_4, REL8_3_3, REL8_3_2, REL8_3_1, REL8_3_0
Branch point for: REL8_3_STABLE
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +2 -2 lines
Update copyrights in source tree to 2008.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Fri Nov 16 01:51:22 2007 UTC (17 years, 6 months ago) by momjian
Branches: MAIN
CVS tags: REL8_3_BETA4, REL8_3_BETA3
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +2 -2 lines
Small comment spacing improvement.

Revision 1.175: download - view: text, markup, annotated - select for diffs
Thu Nov 15 23:23:44 2007 UTC (17 years, 6 months ago) by momjian
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +13 -14 lines
Fix pgindent to properly handle 'else' and single-line comments on the
same line;  previous fix was only partial.  Re-run pgindent on files
that need it.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Thu Sep 6 17:31:58 2007 UTC (17 years, 9 months ago) by tgl
Branches: MAIN
CVS tags: REL8_3_BETA2, REL8_3_BETA1
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +2 -2 lines
Make eval_const_expressions() preserve typmod when simplifying something like
null::char(3) to a simple Const node.  (It already worked for non-null values,
but not when we skipped evaluation of a strict coercion function.)  This
prevents loss of typmod knowledge in situations such as exhibited in bug
#3598.  Unfortunately there seems no good way to fix that bug in 8.1 and 8.2,
because they simply don't carry a typmod for a plain Const node.

In passing I made all the other callers of makeNullConst supply "real" typmod
values too, though I think it probably doesn't matter anywhere else.

Revision 1.173: download - view: text, markup, annotated - select for diffs
Mon Mar 19 23:38:29 2007 UTC (18 years, 2 months ago) by wieck
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +26 -1 lines
Changes pg_trigger and extend pg_rewrite in order to allow triggers and
rules to be defined with different, per session controllable, behaviors
for replication purposes.

This will allow replication systems like Slony-I and, as has been stated
on pgsql-hackers, other products to control the firing mechanism of
triggers and rewrite rules without modifying the system catalog directly.

The firing mechanisms are controlled by a new superuser-only GUC
variable, session_replication_role, together with a change to
pg_trigger.tgenabled and a new column pg_rewrite.ev_enabled. Both
columns are a single char data type now (tgenabled was a bool before).
The possible values in these attributes are:

     'O' - Trigger/Rule fires when session_replication_role is "origin"
           (default) or "local". This is the default behavior.

     'D' - Trigger/Rule is disabled and fires never

     'A' - Trigger/Rule fires always regardless of the setting of
           session_replication_role

     'R' - Trigger/Rule fires when session_replication_role is "replica"

The GUC variable can only be changed as long as the system does not have
any cached query plans. This will prevent changing the session role and
accidentally executing stored procedures or functions that have plans
cached that expand to the wrong query set due to differences in the rule
firing semantics.

The SQL syntax for changing a triggers/rules firing semantics is

     ALTER TABLE <tabname> <when> TRIGGER|RULE <name>;

     <when> ::= ENABLE | ENABLE ALWAYS | ENABLE REPLICA | DISABLE

psql's \d command as well as pg_dump are extended in a backward
compatible fashion.

Jan

Revision 1.172: download - view: text, markup, annotated - select for diffs
Sat Mar 17 00:11:04 2007 UTC (18 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +3 -1 lines
Fix up the remaining places where the expression node structure would lose
available information about the typmod of an expression; namely, Const,
ArrayRef, ArrayExpr, and EXPR and ARRAY SubLinks.  In the ArrayExpr and
SubLink cases it wasn't really the data structure's fault, but exprTypmod()
being lazy.  This seems like a good idea in view of the expected increase in
typmod usage from Teodor's work to allow user-defined types to have typmods.
In particular this responds to the concerns we had about eliminating the
special-purpose hack that exprTypmod() used to have for BPCHAR Consts.
We can now tell whether or not such a Const has been cast to a specific
length, and report or display properly if so.

initdb forced due to changes in stored rules.

Revision 1.113.2.3: download - view: text, markup, annotated - select for diffs
Thu Mar 1 18:51:03 2007 UTC (18 years, 3 months ago) by tgl
Branches: REL7_3_STABLE
CVS tags: REL7_3_21, REL7_3_20, REL7_3_19
Diff to: previous 1.113.2.2: preferred, colored; branchpoint 1.113: preferred, colored; next MAIN 1.114: preferred, colored
Changes since revision 1.113.2.2: +31 -17 lines
Fix markQueryForLocking() to work correctly in the presence of nested views.
It has been wrong for this case since it was first written for 7.1 :-(
Per report from Pavel Han�k.

Revision 1.130.2.2: download - view: text, markup, annotated - select for diffs
Thu Mar 1 18:50:56 2007 UTC (18 years, 3 months ago) by tgl
Branches: REL7_4_STABLE
CVS tags: REL7_4_29, REL7_4_28, REL7_4_27, REL7_4_26, REL7_4_25, REL7_4_24, REL7_4_23, REL7_4_22, REL7_4_21, REL7_4_20, REL7_4_19, REL7_4_18, REL7_4_17
Diff to: previous 1.130.2.1: preferred, colored; branchpoint 1.130: preferred, colored; next MAIN 1.131: preferred, colored
Changes since revision 1.130.2.1: +31 -17 lines
Fix markQueryForLocking() to work correctly in the presence of nested views.
It has been wrong for this case since it was first written for 7.1 :-(
Per report from Pavel Han�k.

Revision 1.147.4.2: download - view: text, markup, annotated - select for diffs
Thu Mar 1 18:50:49 2007 UTC (18 years, 3 months ago) by tgl
Branches: REL8_0_STABLE
CVS tags: REL8_0_25, REL8_0_24, REL8_0_23, REL8_0_22, REL8_0_21, REL8_0_20, REL8_0_19, REL8_0_18, REL8_0_17, REL8_0_16, REL8_0_15, REL8_0_14, REL8_0_13
Diff to: previous 1.147.4.1: preferred, colored; branchpoint 1.147: preferred, colored; next MAIN 1.148: preferred, colored
Changes since revision 1.147.4.1: +31 -17 lines
Fix markQueryForLocking() to work correctly in the presence of nested views.
It has been wrong for this case since it was first written for 7.1 :-(
Per report from Pavel Han�k.

Revision 1.158.2.3: download - view: text, markup, annotated - select for diffs
Thu Mar 1 18:50:42 2007 UTC (18 years, 3 months ago) by tgl
Branches: REL8_1_STABLE
CVS tags: REL8_1_9, REL8_1_14, REL8_1_13, REL8_1_12, REL8_1_11, REL8_1_10
Diff to: previous 1.158.2.2: preferred, colored; branchpoint 1.158: preferred, colored
Changes since revision 1.158.2.2: +36 -20 lines
Fix markQueryForLocking() to work correctly in the presence of nested views.
It has been wrong for this case since it was first written for 7.1 :-(
Per report from Pavel Han�k.

Revision 1.168.2.1: download - view: text, markup, annotated - select for diffs
Thu Mar 1 18:50:36 2007 UTC (18 years, 3 months ago) by tgl
Branches: REL8_2_STABLE
CVS tags: REL8_2_9, REL8_2_8, REL8_2_7, REL8_2_6, REL8_2_5, REL8_2_4, REL8_2_10
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +35 -20 lines
Fix markQueryForLocking() to work correctly in the presence of nested views.
It has been wrong for this case since it was first written for 7.1 :-(
Per report from Pavel Han�k.

Revision 1.171: download - view: text, markup, annotated - select for diffs
Thu Mar 1 18:50:28 2007 UTC (18 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +35 -20 lines
Fix markQueryForLocking() to work correctly in the presence of nested views.
It has been wrong for this case since it was first written for 7.1 :-(
Per report from Pavel Han�k.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Thu Feb 1 19:10:27 2007 UTC (18 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +2 -2 lines
Wording cleanup for error messages.  Also change can't -> cannot.

Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".

Revision 1.169: download - view: text, markup, annotated - select for diffs
Fri Jan 5 22:19:36 2007 UTC (18 years, 5 months ago) by momjian
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +2 -2 lines
Update CVS HEAD for 2007 copyright.  Back branches are typically not
back-stamped for this.

Revision 1.168: download - view: text, markup, annotated - select for diffs
Fri Oct 6 17:13:59 2006 UTC (18 years, 8 months ago) by petere
Branches: MAIN
CVS tags: REL8_2_RC1, REL8_2_BETA3, REL8_2_BETA2, REL8_2_3, REL8_2_2, REL8_2_1, REL8_2_0
Branch point for: REL8_2_STABLE
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +4 -4 lines
Message style improvements

Revision 1.167: download - view: text, markup, annotated - select for diffs
Wed Oct 4 00:29:56 2006 UTC (18 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +32 -32 lines
pgindent run for 8.2.

Revision 1.166: download - view: text, markup, annotated - select for diffs
Sat Sep 2 17:06:52 2006 UTC (18 years, 9 months ago) by tgl
Branches: MAIN
CVS tags: REL8_2_BETA1
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +91 -4 lines
Apply a simple solution to the problem of making INSERT/UPDATE/DELETE
RETURNING play nice with views/rules.  To wit, have the rule rewriter
rewrite any RETURNING clause found in a rule to produce what the rule's
triggering query asked for in its RETURNING clause, in particular drop
the RETURNING clause if no RETURNING in the triggering query.  This
leaves the responsibility for knowing how to produce the view's output
columns on the rule author, without requiring any fundamental changes
in rule semantics such as adding new rule event types would do.  The
initial implementation constrains things to ensure that there is
exactly one, unconditionally invoked RETURNING clause among the rules
for an event --- later we might be able to relax that, but for a post
feature freeze fix it seems better to minimize how much invention we do.
Per gripe from Jaime Casanova.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Wed Aug 2 01:59:47 2006 UTC (18 years, 10 months ago) by joe
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +164 -6 lines
Add support for multi-row VALUES clauses as part of INSERT statements
(e.g. "INSERT ... VALUES (...), (...), ...") and elsewhere as allowed
by the spec. (e.g. similar to a FROM clause subselect). initdb required.
Joe Conway and Tom Lane.

Revision 1.164: download - view: text, markup, annotated - select for diffs
Fri Jul 14 14:52:22 2006 UTC (18 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +1 -7 lines
Remove 576 references of include files that were not needed.

Revision 1.147.4.1: download - view: text, markup, annotated - select for diffs
Tue May 23 17:09:18 2006 UTC (19 years ago) by tgl
Branches: REL8_0_STABLE
CVS tags: REL8_0_9, REL8_0_12, REL8_0_11, REL8_0_10
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +2 -2 lines
Klugy fix for bug #2447: we can't expand a whole-row reference to NEW
in a rule WHERE expression while inserting it into the original query,
because the 8.0 ResolveNew API is wrongly designed.  This is fixed in 8.1
but I'm disinclined to risk back-porting the changes.  Instead, just stop
the coredump and instead issue the same 'cannot handle whole-row reference'
message that 7.4 and before generated in this situation.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Sun Apr 30 18:30:39 2006 UTC (19 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +9 -22 lines
Improve the representation of FOR UPDATE/FOR SHARE so that we can
support both FOR UPDATE and FOR SHARE in one command, as well as both
NOWAIT and normal WAIT behavior.  The more general code is actually
simpler and cleaner.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Wed Apr 5 22:11:55 2006 UTC (19 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +2 -2 lines
Fix a bunch of problems with domains by making them use special input functions
that apply the necessary domain constraint checks immediately.  This fixes
cases where domain constraints went unchecked for statement parameters,
PL function local variables and results, etc.  We can also eliminate existing
special cases for domains in places that had gotten it right, eg COPY.

Also, allow domains over domains (base of a domain is another domain type).
This almost worked before, but was disallowed because the original patch
hadn't gotten it quite right.

Revision 1.161: download - view: text, markup, annotated - select for diffs
Sun Mar 5 15:58:36 2006 UTC (19 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +2 -2 lines
Update copyright for 2006.  Update scripts.

Revision 1.158.2.2: download - view: text, markup, annotated - select for diffs
Wed Nov 23 17:21:22 2005 UTC (19 years, 6 months ago) by tgl
Branches: REL8_1_STABLE
CVS tags: REL8_1_8, REL8_1_7, REL8_1_6, REL8_1_5, REL8_1_4, REL8_1_3, REL8_1_2, REL8_1_1
Diff to: previous 1.158.2.1: preferred, colored; branchpoint 1.158: preferred, colored
Changes since revision 1.158.2.1: +9 -1 lines
Fix problems with rewriter failing to set Query.hasSubLinks when inserting
a SubLink expression into a rule query.  Pre-8.1 we essentially did this
unconditionally; 8.1 tries to do it only when needed, but was missing a
couple of cases.  Per report from Kyle Bateman.  Add some regression test
cases covering this area.

Revision 1.160: download - view: text, markup, annotated - select for diffs
Wed Nov 23 17:21:03 2005 UTC (19 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +9 -1 lines
Fix problems with rewriter failing to set Query.hasSubLinks when inserting
a SubLink expression into a rule query.  Pre-8.1 we essentially did this
unconditionally; 8.1 tries to do it only when needed, but was missing a
couple of cases.  Per report from Kyle Bateman.  Add some regression test
cases covering this area.

Revision 1.158.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 22 18:23:16 2005 UTC (19 years, 6 months ago) by momjian
Branches: REL8_1_STABLE
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +28 -27 lines
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory.  Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).

Backpatch to 8.1.X.

Revision 1.159: download - view: text, markup, annotated - select for diffs
Tue Nov 22 18:17:19 2005 UTC (19 years, 6 months ago) by momjian
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +28 -27 lines
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory.  Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).

Backpatch to 8.1.X.

Revision 1.158: download - view: text, markup, annotated - select for diffs
Sat Oct 15 02:49:24 2005 UTC (19 years, 7 months ago) by momjian
Branches: MAIN
CVS tags: REL8_1_0RC1, REL8_1_0BETA4, REL8_1_0
Branch point for: REL8_1_STABLE
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +156 -165 lines
Standard pgindent run for 8.1.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Mon Aug 1 20:31:10 2005 UTC (19 years, 10 months ago) by tgl
Branches: MAIN
CVS tags: REL8_1_0BETA3, REL8_1_0BETA2, REL8_1_0BETA1
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +19 -9 lines
Add NOWAIT option to SELECT FOR UPDATE/SHARE.
Original patch by Hans-Juergen Schoenig, revisions by Karel Zak
and Tom Lane.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Thu Jul 28 22:27:02 2005 UTC (19 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +2 -3 lines
Make use of new list primitives list_append_unique and list_concat_unique
where applicable.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Tue Jun 28 05:08:59 2005 UTC (19 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +2 -2 lines
Replace pg_shadow and pg_group by new role-capable catalogs pg_authid
and pg_auth_members.  There are still many loose ends to finish in this
patch (no documentation, no regression tests, no pg_dump support for
instance).  But I'm going to commit it now anyway so that Alvaro can
make some progress on shared dependencies.  The catalog changes should
be pretty much done.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Sat Jun 4 19:19:42 2005 UTC (20 years ago) by tgl
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +23 -9 lines
Change expandRTE() and ResolveNew() back to taking just the single
RTE of interest, rather than the whole rangetable list.  This makes
the API more understandable and avoids duplicate RTE lookups.  This
patch reverts no-longer-needed portions of my patch of 2004-08-19.

Revision 1.153: download - view: text, markup, annotated - select for diffs
Fri Jun 3 23:05:28 2005 UTC (20 years ago) by tgl
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +214 -38 lines
Revise handling of dropped columns in JOIN alias lists to avoid a
performance problem pointed out by phil@vodafone: to wit, we were
spending O(N^2) time to check dropped-ness in an N-deep join tree,
even in the case where the tree was freshly constructed and couldn't
possibly mention any dropped columns.  Instead of recursing in
get_rte_attribute_is_dropped(), change the data structure definition:
the joinaliasvars list of a JOIN RTE must have a NULL Const instead
of a Var at any position that references a now-dropped column.  This
costs nothing during normal parse-rewrite-plan path, and instead we
have a linear-time update to make when loading a stored rule that
might contain now-dropped columns.  While at it, move the responsibility
for acquring locks on relations referenced by rules into this separate
function (which I therefore chose to call AcquireRewriteLocks).
This saves effort --- namely, duplicated lock grabs in parser and rewriter
--- in the normal path at a cost of one extra non-locked heap_open()
in the stored-rule path; seems a good tradeoff.  A fringe benefit is
that it is now *much* clearer that we acquire lock on relations referenced
in rules before we make any rewriter decisions based on their properties.
(I don't know of any bug of that ilk, but it wasn't exactly clear before.)

Revision 1.152: download - view: text, markup, annotated - select for diffs
Sun May 29 18:34:57 2005 UTC (20 years ago) by tgl
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +3 -7 lines
Avoid unnecessary call of rangeTableEntry_used() for the result relation
of a query.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Thu Apr 28 21:47:14 2005 UTC (20 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +18 -12 lines
Implement sharable row-level locks, and use them for foreign key references
to eliminate unnecessary deadlocks.  This commit adds SELECT ... FOR SHARE
paralleling SELECT ... FOR UPDATE.  The implementation uses a new SLRU
data structure (managed much like pg_subtrans) to represent multiple-
transaction-ID sets.  When more than one transaction is holding a shared
lock on a particular row, we create a MultiXactId representing that set
of transactions and store its ID in the row's XMAX.  This scheme allows
an effectively unlimited number of row locks, just as we did before,
while not costing any extra overhead except when a shared lock actually
has to be shared.   Still TODO: use the regular lock manager to control
the grant order when multiple backends are waiting for a row lock.

Alvaro Herrera and Tom Lane.

Revision 1.150: download - view: text, markup, annotated - select for diffs
Wed Apr 6 16:34:06 2005 UTC (20 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +14 -16 lines
Merge Resdom nodes into TargetEntry nodes to simplify code and save a
few palloc's.  I also chose to eliminate the restype and restypmod fields
entirely, since they are redundant with information stored in the node's
contained expression; re-examining the expression at need seems simpler
and more reliable than trying to keep restype/restypmod up to date.

initdb forced due to change in contents of stored rules.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Sat Mar 26 05:53:01 2005 UTC (20 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +64 -56 lines
Rewrite rewriteTargetList() to avoid O(N^2) behavior on wide target lists.

Revision 1.148: download - view: text, markup, annotated - select for diffs
Thu Mar 10 23:21:24 2005 UTC (20 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +1 -30 lines
Make the behavior of HAVING without GROUP BY conform to the SQL spec.
Formerly, if such a clause contained no aggregate functions we mistakenly
treated it as equivalent to WHERE.  Per spec it must cause the query to
be treated as a grouped query of a single group, the same as appearance
of aggregate functions would do.  Also, the HAVING filter must execute
after aggregate function computation even if it itself contains no
aggregate functions.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Fri Dec 31 22:00:45 2004 UTC (20 years, 5 months ago) by pgsql
Branches: MAIN
CVS tags: REL8_0_8, REL8_0_7, REL8_0_6, REL8_0_5, REL8_0_4, REL8_0_3, REL8_0_2, REL8_0_1, REL8_0_0RC5, REL8_0_0RC4, REL8_0_0RC3, REL8_0_0
Branch point for: REL8_0_STABLE
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +2 -2 lines

Tag appropriate files for rc3

Also performed an initial run through of upgrading our Copyright date to
extend to 2005 ... first run here was very simple ... change everything
where: grep 1996-2004 && the word 'Copyright' ... scanned through the
generated list with 'less' first, and after, to make sure that I only
picked up the right entries ...

Revision 1.146: download - view: text, markup, annotated - select for diffs
Sat Nov 20 17:59:31 2004 UTC (20 years, 6 months ago) by tgl
Branches: MAIN
CVS tags: REL8_0_0RC2, REL8_0_0RC1, REL8_0_0BETA5
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +3 -1 lines
Fix one more place where we were expecting lcons() to be nondestructive
to the original List; per report from Sebastian B�ck.  I think this is
the last such bug --- I examined every lcons() call in the backend and
the rest seem OK --- but it's nervous-making that we're still finding
'em so many months after the List rewrite went in.

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sat Nov 6 17:46:35 2004 UTC (20 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +2 -1 lines
When implementing a coercion to a domain type with a combined
type-and-length coercion function, make sure that the coercion function
is told the correct typmod.  Fixes Kris Jurka's example of a domain
over bit(N).

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sun Aug 29 05:06:47 2004 UTC (20 years, 9 months ago) by momjian
Branches: MAIN
CVS tags: REL8_0_0BETA4, REL8_0_0BETA3, REL8_0_0BETA2
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +28 -22 lines
Pgindent run for 8.0.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Sun Aug 29 04:12:47 2004 UTC (20 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +2 -2 lines
Update copyright to 2004.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Thu Aug 19 20:57:40 2004 UTC (20 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +3 -4 lines
Repair some issues with column aliases and RowExpr construction in the
presence of dropped columns.  Document the already-presumed fact that
eref aliases in relation RTEs are supposed to have entries for dropped
columns; cause the user alias structs to have such entries too, so that
there's always a one-to-one mapping to the underlying physical attnums.
Adjust expandRTE() and related code to handle the case where a column
that is part of a JOIN has been dropped.  Generalize expandRTE()'s API
so that it can be used in a couple of places that formerly rolled their
own implementation of the same logic.  Fix ruleutils.c to suppress
display of aliases for columns that were dropped since the rule was made.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Sat Aug 7 17:40:49 2004 UTC (20 years, 10 months ago) by tgl
Branches: MAIN
CVS tags: REL8_0_0BETA1
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +3 -2 lines
Don't try to rewrite NEW references in a utility statement in a rule.
There won't be any, and in fact there won't even be an RTE for NEW,
which was leading to a core dump in CVS tip.  7.4 and earlier manage
not to crash when applying ResolveNew in this scenario, but I think
it was just good fortune that they didn't.  Per report from
Bernd Helmle.

Revision 1.140: download - view: text, markup, annotated - select for diffs
Wed Jun 16 01:26:46 2004 UTC (20 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +3 -2 lines
Represent type-specific length coercion functions as pg_cast entries,
eliminating the former hard-wired convention about their names.  Allow
pg_cast entries to represent both type coercion and length coercion in
a single step --- this is represented by a function that takes an
extra typmod argument, just like a length coercion function.  This
nicely merges the type and length coercion mechanisms into something
at least a little cleaner than we had before.  Make use of the single-
coercion-step behavior to fix integer-to-bit coercion so that coercing
to bit(n) yields the rightmost n bits of the integer instead of the
leftmost n bits.  This should fix recurrent complaints about the odd
behavior of this coercion.  Clean up the documentation of the bit string
functions, and try to put it where people might actually find it.
Also, get rid of the unreliable heuristics in ruleutils.c about whether
to display nested coercion steps; instead require parse_coerce.c to
label them properly in the first place.

Revision 1.139: download - view: text, markup, annotated - select for diffs
Wed Jun 9 19:08:17 2004 UTC (20 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +110 -22 lines
Support assignment to subfields of composite columns in UPDATE and INSERT.
As a side effect, cause subscripts in INSERT targetlists to do something
more or less sensible; previously we evaluated such subscripts and then
effectively ignored them.  Another side effect is that UPDATE-ing an
element or slice of an array value that is NULL now produces a non-null
result, namely an array containing just the assigned-to positions.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Sun May 30 23:40:35 2004 UTC (21 years ago) by neilc
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +16 -16 lines
Use the new List API function names throughout the backend, and disable the
list compatibility API by default. While doing this, I decided to keep
the llast() macro around and introduce llast_int() and llast_oid() variants.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Sat May 29 05:55:13 2004 UTC (21 years ago) by tgl
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +5 -4 lines
Fix another place that assumed 'x = lcons(y, z)' would not have any
side-effect on the original list z.  I fear we have a few more of these
to track down yet :-(.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Wed May 26 04:41:33 2004 UTC (21 years ago) by neilc
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +15 -15 lines
Reimplement the linked list data structure used throughout the backend.

In the past, we used a 'Lispy' linked list implementation: a "list" was
merely a pointer to the head node of the list. The problem with that
design is that it makes lappend() and length() linear time. This patch
fixes that problem (and others) by maintaining a count of the list
length and a pointer to the tail node along with each head node pointer.
A "list" is now a pointer to a structure containing some meta-data
about the list; the head and tail pointers in that structure refer
to ListCell structures that maintain the actual linked list of nodes.

The function names of the list API have also been changed to, I hope,
be more logically consistent. By default, the old function names are
still available; they will be disabled-by-default once the rest of
the tree has been updated to use the new API names.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Mon May 10 22:44:46 2004 UTC (21 years ago) by tgl
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +4 -1 lines
Promote row expressions to full-fledged citizens of the expression syntax,
rather than allowing them only in a few special cases as before.  In
particular you can now pass a ROW() construct to a function that accepts
a rowtype parameter.  Internal generation of RowExprs fixes a number of
corner cases that used to not work very well, such as referencing the
whole-row result of a JOIN or subquery.  This represents a further step in
the work I started a month or so back to make rowtype values into
first-class citizens.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Thu Apr 1 21:28:44 2004 UTC (21 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +2 -11 lines
Replace TupleTableSlot convention for whole-row variables and function
results with tuples as ordinary varlena Datums.  This commit does not
in itself do much for us, except eliminate the horrid memory leak
associated with evaluation of whole-row variables.  However, it lays the
groundwork for allowing composite types as table columns, and perhaps
some other useful features as well.  Per my proposal of a few days ago.

Revision 1.133: download - view: text, markup, annotated - select for diffs
Wed Jan 14 23:01:55 2004 UTC (21 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +5 -7 lines
Fix permission-checking bug reported by Tim Burgess 10-Feb-03 (this time
for sure...).  Rather than relying on the query context of a rangetable
entry to identify what permissions it wants checked, store a full AclMode
mask in each RTE, and check exactly those bits.  This allows an RTE
specifying, say, INSERT privilege on a view to be copied into a derived
UPDATE query without changing meaning.  Per recent discussion thread.
initdb forced due to change of stored rule representation.

Revision 1.113.2.2: download - view: text, markup, annotated - select for diffs
Wed Jan 14 03:39:36 2004 UTC (21 years, 4 months ago) by tgl
Branches: REL7_3_STABLE
CVS tags: REL7_3_9, REL7_3_8, REL7_3_7, REL7_3_6, REL7_3_18, REL7_3_17, REL7_3_16, REL7_3_15, REL7_3_14, REL7_3_13, REL7_3_12, REL7_3_11, REL7_3_10
Diff to: previous 1.113.2.1: preferred, colored; branchpoint 1.113: preferred, colored
Changes since revision 1.113.2.1: +3 -20 lines
Revert ill-starred change of 13-Feb-02: it appeared to fix a problem of
incorrect permissions checking, but in fact disabled most all permissions
checks for view updates.  This corrects problems reported by Sergey
Yatskevich among others, at the cost of re-introducing the problem
previously reported by Tim Burgess.  However, since we'd lived with that
problem for quite awhile without knowing it, we can live with it awhile
longer until a proper fix can be made in 7.5.

Revision 1.130.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 14 03:39:29 2004 UTC (21 years, 4 months ago) by tgl
Branches: REL7_4_STABLE
CVS tags: REL7_4_9, REL7_4_8, REL7_4_7, REL7_4_6, REL7_4_5, REL7_4_4, REL7_4_3, REL7_4_2, REL7_4_16, REL7_4_15, REL7_4_14, REL7_4_13, REL7_4_12, REL7_4_11, REL7_4_10
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +22 -24 lines
Revert ill-starred change of 13-Feb-02: it appeared to fix a problem of
incorrect permissions checking, but in fact disabled most all permissions
checks for view updates.  This corrects problems reported by Sergey
Yatskevich among others, at the cost of re-introducing the problem
previously reported by Tim Burgess.  However, since we'd lived with that
problem for quite awhile without knowing it, we can live with it awhile
longer until a proper fix can be made in 7.5.

Revision 1.132: download - view: text, markup, annotated - select for diffs
Wed Jan 14 03:39:22 2004 UTC (21 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +22 -24 lines
Revert ill-starred change of 13-Feb-02: it appeared to fix a problem of
incorrect permissions checking, but in fact disabled most all permissions
checks for view updates.  This corrects problems reported by Sergey
Yatskevich among others, at the cost of re-introducing the problem
previously reported by Tim Burgess.  However, since we'd lived with that
problem for quite awhile without knowing it, we can live with it awhile
longer until a proper fix can be made in 7.5.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Sat Nov 29 19:51:55 2003 UTC (21 years, 6 months ago) by pgsql
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +1 -1 lines

$Header: -> $PostgreSQL Changes ...

Revision 1.130: download - view: text, markup, annotated - select for diffs
Thu Sep 25 06:58:01 2003 UTC (21 years, 8 months ago) by petere
Branches: MAIN
CVS tags: REL7_4_RC2, REL7_4_RC1, REL7_4_BETA5, REL7_4_BETA4, REL7_4_1, REL7_4
Branch point for: REL7_4_STABLE
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +3 -3 lines
Message editing: remove gratuitous variations in message wording, standardize
terms, add some clarifications, fix some untranslatable attempts at dynamic
message building.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Mon Aug 11 23:04:49 2003 UTC (21 years, 9 months ago) by tgl
Branches: MAIN
CVS tags: WIN32_DEV, REL7_4_BETA3, REL7_4_BETA2
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +11 -11 lines
Rewriter and planner should use only resno, not resname, to identify
target columns in INSERT and UPDATE targetlists.  Don't rely on resname
to be accurate in ruleutils, either.  This fixes bug reported by
Donald Fraser, in which renaming a column referenced in a rule did not
work very well.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Fri Aug 8 21:41:56 2003 UTC (21 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +2 -2 lines
Another pgindent run with updated typedefs.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Mon Aug 4 02:40:03 2003 UTC (21 years, 10 months ago) by momjian
Branches: MAIN
CVS tags: REL7_4_BETA1
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +2 -2 lines
Update copyrights to 2003.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Mon Aug 4 00:43:22 2003 UTC (21 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +59 -54 lines
pgindent run.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Tue Jul 29 17:21:24 2003 UTC (21 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +6 -9 lines
Coerce unknown-literal-constant default values to the column type during
CREATE TABLE (or ALTER TABLE SET DEFAULT), rather than postponing it to
the time that the default is inserted into an INSERT command by the
rewriter.  This reverses an old decision that was intended to make the
world safe for writing
	f1 timestamp default 'now'
but in fact merely made the failure modes subtle rather than obvious.
Per recent trouble report and followup discussion.

initdb forced since there is a chance that stored default expressions
will change.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Fri Jul 25 00:01:08 2003 UTC (21 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +46 -29 lines
Error message editing in backend/optimizer, backend/rewrite.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Wed Jul 16 17:25:48 2003 UTC (21 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +17 -4 lines
Add defenses against trying to attach qual conditions to a setOperation
query node, since that won't work unless the planner is upgraded.
Someday we should try to support at least some cases of this, but for
now just plug the hole in the dike.  Per discussion with Dmitry Tkach.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Thu Jul 3 16:34:25 2003 UTC (21 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +38 -27 lines
Code review for UPDATE tab SET col = DEFAULT patch ... whack it around
so it has some chance of working in rules ...

Revision 1.121: download - view: text, markup, annotated - select for diffs
Wed Jun 25 04:19:24 2003 UTC (21 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +20 -2 lines
UPDATE ... SET <col> = DEFAULT

Rod Taylor

Revision 1.120: download - view: text, markup, annotated - select for diffs
Fri May 2 20:54:35 2003 UTC (22 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +51 -1 lines
Portal and memory management infrastructure for extended query protocol.
Both plannable queries and utility commands are now always executed
within Portals, which have been revamped so that they can handle the
load (they used to be good only for single SELECT queries).  Restructure
code to push command-completion-tag selection logic out of postgres.c,
so that it won't have to be duplicated between simple and extended queries.
initdb forced due to addition of a field to Query nodes.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Tue Apr 29 22:13:10 2003 UTC (22 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +3 -2 lines
Infrastructure for deducing Param types from context, in the same way
that the types of untyped string-literal constants are deduced (ie,
when coerce_type is applied to 'em, that's what the type must be).
Remove the ancient hack of storing the input Param-types array as a
global variable, and put the info into ParseState instead.  This touches
a lot of files because of adjustment of routine parameter lists, but
it's really not a large patch.  Note: PREPARE statement still insists on
exact specification of parameter types, but that could easily be relaxed
now, if we wanted to do so.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Tue Feb 25 23:47:43 2003 UTC (22 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +129 -141 lines
Remove REWRITE_INVOKE_MAX in favor of making an accurate check for
recursion in RewriteQuery(); also, detect recursion in fireRIRrules(),
so as to catch self-referential views per example from Ryan VanderBijl.
Minor code restructuring to make it easier to catch recursive case.

Revision 1.113.2.1: download - view: text, markup, annotated - select for diffs
Thu Feb 13 21:40:00 2003 UTC (22 years, 3 months ago) by tgl
Branches: REL7_3_STABLE
CVS tags: REL7_3_5, REL7_3_4
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +21 -4 lines
Repair rule permissions-checking bug reported by Tim Burgess 10-Feb-02:
the table(s) modified by the original query would get checked for the
type of write permission needed by a rule query.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Thu Feb 13 21:39:50 2003 UTC (22 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +21 -4 lines
Repair rule permissions-checking bug reported by Tim Burgess 10-Feb-02:
the table(s) modified by the original query would get checked for the
type of write permission needed by a rule query.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Fri Jan 17 02:01:16 2003 UTC (22 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +2 -2 lines
Adjust API of expression_tree_mutator and query_tree_mutator to
simplify callers.  It turns out the common case is that the caller
does want to recurse into sub-queries, so push support for that into
these subroutines.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Tue Dec 17 01:18:32 2002 UTC (22 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +4 -2 lines
To suppress memory leakage in long-lived Lists, lremove() should pfree
the cons cell it's deleting from the list.  Do this, and fix a few callers
that were bogusly assuming it wouldn't free the cons cell.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Thu Dec 12 15:49:40 2002 UTC (22 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +5 -5 lines
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.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Sun Oct 20 00:58:55 2002 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
CVS tags: REL7_3_2
Branch point for: REL7_3_STABLE
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +15 -13 lines
Rule rewriter was doing the wrong thing with conditional INSTEAD rules
whose conditions might yield NULL.  The negated qual to attach to the
original query is properly 'x IS NOT TRUE', not 'NOT x'.  This fix
produces correct behavior, but we may be taking a performance hit because
the planner is much stupider about IS NOT TRUE than it is about NOT
clauses.  Future TODO: teach prepqual, other parts of planner how to
cope with BooleanTest clauses more effectively.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Sat Oct 19 19:00:47 2002 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +82 -122 lines
Fix rewrite code so that rules are in fact executed in order by name,
rather than being reordered according to INSTEAD attribute for
implementation convenience.
Also, increase compiled-in recursion depth limit from 10 to 100 rewrite
cycles.  10 seems pretty marginal for situations where multiple rules
exist for the same query.  There was a complaint about this recently,
so I'm going to bump it up.  (Perhaps we should make the limit a GUC
parameter, but that's too close to being a new feature to do in beta.)

Revision 1.111: download - view: text, markup, annotated - select for diffs
Mon Oct 14 22:14:35 2002 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +19 -3 lines
Adjust handling of command status strings in the presence of rules,
as per recent pghackers discussions.  initdb forced due to change in
fields of stored Query nodes.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Wed Sep 18 21:35:22 2002 UTC (22 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +14 -23 lines
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution.  Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed Sep 11 14:48:54 2002 UTC (22 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +4 -3 lines
Tweak querytree-dependency-extraction code so that columns of tables
that are explicitly JOINed are not considered dependencies unless they
are actually used in the query: mere presence in the joinaliasvars
list of a JOIN RTE doesn't count as being used.  The patch touches
a number of files because I needed to generalize the API of
query_tree_walker to support an additional flag bit, but the changes
are otherwise quite small.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Wed Sep 4 20:31:25 2002 UTC (22 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +21 -23 lines
pgindent run.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Thu Aug 29 06:05:27 2002 UTC (22 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +7 -4 lines
Rephrase 'Cannot insert into a view' and related messages, per
pghackers discussion around 31-Jul-02.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Mon Aug 26 17:53:58 2002 UTC (22 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +3 -3 lines
Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements
the same way normal tuple access operations do --- viz, using the
tupmacs.h macros att_addlength and att_align.  This makes the world
safe for arrays of cstrings or intervals, and should make it much
easier to write array-type-polymorphic functions; as examples see
the cleanups of array_out and contrib/array_iterator.  By Joe Conway
and Tom Lane.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Fri Aug 2 18:15:07 2002 UTC (22 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +5 -1 lines
ALTER TABLE DROP COLUMN works.  Patch by Christopher Kings-Lynne,
code review by Tom Lane.  Remaining issues: functions that take or
return tuple types are likely to break if one drops (or adds!)
a column in the table defining the type.  Need to think about what
to do here.

Along the way: some code review for recent COPY changes; mark system
columns attnotnull = true where appropriate, per discussion a month ago.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Thu Jul 18 04:43:50 2002 UTC (22 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +2 -3 lines
The attached patch (against HEAD) implements

  COPY x (a,d,c,b) from stdin;
  COPY x (a,c) to stdout;

as well as the corresponding changes to pg_dump to use the new
functionality.  This functionality is not available when using
the BINARY option.  If a column is not specified in the COPY FROM
statement, its default values will be used.

In addition to this functionality, I tweaked a couple of the
error messages emitted by the new COPY <options> checks.

Brent Verner

Revision 1.103: download - view: text, markup, annotated - select for diffs
Thu Jun 20 20:29:34 2002 UTC (22 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +2 -2 lines
Update copyright to 2002.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Thu Apr 11 20:00:02 2002 UTC (23 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +2 -2 lines
Restructure representation of aggregate functions so that they have pg_proc
entries, per pghackers discussion.  This fixes aggregates to live in
namespaces, and also simplifies/speeds up lookup in parse_func.c.
Also, add a 'proimplicit' flag to pg_proc that controls whether a type
coercion function may be invoked implicitly, or only explicitly.  The
current settings of these flags are more permissive than I would like,
but we will need to debate and refine the behavior; for now, I avoided
breaking regression tests as much as I could.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Fri Apr 5 05:47:05 2002 UTC (23 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +299 -2 lines
Undo not-so-hot decision to postpone insertion of default values into
INSERT statements to the planner.  Taking it out of the parser was right
(so that defaults don't get into stored rules), but it has to happen
before rewrite rule expansion, else references to NEW.field behave
incorrectly.  Accordingly, add a step to the rewriter to insert defaults
just before rewrite-rule expansion.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Mar 22 02:56:34 2002 UTC (23 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +3 -24 lines
A little further progress on schemas: push down RangeVars into
addRangeTableEntry calls.  Remove relname field from RTEs, since
it will no longer be a useful unique identifier of relations;
we want to encourage people to rely on the relation OID instead.
Further work on dumping qual expressions in EXPLAIN, too.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Tue Mar 12 00:51:58 2002 UTC (23 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +17 -9 lines
Restructure representation of join alias variables.  An explicit JOIN
now has an RTE of its own, and references to its outputs now are Vars
referencing the JOIN RTE, rather than CASE-expressions.  This allows
reverse-listing in ruleutils.c to use the correct alias easily, rather
than painfully reverse-engineering the alias namespace as it used to do.
Also, nested FULL JOINs work correctly, because the result of the inner
joins are simple Vars that the planner can cope with.  This fixes a bug
reported a couple times now, notably by Tatsuo on 18-Nov-01.  The alias
Vars are expanded into COALESCE expressions where needed at the very end
of planning, rather than during parsing.
Also, beginnings of support for showing plan qualifier expressions in
EXPLAIN.  There are probably still cases that need work.
initdb forced due to change of stored-rule representation.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Thu Oct 25 05:49:41 2001 UTC (23 years, 7 months ago) by momjian
Branches: MAIN
CVS tags: REL7_2_STABLE, REL7_2_RC2, REL7_2_RC1, REL7_2_BETA5, REL7_2_BETA4, REL7_2_BETA3, REL7_2_BETA2, REL7_2_BETA1, REL7_2_8, REL7_2_7, REL7_2_6, REL7_2_5, REL7_2_4, REL7_2_3, REL7_2
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +33 -31 lines
pgindent run on all C files.  Java run to follow.  initdb/regression
tests pass.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Mon Jul 9 23:50:32 2001 UTC (23 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +34 -18 lines
Fix rule rewriter so that new ordering of ON INSERT actions applies
in cases of qualified rules as well as unqualified ones.  Tweak rules
test to avoid cluttering output with dummy SELECT results.  Update
documentation to match code.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Fri Jul 6 13:40:47 2001 UTC (23 years, 11 months ago) by wieck
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +5 -2 lines
Fire rule actions ON INSERT after original statement (if not INSTEAD).

Jan

Revision 1.95: download - view: text, markup, annotated - select for diffs
Wed Jun 13 18:56:30 2001 UTC (23 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +44 -62 lines
Remove some dead code, simplify calling convention.

Revision 1.93.2.1: download - view: text, markup, annotated - select for diffs
Tue Jun 12 18:54:53 2001 UTC (23 years, 11 months ago) by tgl
Branches: REL7_1_STABLE
Diff to: previous 1.93: preferred, colored; next MAIN 1.94: preferred, colored
Changes since revision 1.93: +20 -21 lines
Repair problem with multi-action rules in combination with any nontrivial
manipulation of rtable/jointree by planner.  Rewriter was generating
actions that shared rtable/jointree substructure, which caused havoc
when planner got to the later actions that it'd already mucked up.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Tue Jun 12 18:54:22 2001 UTC (23 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +20 -21 lines
Repair problem with multi-action rules in combination with any nontrivial
manipulation of rtable/jointree by planner.  Rewriter was generating
actions that shared rtable/jointree substructure, which caused havoc
when planner got to the later actions that it'd already mucked up.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Thu May 3 17:47:49 2001 UTC (24 years, 1 month ago) by tgl
Branches: MAIN
CVS tags: REL7_1_2
Branch point for: REL7_1_STABLE
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +3 -1 lines
Permissions were not checked correctly when one view invokes another.
Per bug report from Lieven Van Acker, 5/2/01.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:32:58 2001 UTC (24 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +27 -5 lines
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.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Thu Mar 22 06:16:16 2001 UTC (24 years, 2 months ago) by momjian
Branches: MAIN
CVS tags: REL7_1
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +23 -29 lines
Remove dashes in comments that don't need them, rewrap with pgindent.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Thu Mar 22 03:59:44 2001 UTC (24 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +62 -61 lines
pgindent run.  Make it all clean.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sat Jan 27 04:40:59 2001 UTC (24 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +32 -24 lines
Repair bug reported by Huxton, 1/24/01.  We need to include a rule's
original table ('OLD' table) in its join tree if OLD is referenced by
either the rule action, the rule qual, or the original query qual that
will be added to the rule action.  However, we only want one instance
of the original table to be included; so beware of the possibility that
the rule action already has a jointree entry for OLD.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Wed Jan 24 19:43:05 2001 UTC (24 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +2 -2 lines
Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Wed Jan 3 22:01:05 2001 UTC (24 years, 5 months ago) by tgl
Branches: MAIN
CVS tags: REL7_1_BETA3, REL7_1_BETA2
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +2 -1 lines
Fix breakage of rules using NOTIFY actions, per bug report and patch
from sergiop@sinectis.com.ar.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Thu Dec 7 01:22:25 2000 UTC (24 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +42 -22 lines
Make application of FOR UPDATE to a view work exactly like the parser's
transformForUpdate does: it should recurse into subqueries.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Wed Dec 6 23:55:18 2000 UTC (24 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +1 -29 lines
Clean up handling of FOR UPDATE inside views and subselects ... make it
work where we can (given that the executor only handles it at top level)
and generate an error where we can't.  Note that while the parser has
been allowing views to say SELECT FOR UPDATE for a few weeks now, that
hasn't actually worked until just now.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Tue Dec 5 19:15:09 2000 UTC (24 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +149 -169 lines
Repair breakage of rules containing INSERT ... SELECT actions, per bug
report from Joel Burton.  Turns out that my simple idea of turning the
SELECT into a subquery does not interact well *at all* with the way the
rule rewriter works.  Really what we need to make INSERT ... SELECT work
cleanly is to decouple targetlists from rangetables: an INSERT ... SELECT
wants to have two levels of targetlist but only one rangetable.  No time
for that for 7.1, however, so I've inserted some ugly hacks to make the
rewriter know explicitly about the structure of INSERT ... SELECT queries.
Ugh :-(

Revision 1.83: download - view: text, markup, annotated - select for diffs
Wed Nov 8 22:09:59 2000 UTC (24 years, 6 months ago) by tgl
Branches: MAIN
CVS tags: REL7_1_BETA
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +48 -14 lines
Make DROP TABLE rollback-able: postpone physical file delete until commit.
(WAL logging for this is not done yet, however.)  Clean up a number of really
crufty things that are no longer needed now that DROP behaves nicely.  Make
temp table mapper do the right things when drop or rename affecting a temp
table is rolled back.  Also, remove "relation modified while in use" error
check, in favor of locking tables at first reference and holding that lock
throughout the statement.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu Oct 5 19:11:34 2000 UTC (24 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +41 -551 lines
Reimplementation of UNION/INTERSECT/EXCEPT.  INTERSECT/EXCEPT now meet the
SQL92 semantics, including support for ALL option.  All three can be used
in subqueries and views.  DISTINCT and ORDER BY work now in views, too.
This rewrite fixes many problems with cross-datatype UNIONs and INSERT/SELECT
where the SELECT yields different datatypes than the INSERT needs.  I did
that by making UNION subqueries and SELECT in INSERT be treated like
subselects-in-FROM, thereby allowing an extra level of targetlist where the
datatype conversions can be inserted safely.
INITDB NEEDED!

Revision 1.81: download - view: text, markup, annotated - select for diffs
Fri Sep 29 18:21:24 2000 UTC (24 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +175 -631 lines
Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.
(Don't forget that an alias is required.)  Views reimplemented as expanding
to subselect-in-FROM.  Grouping, aggregates, DISTINCT in views actually
work now (he says optimistically).  No UNION support in subselects/views
yet, but I have some ideas about that.  Rule-related permissions checking
moved out of rewriter and into executor.
INITDB REQUIRED!

Revision 1.80: download - view: text, markup, annotated - select for diffs
Tue Sep 12 21:07:03 2000 UTC (24 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +154 -276 lines
First cut at full support for OUTER JOINs.  There are still a few loose
ends to clean up (see my message of same date to pghackers), but mostly
it works.  INITDB REQUIRED!

Revision 1.79: download - view: text, markup, annotated - select for diffs
Wed Sep 6 14:15:20 2000 UTC (24 years, 9 months ago) by petere
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +2 -2 lines
Code cleanup of user name and user id handling in the backend. The current
user is now defined in terms of the user id, the user name is only computed
upon request (for display purposes). This is kind of the opposite of the
previous state, which would maintain the user name and compute the user id
for permission checks.

Besides perhaps saving a few cycles (integer vs string), this now creates a
single point of attack for changing the user id during a connection, for
purposes of "setuid" functions, etc.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Tue Aug 8 15:42:14 2000 UTC (24 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +2 -4 lines
Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'
from Param nodes, per discussion a few days ago on pghackers.  Add new
expression node type FieldSelect that implements the functionality where
it's actually needed.  Clean up some other unused fields in Func nodes
as well.
NOTE: initdb forced due to change in stored expression trees for rules.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Fri Jun 30 07:04:22 2000 UTC (24 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +6 -6 lines
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.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Thu Jun 15 03:32:22 2000 UTC (24 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +2 -1 lines
Clean up #include's.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Mon Jun 12 19:40:42 2000 UTC (24 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +8 -8 lines
Rename rule CURRENT to OLD in source tree.  Add mapping for backward
compatiblity with old rules.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue May 30 00:49:51 2000 UTC (25 years ago) by momjian
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +1 -3 lines
Remove unused include files.  Do not touch /port or includes used by defines.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Thu Apr 27 20:32:41 2000 UTC (25 years, 1 month ago) by tgl
Branches: MAIN
CVS tags: REL7_0_PATCHES, REL7_0
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +50 -33 lines
Except_Intersect_Rewrite() failed to ignore resjunk targetlist entries,
thus causing failure if one sub-select had resjunk entries that the other
did not (cf. bug report from Espinosa 4/27/00).

Revision 1.72: download - view: text, markup, annotated - select for diffs
Thu Apr 20 00:31:49 2000 UTC (25 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +19 -19 lines
Correct error in rewriter that caused SELECT count(*) FROM view
to give wrong results: it should be looking at inJoinSet not inFromCl.
Also, make 'modified' flag be local to ApplyRetrieveRule: we should
append a rule's quals to the query iff that particular rule applies,
not if we have fired any previously-considered rule for the query!

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Apr 12 17:15:32 2000 UTC (25 years, 1 month ago) by momjian
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +84 -63 lines
Ye-old pgindent run.  Same 4-space tabs.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Apr 4 02:30:52 2000 UTC (25 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +14 -11 lines
When rewriting an aggregate introduced into WHERE, allow agg argument to
be an expression not just a simple Var, so long as only one table is
referenced (so that code isn't really any more difficult than before).
This whole thing is still fundamentally bogus, but at least we can accept
a few more cases than before.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Thu Mar 16 03:23:18 2000 UTC (25 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +22 -146 lines
Fix some (more) problems with subselects in rules.  Rewriter failed to
mark query as having subselects if a subselect was added from a rule
WHERE condition (as opposed to a rule action).  Also, fix adjustment
of varlevelsup so that it actually has some prospect of working when
inserting an expression containing a subselect into a subquery.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Sun Mar 12 18:57:05 2000 UTC (25 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +6 -12 lines
Fix performance problem in fireRIRonSubselect: with nested subqueries,
fireRIRonSubselect was invoked twice at each subselect, leading to an
exponential amount of wasted effort.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Thu Jan 27 18:11:37 2000 UTC (25 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +10 -10 lines
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...

Revision 1.66: download - view: text, markup, annotated - select for diffs
Wed Jan 26 05:56:49 2000 UTC (25 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -2 lines
Add:

  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Mon Jan 17 02:04:13 2000 UTC (25 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +2 -2 lines
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.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Wed Jan 5 18:23:48 2000 UTC (25 years, 5 months ago) by momjian
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +2 -2 lines
Fix it's and its to be correct.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Mon Nov 15 02:00:03 1999 UTC (25 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +78 -76 lines
Implement subselects in target lists.  Also, relax requirement that
subselects can only appear on the righthand side of a binary operator.
That's still true for quantified predicates like x = ANY (SELECT ...),
but a subselect that delivers a single result can now appear anywhere
in an expression.  This is implemented by changing EXPR_SUBLINK sublinks
to represent just the (SELECT ...) expression, without any 'left hand
side' or combining operator --- so they're now more like EXISTS_SUBLINK.
To handle the case of '(x, y, z) = (SELECT ...)', I added a new sublink
type MULTIEXPR_SUBLINK, which acts just like EXPR_SUBLINK used to.
But the grammar will only generate one for a multiple-left-hand-side
row expression.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Mon Nov 1 05:18:31 1999 UTC (25 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +22 -72 lines
Eliminate RewritePreprocessQuery, which was taking an
unreasonable amount of time to clean up after a vanished parser problem.
Don't call fireRIRonSubselect when we know there are no subselects,
either.

Revision 1.48.2.1: download - view: text, markup, annotated - select for diffs
Tue Oct 19 04:38:05 1999 UTC (25 years, 7 months ago) by tgl
Branches: REL6_5_PATCHES
Diff to: previous 1.48: preferred, colored; next MAIN 1.49: preferred, colored
Changes since revision 1.48: +7 -1 lines
Back-patch LIMIT + INTERSECT fix into 6.5.*.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sun Oct 17 23:50:43 1999 UTC (25 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +8 -1 lines
Except_Intersect_Rewrite() forgot to move LIMIT info to new
topmost SELECT node after rearranging query tree.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Thu Oct 7 04:23:15 1999 UTC (25 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +56 -35 lines
Fix planner and rewriter to follow SQL semantics for tables that are
mentioned in FROM but not elsewhere in the query: such tables should be
joined over anyway.  Aside from being more standards-compliant, this allows
removal of some very ugly hacks for COUNT(*) processing.  Also, allow
HAVING clause without aggregate functions, since SQL does.  Clean up
CREATE RULE statement-list syntax the same way Bruce just fixed the
main stmtmulti production.
CAUTION: addition of a field to RangeTblEntry nodes breaks stored rules;
you will have to initdb if you have any rules.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Sat Oct 2 04:42:04 1999 UTC (25 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +16 -1 lines
Stick finger into a couple more holes in the leaky dike of
modifyAggrefQual.  This routine really, really needs to be retired, but
until we have subselects in FROM there's no chance of doing the job right.
In the meantime try to respond to unhandlable cases with elog rather than
coredump.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Fri Oct 1 04:08:24 1999 UTC (25 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +503 -1543 lines
Clean up rewriter routines to use expression_tree_walker and
expression_tree_mutator rather than ad-hoc tree walking code.  This shortens
the code materially and fixes a fair number of sins of omission.  Also,
change modifyAggrefQual to *not* recurse into subselects, since its mission
is satisfied if it removes aggregate functions from the top level of a
WHERE clause.  This cures problems with queries of the form SELECT ...
WHERE x IN (SELECT ... HAVING something-using-an-aggregate), which would
formerly get mucked up by modifyAggrefQual.  The routine is still
fundamentally broken, of course, but I don't think there's any way to get
rid of it before we implement subselects in FROM ...

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sun Sep 19 17:20:58 1999 UTC (25 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +2 -9 lines
Remove incorrect 'Assert(targetList != NULL)'.  An
INSERT ... DEFAULT VALUES statement does indeed have a null targetlist,
at least during parse and rewrite stages.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sat Sep 18 19:07:19 1999 UTC (25 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +8 -9 lines
Mega-commit to make heap_open/heap_openr/heap_close take an
additional argument specifying the kind of lock to acquire/release (or
'NoLock' to do no lock processing).  Ensure that all relations are locked
with some appropriate lock level before being examined --- this ensures
that relevant shared-inval messages have been processed and should prevent
problems caused by concurrent VACUUM.  Fix several bugs having to do with
mismatched increment/decrement of relation ref count and mismatched
heap_open/close (which amounts to the same thing).  A bogus ref count on
a relation doesn't matter much *unless* a SI Inval message happens to
arrive at the wrong time, which is probably why we got away with this
sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
Recommend 'make clean all' after pulling this update; I modified the
Relation struct layout slightly.
Will post further discussion to pghackers list shortly.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Wed Aug 25 23:21:43 1999 UTC (25 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +39 -40 lines
Revise implementation of SubLinks so that there is a consistent,
documented intepretation of the lefthand and oper fields.  Fix a number of
obscure problems while at it --- for example, the old code failed if the parser
decided to insert a type-coercion function just below the operator of a
SubLink.
CAUTION: this will break stored rules that contain subplans.  You may
need to initdb.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sat Jul 17 20:17:37 1999 UTC (25 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +1 -6 lines
 Move some system includes into c.h, and remove duplicates.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Fri Jul 16 04:59:40 1999 UTC (25 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +14 -14 lines
Final cleanup.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Jul 16 03:13:22 1999 UTC (25 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
Update #include cleanups

Revision 1.51: download - view: text, markup, annotated - select for diffs
Thu Jul 15 22:39:43 1999 UTC (25 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +1 -12 lines
Remove unused #includes in *.c files.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Thu Jul 15 15:19:43 1999 UTC (25 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +2 -4 lines
Clean up #include in /include directory.  Add scripts for checking includes.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Tue Jul 13 21:17:35 1999 UTC (25 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +1 -7 lines
Remove S*I comments from Stephan.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sun Jul 11 17:54:30 1999 UTC (25 years, 10 months ago) by tgl
Branches: MAIN
CVS tags: REL6_5
Branch point for: REL6_5_PATCHES
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +9 -6 lines
RewritePreprocessQuery tried to match resjunk targets against
result relation ... wrong ...

Revision 1.47: download - view: text, markup, annotated - select for diffs
Mon Jun 21 01:26:56 1999 UTC (25 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +29 -226 lines
Replace rewriter's checkQueryHasAggs and checkQueryHasSubLink
with expression_tree_walker-based code.  The former failed to cope with
expressions containing SubLinks, and the latter returned TRUE for both
SubLinks and Aggrefs (cut-and-paste bug?).  There is a lot more scope for
using expression_tree_walker in this module, but I'll restrain myself
until the 6.6 split occurs from touching not-demonstrably-broken code.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed May 26 12:55:46 1999 UTC (26 years ago) by momjian
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +14 -9 lines
Make functions static or NOT_USED as appropriate.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Tue May 25 16:10:50 1999 UTC (26 years ago) by momjian
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +1190 -1097 lines
pgindent run over code.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Tue May 25 13:16:10 1999 UTC (26 years ago) by wieck
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +140 -2 lines
Bugfix - Range table entries that are unused after rewriting should
not be marked inFromCl any longer. Otherwise the planner gets confused
and joins over them where in fact it does not have to.

Adjust hasSubLinks now with a recursive lookup - could be wrong in
multi action rules because parse state isn't reset correctly and all
actions in the rule are marked hasSubLinks if one of them has.

Jan

Revision 1.43: download - view: text, markup, annotated - select for diffs
Mon May 17 18:22:19 1999 UTC (26 years ago) by momjian
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +14 -5 lines
Skip junk nodes when comparing UNION target list lengths.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Mon May 17 17:03:38 1999 UTC (26 years ago) by momjian
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +2 -2 lines
Change resjunk to a boolean.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Thu May 13 07:28:41 1999 UTC (26 years ago) by tgl
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +18 -18 lines
Rip out QueryTreeList structure, root and branch.  Querytree
lists are now plain old garden-variety Lists, allocated with palloc,
rather than specialized expansible-array data allocated with malloc.
This substantially simplifies their handling and eliminates several
sources of memory leakage.
Several basic types of erroneous queries (syntax error, attempt to
insert a duplicate key into a unique index) now demonstrably leak
zero bytes per query.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed May 12 17:04:47 1999 UTC (26 years ago) by wieck
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +133 -3 lines
Fixed wrong hasAggs when aggregate columns of view aren't
selected.

Disabled ability of defining DISTINCT or ORDER BY on views.

Jan

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed May 12 15:01:53 1999 UTC (26 years ago) by wieck
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +5 -96 lines
Replaced targetlist entry in GroupClause by reference number
in Resdom and GroupClause so changing of resno's doesn't confuse
the grouping any more.

Jan

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sun May 9 23:31:46 1999 UTC (26 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +54 -9 lines
Rearrange top-level rewrite operations so that EXPLAIN works
on queries involving UNION, EXCEPT, INTERSECT.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Mon Feb 22 05:26:46 1999 UTC (26 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +3 -3 lines
Final optimizer cleanups.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sun Feb 21 03:49:18 1999 UTC (26 years, 3 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +2 -2 lines

From: Tatsuo Ishii <t-ishii@sra.co.jp>

Ok. I made patches replacing all of "#if FALSE" or "#if 0" to "#ifdef
NOT_USED" for current. I have tested these patches in that the
postgres binaries are identical.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sat Feb 13 23:17:47 1999 UTC (26 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +2 -2 lines
Change my-function-name-- to my_function_name, and optimizer renames.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Wed Feb 3 21:17:04 1999 UTC (26 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +3 -5 lines
Cleanup of source files where 'return' or 'var =' is alone on a line.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Feb 2 03:44:45 1999 UTC (26 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +7 -3 lines
Add TEMP tables/indexes.  Add COPY pfree().  Other cleanups.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Mon Jan 25 18:02:20 1999 UTC (26 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +19 -19 lines
Agg/Aggreg cleanup and datetime.sql patch.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Mon Jan 25 12:01:14 1999 UTC (26 years, 4 months ago) by vadim
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +3 -1 lines
SELECT FOR UPDATE is implemented...

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun Jan 24 00:28:30 1999 UTC (26 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +114 -114 lines
Rename Aggreg to Aggref.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Thu Jan 21 16:08:48 1999 UTC (26 years, 4 months ago) by vadim
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +40 -2 lines
FOR UPDATE is in parser & rules.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Jan 18 00:09:54 1999 UTC (26 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +399 -3 lines
Hi!

INTERSECT and EXCEPT is available for postgresql-v6.4!

The patch against v6.4 is included at the end of the current text
(in uuencoded form!)

I also included the text of my Master's Thesis. (a postscript
version). I hope that you find something of it useful and would be
happy if parts of it find their way into the PostgreSQL documentation
project (If so, tell me, then I send the sources of the document!)

The contents of the document are:
  -) The first chapter might be of less interest as it gives only an
     overview on SQL.

  -) The second chapter gives a description on much of PostgreSQL's
     features (like user defined types etc. and how to use these features)

  -) The third chapter starts with an overview of PostgreSQL's internal
     structure with focus on the stages a query has to pass (i.e. parser,
     planner/optimizer, executor). Then a detailed description of the
     implementation of the Having clause and the Intersect/Except logic is
     given.

Originally I worked on v6.3.2 but never found time enough to prepare
and post a patch. Now I applied the changes to v6.4 to get Intersect
and Except working with the new version. Chapter 3 of my documentation
deals with the changes against v6.3.2, so keep that in mind when
comparing the parts of the code printed there with the patched sources
of v6.4.

Here are some remarks on the patch. There are some things that have
still to be done but at the moment I don't have time to do them
myself. (I'm doing my military service at the moment) Sorry for that
:-(

-) I used a rewrite technique for the implementation of the Except/Intersect
   logic which rewrites the query to a semantically equivalent query before
   it is handed to the rewrite system (for views, rules etc.), planner,
   executor etc.

-) In v6.3.2 the types of the attributes of two select statements
   connected by the UNION keyword had to match 100%. In v6.4 the types
   only need to be familiar (i.e. int and float can be mixed). Since this
   feature did not exist when I worked on Intersect/Except it
   does not work correctly for Except/Intersect queries WHEN USED IN
   COMBINATION WITH UNIONS! (i.e. sometimes the wrong type is used for the
   resulting table. This is because until now the types of the attributes of
   the first select statement have been used for the resulting table.
   When Intersects and/or Excepts are used in combination with Unions it
   might happen, that the first select statement of the original query
   appears at another position in the query which will be executed. The reason
   for this is the technique used for the implementation of
   Except/Intersect which does a query rewrite!)
   NOTE: It is NOT broken for pure UNION queries and pure INTERSECT/EXCEPT
         queries!!!

-) I had to add the field intersect_clause to some data structures
   but did not find time to implement printfuncs for the new field.
   This does NOT break the debug modes but when an Except/Intersect
   is used the query debug output will be the already rewritten query.

-) Massive changes to the grammar rules for SELECT and INSERT statements
   have been necessary (see comments in gram.y and documentation for
   deatails) in order to be able to use mixed queries like
   (SELECT ... UNION (SELECT ... EXCEPT SELECT)) INTERSECT SELECT...;

-) When using UNION/EXCEPT/INTERSECT you will get:
   NOTICE: equal: "Don't know if nodes of type xxx are equal".
   I did not have  time to add comparsion support for all the needed nodes,
   but the default behaviour of the function equal met my requirements.
   I did not dare to supress this message!

   That's the reason why the regression test for union will fail: These
   messages are also included in the union.out file!

-) Somebody of you changed the union_planner() function for v6.4
   (I copied the targetlist to new_tlist and that was removed and
   replaced by a cleanup of the original targetlist). These chnages
   violated some having queries executed against views so I changed
   it back again. I did not have time to examine the differences between the
   two versions but now it works :-)
   If you want to find out, try the file queries/view_having.sql on
   both versions and compare the results . Two queries won't produce a
   correct result with your version.

regards

    Stefan

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Dec 14 00:02:16 1998 UTC (26 years, 5 months ago) by thomas
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +93 -1 lines
Add support for the CASE statement in the rewrite handling.
Allows (at least some) rules and views.
Still some trouble (crashes) with target CASE columns spanning tables,
 but lots now works.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Fri Dec 4 15:34:36 1998 UTC (26 years, 6 months ago) by thomas
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +74 -13 lines
Implement CASE expression.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Oct 21 16:21:24 1998 UTC (26 years, 7 months ago) by momjian
Branches: MAIN
CVS tags: REL6_4
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +148 -375 lines
The patch does 2 things:

        Fixes  a  bug  in  the rule system that caused a crashing
        backend when a join-view with calculated column  is  used
        in subselect.

        Modifies  EXPLAIN to explain rewritten queries instead of
        the plain SeqScan on a view. Rules can produce very  deep
MORE

Jan.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Tue Oct 20 17:21:43 1998 UTC (26 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +3 -3 lines
Fix for rules system from Jan.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Fri Oct 2 21:53:39 1998 UTC (26 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +3 -1 lines

    Please apply the patch at the end. Disables use of system
    columns of views at all (not only oid, cmin etc. too).
    pgsql=> select cmin from pg_rules;
    ERROR:  system column cmin not available - pg_rules is a view
    pgsql=> select * from pg_rules where pg_rules.oid = pg_class.oid;
    ERROR:  system column oid not available - pg_rules is a view
    pgsql=>

Jan

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Oct 2 16:27:47 1998 UTC (26 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +2205 -554 lines
    Here's a combination of all the patches I'm currently waiting
    for against a just updated CVS tree. It contains

        Partial new rewrite system that handles subselects,  view
        aggregate  columns, insert into select from view, updates
        with set col = view-value and select rules restriction to
        view definition.

        Updates  for  rule/view  backparsing utility functions to
        handle subselects correct.


        New system views pg_tables and pg_indexes (where you  can
        see the complete index definition in the latter one).

        Enabling array references on query parameters.

        Bugfix for functional index.

        Little changes to system views pg_rules and pg_views.


    The rule system isn't a release-stopper any longer.

    But  another  stopper  is  that  I  don't  know if the latest
    changes to PL/pgSQL (not already in CVS) made it  compile  on
    AIX. Still wait for some response from Dave.

Jan

Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Sep 1 04:31:33 1998 UTC (26 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +123 -111 lines
OK, folks, here is the pgindent output.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Mon Aug 24 01:37:59 1998 UTC (26 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +42 -77 lines
    This  is the final state of the rule system for 6.4 after the
    patch is applied:

	Rewrite rules on relation level work fine now.

	Event qualifications on insert/update/delete  rules  work
	fine now.

	I  added  the  new  keyword  OLD to reference the CURRENT
	tuple. CURRENT will be removed in 6.5.

	Update rules can  reference  NEW  and  OLD  in  the  rule
	qualification and the actions.

	Insert/update/delete rules on views can be established to
	let them behave like real tables.

	For  insert/update/delete  rules  multiple  actions   are
	supported  now.   The  actions  can also be surrounded by
	parantheses to make psql  happy.   Multiple  actions  are
	required if update to a view requires updates to multiple
	tables.

	Regular users  are  permitted  to  create/drop  rules  on
	tables     they     have     RULE     permissions     for
	(DefineQueryRewrite() is  now  able  to  get  around  the
	access  restrictions  on  pg_rewrite).  This enables view
	creation for regular users too. This  required  an  extra
	boolean  parameter  to  pg_parse_and_plan() that tells to
	set skipAcl on all rangetable entries  of  the  resulting
	queries.       There      is      a      new     function
	pg_exec_query_acl_override()  that  could  be   used   by
	backend utilities to use this facility.

	All rule actions (not only views) inherit the permissions
	of the event relations  owner.  Sample:  User  A  creates
	tables    T1    and    T2,   creates   rules   that   log
	INSERT/UPDATE/DELETE on T1 in T2 (like in the  regression
	tests  for rules I created) and grants ALL but RULE on T1
	to user B.  User B  can  now  fully  access  T1  and  the
	logging  happens  in  T2.  But user B cannot access T2 at
	all, only the rule actions can. And due to  missing  RULE
	permissions on T1, user B cannot disable logging.

	Rules  on  the  attribute  level are disabled (they don't
	work properly and since regular users are  now  permitted
	to create rules I decided to disable them).

	Rules  on  select  must have exactly one action that is a
	select (so select rules must be a view definition).

	UPDATE NEW/OLD rules  are  disabled  (still  broken,  but
	triggers can do it).

	There are two new system views (pg_rule and pg_view) that
	show the definition of the rules or views so the db admin
	can  see  what  the  users do. They use two new functions
	pg_get_ruledef() and pg_get_viewdef() that are  builtins.

	The functions pg_get_ruledef() and pg_get_viewdef() could
	be used to implement rule and view support in pg_dump.

	PostgreSQL is now the only database system I  know,  that
	has rewrite rules on the query level. All others (where I
	found a  rule  statement  at  all)  use  stored  database
	procedures  or  the  like  (triggers as we call them) for
	active rules (as some call them).

    Future of the rule system:

	The now disabled parts  of  the  rule  system  (attribute
	level,  multiple  actions on select and update new stuff)
	require a complete new rewrite handler from scratch.  The
	old one is too badly wired up.

	After  6.4  I'll  start to work on a new rewrite handler,
	that fully supports the attribute level  rules,  multiple
	actions on select and update new.  This will be available
	for 6.5 so we get full rewrite rule capabilities.

Jan

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Aug 19 02:02:30 1998 UTC (26 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +4 -2 lines
heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan;
	descriptor; bootstrap can create multi-key indexes;
pg_procname index now is multi-key index; oidint2, oidint4, oidname
are gone (must be removed from regression tests); use System Cache
rather than sequential scan in many places; heap_modifytuple no
longer takes buffer parameter; remove unused buffer parameter in
a few other functions; oid8 is not index-able; remove some use of
single-character variable names; cleanup Buffer variables usage
and scan descriptor looping; cleaned up allocation and freeing of
tuples; 18k lines of diff;

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Aug 18 00:48:59 1998 UTC (26 years, 9 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +227 -27 lines

From: Jan Wieck <jwieck@debis.com>

Hi,

    as  proposed here comes the first patch for the query rewrite
    system.

  <for details, see archive dated Mon, 17 Aug 1998>

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sun Jul 19 05:49:24 1998 UTC (26 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +29 -7 lines
1) Queries using the having clause on base tables should work well
   now. Here some tested features, (examples included in the patch):

1.1) Subselects in the having clause 1.2) Double nested subselects
1.3) Subselects used in the where clause and in the having clause
     simultaneously 1.4) Union Selects using having 1.5) Indexes
on the base relations are used correctly 1.6) Unallowed Queries
are prevented (e.g. qualifications in the
     having clause that belong to the where clause) 1.7) Insert
into as select

2) Queries using the having clause on view relations also work
   but there are some restrictions:

2.1) Create View as Select ... Having ...; using base tables in
the select 2.1.1) The Query rewrite system:

2.1.2) Why are only simple queries allowed against a view from 2.1)
? 2.2) Select ... from testview1, testview2, ... having...; 3) Bug
in ExecMergeJoin ??


Regards Stefan

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Jun 15 19:29:07 1998 UTC (26 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +1 -11 lines
Remove un-needed braces around single statements.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Mon Mar 30 16:36:43 1998 UTC (27 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +8 -3 lines
I started adding the Having Clause and it works quite fine for
sequential scans! (I think it will also work with hash, index, etc
but I did not check it out! I made some High level changes which
should work for all access methods, but maybe I'm wrong. Please
let me know.)

Now it is possible to make queries like:

select s.sname, max(p.pid), min(p.pid) from part p, supplier s
where s.sid=p.sid group by s.sname having max(pid)=6 and min(pid)=1
or avg(pid)=4;

Having does not work yet for queries that contain a subselect
statement in the Having clause, I'll try to fix this in the next
days.

If there are some bugs, please let me know, I'll start to read the
mailinglists now!

Now here is the patch against the original 6.3 version (no snapshot!!):

Stefan

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Feb 26 04:35:16 1998 UTC (27 years, 3 months ago) by momjian
Branches: MAIN
CVS tags: release-6-3
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +44 -48 lines
pgindent run before 6.3 release, with Thomas' requested changes.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Wed Feb 25 13:07:18 1998 UTC (27 years, 3 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +3 -3 lines
From: Jan Wieck <jwieck@debis.com>

    seems  that  my last post didn't make it through. That's good
    since  the  diff  itself  didn't  covered  the  renaming   of
    pg_user.h to pg_shadow.h and it's new content.

    Here  it's  again.  The  complete regression test passwd with
    only some  float  diffs.  createuser  and  destroyuser  work.
    pg_shadow cannot be read by ordinary user.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Feb 21 06:31:57 1998 UTC (27 years, 3 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +104 -6 lines
First step done,

    below  is  the patch to have views to override the permission
    checks for the accessed tables. Now we can do the following:

    CREATE VIEW db_user AS SELECT
         usename,
         usesysid,
         usecreatedb,
         usetrace,
         usecatupd,
         '**********'::text as passwd,
         valuntil
        FROM pg_user;

    REVOKE ALL ON pg_user FROM public;
    REVOKE ALL ON db_user FROM public;
    GRANT SELECT ON db_user TO public;

Revision 1.11: download - view: text, markup, annotated - select for diffs
Wed Jan 21 04:24:36 1998 UTC (27 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +88 -12 lines
Make subqueries rewrite properly.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Jan 9 05:48:17 1998 UTC (27 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +7 -3 lines
Yohoo UNIONS of VIEWS.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Jan 7 21:04:37 1998 UTC (27 years, 5 months ago) by momjian
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +2 -2 lines
Goodbye ABORT.  Hello ERROR for all errors.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon Jan 5 03:32:45 1998 UTC (27 years, 5 months ago) by momjian
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +2 -2 lines
Change elog(WARN) to elog(ERROR) and elog(ABORT).

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Jan 4 04:31:28 1998 UTC (27 years, 5 months ago) by momjian
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -1 lines
Fix for count(*), aggs with views and multiple tables and sum(3).

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Sep 8 21:46:38 1997 UTC (27 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +29 -29 lines
Used modified version of indent that understands over 100 typedefs.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Sep 8 02:28:17 1997 UTC (27 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +93 -93 lines
Another PGINDENT run that changes variable indenting and case label indenting.  Also static variable indenting.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sun Sep 7 04:48:07 1997 UTC (27 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +572 -520 lines
Massive commit to run PGINDENT on all *.c and *.h files.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Aug 12 22:53:41 1997 UTC (27 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +3 -3 lines
Remove more (void) and fix -Wall warnings.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Nov 24 05:58:57 1996 UTC (28 years, 6 months ago) by bryanh
Branches: MAIN
CVS tags: REL2_0B, REL2_0
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +38 -41 lines
Fix access through null pointer info->rule_action.  Thanks Darren King.

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Tue Jul 9 06:21:51 1996 UTC (28 years, 11 months ago) by scrappy
Branches: PG95_DIST
CVS tags: Release_2_0_0, Release_2_0, Release_1_0_3, Release_1_0_2, PG95-1_01
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
Postgres95 1.01 Distribution - Virgin Sources

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jul 9 06:21:51 1996 UTC (28 years, 11 months ago) by scrappy
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

PostgreSQL CVSweb <webmaster@postgresql.org>