| Commit message (Collapse) | Author | Age |
|
|
|
| |
to a join or subselect alias ... cf. Oliver Elphick's complaint 13-Mar.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vacuum analyze on pg_type fails if bogus entries remain in pg_operator.
Here is a sample script to reproduce the problem.
drop table t1;
create table t1(i int);
drop function foo(t1,t1);
create function foo(t1,t1) returns bool as 'select true' language 'sql';
create operator = (
leftarg = t1,
rightarg = t1,
commutator = =,
procedure = foo
);
drop table t1;
vacuum analyze;
|
|
|
|
|
|
|
| |
in Turkish locale. Keywords are now checked under pure ASCII case-folding
rules ('A'-'Z'->'a'-'z' and nothing else). However, once a word is
determined not to be a keyword, it will be case-folded under the current
locale, same as before. See pghackers discussion 20-Feb-01.
|
|
|
|
| |
the ones specified by SQL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. If there is exactly one pg_operator entry of the right name and oprkind,
oper() and related routines would return that entry whether its input type
had anything to do with the request or not. This is just premature
optimization: we shouldn't return the single candidate until after we verify
that it really is a valid candidate, ie, is at least coercion-compatible
with the given types.
2. oper() and related routines only promise a coercion-compatible result.
Unfortunately, there were quite a few callers that assumed the returned
operator is binary-compatible with the given datatype; they would proceed
to call it without making any datatype coercions. These callers include
sorting, grouping, aggregation, and VACUUM ANALYZE. In general I think
it is appropriate for these callers to require an exact or binary-compatible
match, so I've added a new routine compatible_oper() that only succeeds if
it can find an operator that doesn't require any run-time conversions.
Callers now call oper() or compatible_oper() depending on whether they are
prepared to deal with type conversion or not.
The upshot of these bugs is revealed by the following silliness in PL/Tcl's
selftest: it creates an operator @< on int4, and then tries to use it to
sort a char(N) column. The system would let it do that :-( (and evidently
has done so since 6.3 :-( :-(). The result in this case was just a silly
sort order, but the reverse combination would've provoked coredump from
trying to dereference integers. With this fix you get more reasonable
behavior:
pltcl_test=# select * from T_pkey1 order by key1, key2 using @<;
ERROR: Unable to identify an operator '@<' for types 'bpchar' and 'bpchar'
You will have to retype this query using an explicit cast
|
|
|
|
|
|
|
|
|
|
| |
such as
SELECT f1 FROM foo UNION SELECT ... ORDER BY upper(f1)
to draw
'ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of the result columns'
rather than the uninformative 'f1 not found' we were producing before.
Eventually this should actually work, but that looks much too hard to try
to implement in late beta...
|
|
|
|
| |
specifies redundant UNIQUE conditions.
|
|
|
|
|
|
|
|
|
| |
clause with an alias is a <subquery> and therefore hides table references
appearing within it, according to the spec. This is the same as the
preliminary patch I posted to pgsql-patches yesterday, plus some really
grotty code in ruleutils.c to reverse-list a query tree with the correct
alias name depending on context. I'd rather not have done that, but unless
we want to force another initdb for 7.1, there's no other way for now.
|
|
|
|
|
| |
When no suitable YACC is configured, supply useful informational messages
to users. (Same way flex has been handled for a while.)
|
|
|
|
|
| |
is clearly not maintainable, so dike it out in favor of calling the real
version in the backend's gram.y.
|
| |
|
|
|
|
| |
table.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Op, so that the sequence 'a_expr Op Op a_expr' will be parsed as
a_expr Op (Op a_expr) not (a_expr Op) Op a_expr as formerly. In other
words, prefer treating user-defined operators as prefix operators to
treating them as postfix operators, when there is an ambiguity.
Also clean up a couple of other infelicities in production priority
assignment --- for example, BETWEEN wasn't being given the intended
priority, but that of AND.
|
|
|
|
|
|
| |
attributes in a FieldSelect node --- all the places that manipulate
these work just fine with system attribute numbers. OK, it's a new
feature, so shoot me ...
|
|
|
|
| |
namely omitting the alias clause for a sub-SELECT in FROM.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I hope. I finally realized that we were going at it backwards: when
there are excess parentheses, they need to be treated as part of the
sub-SELECT, not as part of the surrounding expression. Although either
choice yields an unambiguous grammar, only this way produces a grammar
that is LALR(1). With the old approach we were guaranteed to fail on
either 'SELECT (((SELECT 2)) + 3)' or
'SELECT (((SELECT 2)) UNION SELECT 2)' depending on which way we
resolve the initial shift/reduce conflict. With the new way, the same
reduction track can be followed in both cases until we have advanced
far enough to know whether we are done with the sub-SELECT or not.
|
| |
|
|
|
|
|
| |
no longer the case). Add AND and TRAILING to ColLabel. All key words
except AS are now at least ColLabel's.
|
|
|
|
|
|
|
|
|
|
|
| |
and revert documentation to describe the existing INHERITS clause
instead, per recent discussion in pghackers. Also fix implementation
of SQL_inheritance SET variable: it is not cool to look at this var
during the initial parsing phase, only during parse_analyze(). See
recent bug report concerning misinterpretation of date constants just
after a SET TIMEZONE command. gram.y really has to be an invariant
transformation of the query string to a raw parsetree; anything that
can vary with time must be done during parse analysis.
|
|
|
|
|
|
|
|
|
|
| |
1. Distinguish cases where a Datum representing a tuple datatype is an OID
from cases where it is a pointer to TupleTableSlot, and make sure we use
the right typlen in each case.
2. Make fetchatt() and related code support 8-byte by-value datatypes on
machines where Datum is 8 bytes. Centralize knowledge of the available
by-value datatype sizes in two macros in tupmacs.h, so that this will be
easier if we ever have to do it again.
|
|
|
|
| |
will not accept types named with operator names or vice versa.
|
|
|
|
| |
inherited column, per bug report from Elphick 12/15/00.
|
|
|
|
|
| |
types in a category --- it was taking the last preferred type among the
inputs, rather than the first one as intended.
|
| |
|
|
|
|
| |
insensitive to the order of arguments. Per pghackers discussion 12/10/00.
|
| |
|
|
|
|
|
| |
It could be recursing into a sub-query where there was already a FOR
UPDATE clause.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
I believe this should fix the issue that Philip Warner
noticed about the check for unique constraints meeting the
referenced keys of a foreign key constraint allowing the
specification of a subset of a foreign key instead of
rejecting it. I also added tests for a base case of
this to the foreign key and alter table tests and patches
for expected output.
|
|
|
|
|
|
|
|
|
|
|
| |
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 :-(
|
|
|
|
|
| |
values, whether the local char type is signed or not. This is necessary
for portability. Per discussion on pghackers around 9/16/00.
|
|
|
|
|
|
|
|
| |
Allow some operator-like tokens to be used as function names.
Flesh out support for time, timetz, and interval operators
and interactions.
Regression tests pass, but non-reference-platform horology test results
will need to be updated.
|
|
|
|
|
| |
non-standard clauses. Allow CHARACTERISTICS as unquoted identifier.
Merge related reference pages.
|
| |
|
|
|
|
| |
function calls to work.
|
|
|
|
| |
wise the next bit string in the same command clobbers the previous ones.
|
|
|
|
|
|
|
| |
maintained for each cache entry. A cache entry will not be freed until
the matching ReleaseSysCache call has been executed. This eliminates
worries about cache entries getting dropped while still in use. See
my posting to pg-hackers of even date for more info.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
cloned, rather than always cloning template1. Modify initdb to generate
two identical databases rather than one, template0 and template1.
Connections to template0 are disallowed, so that it will always remain
in its virgin as-initdb'd state. pg_dumpall now dumps databases with
restore commands that say CREATE DATABASE foo WITH TEMPLATE = template0.
This allows proper behavior when there is user-added data in template1.
initdb forced!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
joins, and clean things up a good deal at the same time. Append plan node
no longer hacks on rangetable at runtime --- instead, all child tables are
given their own RT entries during planning. Concept of multiple target
tables pushed up into execMain, replacing bug-prone implementation within
nodeAppend. Planner now supports generating Append plans for inheritance
sets either at the top of the plan (the old way) or at the bottom. Expanding
at the bottom is appropriate for tables used as sources, since they may
appear inside an outer join; but we must still expand at the top when the
target of an UPDATE or DELETE is an inheritance set, because we actually need
a different targetlist and junkfilter for each target table in that case.
Fortunately a target table can't be inside an outer join... Bizarre mutual
recursion between union_planner and prepunion.c is gone --- in fact,
union_planner doesn't really have much to do with union queries anymore,
so I renamed it grouping_planner.
|
|
|
|
|
| |
"best choice" type category when resolving UNKNOWN function and operator
arguments. Thanks to Tom Lane for finding test case.
|
|
|
|
| |
to resolve the unknown constants as type TEXT.
|
|
|
|
|
|
|
|
|
| |
(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.
|
| |
|
|
|
|
|
|
|
| |
Same code exactly as for function resolution.
An obvious example is for
select '1' = '01';
which used to throw an error and which now resolves to two text strings.
|
|
|
|
| |
AT is now a keyword but is not a reserved word.
|
|
|
|
|
|
|
| |
any available string type. Previously, all candidate choices must have
fallen within the same "type category" for PostgreSQL to be willing to
choose any of them.
Need to apply the same fixup to operator type resolution.
|