summaryrefslogtreecommitdiff
path: root/src/backend/parser
AgeCommit message (Collapse)Author
2006-01-31Allow %TYPE to be used with SETOF, per gripe from Murat Tasan.Tom Lane
2006-01-17Repair problems with the result of lookup_rowtype_tupdesc() possibly beingTom Lane
discarded by cache flush while still in use. This is a minimal patch that just copies the tupdesc anywhere it could be needed across a flush. Applied to back branches only; Neil Conway is working on a better long-term solution for HEAD.
2006-01-12We neglected to apply domain constraints on UNKNOWN parameters toNeil Conway
prepared statements, per report from David Wheeler.
2006-01-10Improve error messages for missing-FROM-entry cases, as per recent discussion.Tom Lane
2005-11-22Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian
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.
2005-11-18Fix performance issue in exprTypmod(): for a COALESCE expression, itTom Lane
recursed twice on its first argument, leading to exponential time spent on a deep nest of COALESCEs ... such as a deeply nested FULL JOIN would produce. Per report from Matt Carter.
2005-11-13Force the second argument of SUBSTRING(foo FOR bar) to be int4, to avoidTom Lane
surprising results when it's some other numeric type. This doesn't solve the generic problem of surprising implicit casts to text, but it's a low-impact way of making sure this particular case behaves sanely. Per gripe from Harald Fuchs and subsequent discussion.
2005-10-26Adjust parser so that POSTQUEL-style implicit RTEs are stored withTom Lane
inFromCl true, meaning that they will list out as explicit RTEs if they are in a view or rule. Update comments about inFromCl to reflect the way it's now actually used. Per recent discussion.
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-10-06When a function not returning RECORD has a single OUT parameter, useTom Lane
the parameter's name (if any) as the default column name for SELECT FROM the function, rather than the function name as previously. I still think this is a bad idea, but I lost the argument. Force decompilation of function RTEs to specify full aliases always, to reduce the odds of this decision breaking dumped views.
2005-10-02Change nextval and other sequence functions to specify their sequenceTom Lane
argument as a 'regclass' value instead of a text string. The frontend conversion of text string to pg_class OID is now encapsulated as an implicitly-invocable coercion from text to regclass. This provides backwards compatibility to the old behavior when the sequence argument is explicitly typed as 'text'. When the argument is just an unadorned literal string, it will be taken as 'regclass', which means that the stored representation will be an OID. This solves longstanding problems with renaming sequences that are referenced in default expressions, as well as new-in-8.1 problems with renaming such sequences' schemas or moving them to another schema. All per recent discussion. Along the way, fix some rather serious problems in dbmirror's support for mirroring sequence operations (int4 vs int8 confusion for instance).
2005-09-23Add comments explaining clauses used by CREATE ROLE but not ALTER.Bruce Momjian
2005-09-05Implement a preliminary 'template' facility for procedural languages,Tom Lane
as per my recent proposal. For now the template data is hard-wired in proclang.c --- this should be replaced later by a new shared system catalog, but we don't want to force initdb during 8.1 beta. This change lets us cleanly load existing dump files even if they contain outright wrong information about a PL's support functions, such as a wrong path to the shared library or a missing validator function. Also, we can revert the recent kluges to make pg_dump dump PL support functions that are stored in pg_catalog. While at it, I removed the code in pg_regress that replaced $libdir with a hardcoded path for temporary installations. This is no longer needed given our support for relocatable installations.
2005-08-24Fix SHOW and RESET grammar to accept custom variable names.Tom Lane
2005-08-23Add ALTER TABLE ENABLE/DISABLE TRIGGER commands. Change pg_dump toTom Lane
use these instead of its previous hack of changing pg_class.reltriggers. Documentation is lacking, will add that later. Patch by Satoshi Nagayasu, review and some extra work by Tom Lane.
2005-08-16Reject operator names >= NAMEDATALEN characters. These will not workTom Lane
anyway, and in assert-enabled builds you are likely to get an assertion failure. Backpatch as far as 7.3; 7.2 seems not to have the problem.
2005-08-01Add NOWAIT option to SELECT FOR UPDATE/SHARE.Tom Lane
Original patch by Hans-Juergen Schoenig, revisions by Karel Zak and Tom Lane.
2005-08-01Add ALTER object SET SCHEMA capability for a limited but useful set ofTom Lane
object kinds (tables, functions, types). Documentation is not here yet. Original code by Bernd Helmle, extensive rework by Bruce Momjian and Tom Lane.
2005-07-31Add per-user and per-database connection limit options.Tom Lane
This patch also includes preliminary update of pg_dumpall for roles. Petr Jelinek, with review by Bruce Momjian and Tom Lane.
2005-07-28Make use of new list primitives list_append_unique and list_concat_uniqueTom Lane
where applicable.
2005-07-26Minor correction: cause ALTER ROLE role ROLE rolenames to behaveTom Lane
sensibly, even though we don't document it.
2005-07-26Add a role property 'rolinherit' which, when false, denotes that the roleTom Lane
doesn't automatically inherit the privileges of roles it is a member of; for such a role, membership in another role can be exploited only by doing explicit SET ROLE. The default inherit setting is TRUE, so by default the behavior doesn't change, but creating a user with NOINHERIT gives closer adherence to our current reading of SQL99. Documentation still lacking, and I think the information schema needs another look.
2005-07-25Add SET ROLE. This is a partial commit of Stephen Frost's recent patch;Tom Lane
I'm still working on the has_role function and information_schema changes.
2005-06-29More cleanup on roles patch. Allow admin option to be inherited throughTom Lane
role memberships; make superuser/createrole distinction do something useful; fix some locking and CommandCounterIncrement issues; prevent creation of loops in the membership graph.
2005-06-28Bring syntax of role-related commands into SQL compliance. To avoidTom Lane
syntactic conflicts, both privilege and role GRANT/REVOKE commands have to use the same production for scanning the list of tokens that might eventually turn out to be privileges or role names. So, change the existing GRANT/REVOKE code to expect a list of strings not pre-reduced AclMode values. Fix a couple other minor issues while at it, such as InitializeAcl function name conflicting with a Windows system function.
2005-06-28Replace pg_shadow and pg_group by new role-capable catalogs pg_authidTom Lane
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.
2005-06-26Add Oracle-compatible GREATEST and LEAST functions. Pavel StehuleTom Lane
2005-06-26Code review for escape-strings patch. Sync psql and plpgsql lexersTom Lane
with main, avoid using a SQL-defined SQLSTATE for what is most definitely not a SQL-compatible error condition, fix documentation omissions, adhere to message style guidelines, don't use two GUC_REPORT variables when one is sufficient. Nothing done about pg_dump issues.
2005-06-26Add E'' syntax so eventually normal strings can treat backslashesBruce Momjian
literally. Add GUC variables: "escape_string_warning" - warn about backslashes in non-E strings "escape_string_syntax" - supports E'' syntax? "standard_compliant_strings" - treats backslashes literally in '' Update code to use E'' when escapes are used.
2005-06-24Remove overspecification of precision of CURRENT_TIMESTAMP, LOCALTIMESTAMP,Tom Lane
CURRENT_TIME, and LOCALTIME: now they just produce "timestamptz" not "timestamptz(6)", etc. This makes the behavior more consistent with our choice to not assign a specific default precision to column datatypes. It should also save a few cycles at runtime due to not having to invoke the round-to-given-precision functions. I also took the opportunity to translate CURRENT_TIMESTAMP into "now()" instead of an invocation of the timestamptz input converter --- this should save a few cycles too.
2005-06-22Make REINDEX DATABASE do what one would expect, namely reindex all indexesTom Lane
in the database. The old behavior (reindex system catalogs only) is now available as REINDEX SYSTEM. I did not add the complementary REINDEX USER case since there did not seem to be consensus for this, but it would be trivial to add later. Per recent discussions.
2005-06-22Add a hack requested by the JDBC driver writers: when a function'sTom Lane
argument list contains parameter symbols ($n) declared as type VOID, discard these arguments. This allows the driver to avoid renumbering mixed IN and OUT argument placeholders (the JDBC syntax involves writing ? for both IN and OUT parameters, but on the server side we don't think that OUT parameters are arguments). This doesn't break any currently- useful cases since VOID is not used as an input argument type.
2005-06-17Two-phase commit. Original patch by Heikki Linnakangas, with additionalTom Lane
hacking by Alvaro Herrera and Tom Lane.
2005-06-15Move SYMMETRIC/ASYMMETRIC to reserved words to avoid shift/reduce conflicts.Bruce Momjian
2005-06-15Improve comment wording.Bruce Momjian
2005-06-14Add BETWEEN SYMMETRIC.Bruce Momjian
Pavel Stehule
2005-06-08Remove grammar productions for prefix and postfix % and ^ operators,Tom Lane
as well as the existing pg_catalog entries for prefix and postfix %. These have never been documented, though they did appear in one old regression test. This avoids surprising behavior in cases like "SELECT -25 % -10". Per recent discussion. Note: although there is a catalog change here, I did not force initdb since there's no harm in leaving the inaccessible entries in one's copy of pg_operator.
2005-06-05Remove planner's private fields from Query struct, and put them intoTom Lane
a new PlannerInfo struct, which is passed around instead of the bare Query in all the planning code. This commit is essentially just a code-beautification exercise, but it does open the door to making larger changes to the planner data structures without having to muck with the widely-known Query struct.
2005-06-05Replace the parser's namespace tree (which formerly had the sameTom Lane
representation as the jointree) with two lists of RTEs, one showing the RTEs accessible by qualified names, and the other showing the RTEs accessible by unqualified names. I think this is conceptually simpler than what we did before, and it's sure a whole lot easier to search. This seems to eliminate the parse-time bottleneck for deeply nested JOIN structures that was exhibited by phil@vodafone.
2005-06-04Add comment for multi-byte computation.Bruce Momjian
2005-06-04Change expandRTE() and ResolveNew() back to taking just the singleTom Lane
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.
2005-06-03Revise handling of dropped columns in JOIN alias lists to avoid aTom Lane
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.)
2005-06-02The no-lexer-backup speedup hadn't been there a week before somebodyTom Lane
broke it. Maybe we do need an automated check ...
2005-06-02Add support for \x hex escapes in backend strings. Octal was alreadyBruce Momjian
supported. This follows the C standard escapes.
2005-05-31ParseComplexProjection should make use of expandRecordVariable so thatTom Lane
it can handle cases like (foo.x).y where foo is a subquery and x is a function-returning-RECORD RTE in that subquery.
2005-05-30Change the UNKNOWN type to have an internal representation matchingTom Lane
cstring, rather than text, so as to eliminate useless conversions inside the parser. Per recent discussion.
2005-05-29Remove typeidIsValid() checks in can_coerce_type(). These checksTom Lane
were pretty expensive and I believe the case they were put in to defend against can no longer arise, now that we have dependency checks to prevent deletion of a type entry that is still referenced. Certainly the example given in the CVS log entry can't happen anymore. Since this was the only use of typeidIsValid(), remove the routine too.
2005-05-29expandRTE and get_rte_attribute_type mistakenly always imputed typmod -1Tom Lane
to columns of an RTE that was a function returning RECORD with a column definition list. Apparently no one has tried to use non-default typmod with a function returning RECORD before.
2005-05-26Tweak the backend scanner (and psqlscan.l, which must track the backendTom Lane
scanner anyway) to avoid having any backup states. According to the flex manual, this should speed things up, and indeed the backend scanner is about a third faster according to some quick profiling checks. I haven't tried to measure the speed change in psql, but it probably is similar.
2005-05-24Inserting 5 characters into char(10) does not produce 5 padding spacesTatsuo Ishii
if they are two-byte multibyte characters. Same thing can be happen if octet_length(multibyte_chars) == n where n is char(n). Long standing bug since 7.3 days. Per report and fix from Yoshiyuki Asaba.