- 30 Nov, 2002 1 commit
-
-
Tom Lane authored
cost into account while planning.
-
- 25 Nov, 2002 2 commits
-
-
Tom Lane authored
up code and documentation associated with Param nodes.
-
Tom Lane authored
reliance on macros, in hopes of eliminating silly typos (like copying to the wrong field) and just generally making it easier to see the forest instead of the trees. As an example, here is the new code for A_Indices: static A_Indices * _copyAIndices(A_Indices *from) { A_Indices *newnode = makeNode(A_Indices); COPY_NODE_FIELD(lidx); COPY_NODE_FIELD(uidx); return newnode; } static bool _equalAIndices(A_Indices *a, A_Indices *b) { COMPARE_NODE_FIELD(lidx); COMPARE_NODE_FIELD(uidx); return true; } I plan to redo outfuncs/readfuncs in a similar style, but am committing what I've got.
-
- 24 Nov, 2002 1 commit
-
-
Tom Lane authored
joinclauses is determined accurately for each join. Formerly, the code only considered joinclauses that used all of the rels from the outer side of the join; thus for example FROM (a CROSS JOIN b) JOIN c ON (c.f1 = a.x AND c.f2 = b.y) could not exploit a two-column index on c(f1,f2), since neither of the qual clauses would be in the joininfo list it looked in. The new code does this correctly, and also is able to eliminate redundant clauses, thus fixing the problem noted 24-Oct-02 by Hans-Jürgen Schönig.
-
- 23 Nov, 2002 1 commit
-
-
Bruce Momjian authored
-hackers a couple days ago. Notes/caveats: - added regression tests for the new functionality, all regression tests pass on my machine - added pg_dump support - updated PL/PgSQL to support per-statement triggers; didn't look at the other procedural languages. - there's (even) more code duplication in trigger.c than there was previously. Any suggestions on how to refactor the ExecXXXTriggers() functions to reuse more code would be welcome -- I took a brief look at it, but couldn't see an easy way to do it (there are several subtly-different versions of the code in question) - updated the documentation. I also took the liberty of removing a big chunk of duplicated syntax documentation in the Programmer's Guide on triggers, and moving that information to the CREATE TRIGGER reference page. - I also included some spelling fixes and similar small cleanups I noticed while making the changes. If you'd like me to split those into a separate patch, let me know. Neil Conway
-
- 19 Nov, 2002 1 commit
-
-
Tom Lane authored
of groups produced by GROUP BY. This improves the accuracy of planning estimates for grouped subselects, and is needed to check whether a hashed aggregation plan risks memory overflow.
-
- 15 Nov, 2002 1 commit
-
-
Bruce Momjian authored
Rod Taylor
-
- 11 Nov, 2002 1 commit
-
-
Tom Lane authored
before commit, not after :-( --- the original coding is not only unsafe if an error occurs while it's processing, but it generates an invalid sequence of WAL entries. Resurrect 7.2 logic for deleting items when no longer needed. Use an enum instead of random macros. Editorialize on names used for routines and constants. Teach backend/nodes routines about new field in CreateTable struct. Add a regression test.
-
- 06 Nov, 2002 1 commit
-
-
Tom Lane authored
node now does its own grouping of the input rows, and has no need for a preceding GROUP node in the plan pipeline. This allows elimination of the misnamed tuplePerGroup option for GROUP, and actually saves more code in nodeGroup.c than it costs in nodeAgg.c, as well as being presumably faster. Restructure the API of query_planner so that we do not commit to using a sorted or unsorted plan in query_planner; instead grouping_planner makes the decision. (Right now it isn't any smarter than query_planner was, but that will change as soon as it has the option to select a hash- based aggregation step.) Despite all the hackery, no initdb needed since only in-memory node types changed.
-
- 14 Oct, 2002 1 commit
-
-
Tom Lane authored
as per recent pghackers discussions. initdb forced due to change in fields of stored Query nodes.
-
- 22 Sep, 2002 1 commit
-
-
Tom Lane authored
columns, to allow more correct behavior in multiple-inheritance cases. Patch by Alvaro Herrera, review by Tom Lane.
-
- 18 Sep, 2002 1 commit
-
-
Tom Lane authored
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.
-
- 02 Sep, 2002 1 commit
-
-
Tom Lane authored
Gavin Sherry, Neil Conway, and Tom Lane all got their hands dirty on this one ...
-
- 31 Aug, 2002 1 commit
-
-
Tom Lane authored
type for runtime constraint checks, instead of misusing the parse-time Constraint node for the purpose. Fix some damage introduced into type coercion logic; in particular ensure that a coerced expression tree will read out the correct result type when inspected (patch had broken some RelabelType cases). Enforce domain NOT NULL constraints against columns that are omitted from an INSERT.
-
- 30 Aug, 2002 1 commit
-
-
Tom Lane authored
column additions, deletions, and renames that would let a child table get out of sync with its parent. Patch by Alvaro Herrera, with some kibitzing by Tom Lane.
-
- 27 Aug, 2002 1 commit
-
-
Tom Lane authored
from Tom Lane.
-
- 26 Aug, 2002 1 commit
-
-
Tom Lane authored
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.
-
- 19 Aug, 2002 3 commits
-
-
Tom Lane authored
latent wrong-struct-type bugs and makes the coding style more uniform, since the majority of places working with lists of column names were already using Strings not Idents. While at it, remove vestigial support for Stream node type, and otherwise-unreferenced nodes.h entries for T_TupleCount and T_BaseNode. NB: full recompile is recommended due to changes of Node type numbers. This shouldn't force an initdb though.
-
Tom Lane authored
required changes to copyfuncs/equalfuncs.
-
Tom Lane authored
been missing forever; surprising it wasn't noticed before. The other additions are, um, sloppiness in certain recent feature additions.
-
- 15 Aug, 2002 1 commit
-
-
Bruce Momjian authored
> There's no longer a separate call to heap_storage_create in that routine > --- the right place to make the test is now in the storage_create > boolean parameter being passed to heap_create. A simple change, but > it passeth patch's understanding ... Thanks. Attached is a patch against cvs tip as of 8:30 PM PST or so. Turned out that even after fixing the failed hunks, there was a new spot in bufmgr.c which needed to be fixed (related to temp relations; RelationUpdateNumberOfBlocks). But thankfully the regression test code caught it :-) Joe Conway
-
- 04 Aug, 2002 4 commits
-
-
Tom Lane authored
-
Bruce Momjian authored
-
Bruce Momjian authored
types for Table Functions, as previously proposed on HACKERS. Here is a brief explanation: 1. Creates a new pg_type typtype: 'p' for pseudo type (currently either 'b' for base or 'c' for catalog, i.e. a class). 2. Creates new builtin type of typtype='p' named RECORD. This is the first of potentially several pseudo types. 3. Modify FROM clause grammer to accept: SELECT * FROM my_func() AS m(colname1 type1, colname2 type1, ...) where m is the table alias, colname1, etc are the column names, and type1, etc are the column types. 4. When typtype == 'p' and the function return type is RECORD, a list of column defs is required, and when typtype != 'p', it is disallowed. 5. A check was added to ensure that the tupdesc provide via the parser and the actual return tupdesc match in number and type of attributes. When creating a function you can do: CREATE FUNCTION foo(text) RETURNS setof RECORD ... When using it you can do: SELECT * from foo(sqlstmt) AS (f1 int, f2 text, f3 timestamp) or SELECT * from foo(sqlstmt) AS f(f1 int, f2 text, f3 timestamp) or SELECT * from foo(sqlstmt) f(f1 int, f2 text, f3 timestamp) Included in the patches are adjustments to the regression test sql and expected files, and documentation. p.s. This potentially solves (or at least improves) the issue of builtin Table Functions. They can be bootstrapped as returning RECORD, and we can wrap system views around them with properly specified column defs. For example: CREATE VIEW pg_settings AS SELECT s.name, s.setting FROM show_all_settings()AS s(name text, setting text); Then we can also add the UPDATE RULE that I previously posted to pg_settings, and have pg_settings act like a virtual table, allowing settings to be queried and set. Joe Conway
-
Bruce Momjian authored
functionality of the command is basically identical to that of BEGIN; it just accepts a few extra options (only one of which PostgreSQL currently implements), and is standards-compliant. The patch includes a simple regression test and documentation. [ Regression tests removed, per Peter.] Neil Conway
-
- 29 Jul, 2002 1 commit
-
-
Tom Lane authored
documentation (xindex.sgml should be rewritten), need to teach pg_dump about it, need to update contrib modules that currently build pg_opclass entries by hand. Original patch by Bill Studenmund, grammar adjustments and general update for 7.3 by Tom Lane.
-
- 24 Jul, 2002 1 commit
-
-
Peter Eisentraut authored
pg_language.lancompiler pg_operator.oprprec pg_operator.oprisleft pg_proc.proimplicit pg_proc.probyte_pct pg_proc.properbyte_cpu pg_proc.propercall_cpu pg_proc.prooutin_ratio pg_shadow.usetrace pg_type.typprtlen pg_type.typreceive pg_type.typsend Attempts to use the obsoleted attributes of pg_operator or pg_proc in the CREATE commands will be greeted by a warning. For pg_type, there is no warning (yet) because pg_dump scripts still contain these attributes. Also remove new but already obsolete spellings isVolatile, isStable, isImmutable in WITH clause. (Use new syntax instead.)
-
- 18 Jul, 2002 2 commits
-
-
Bruce Momjian authored
-
Bruce Momjian authored
Implements between (symmetric / asymmetric) as a node. Executes the left or right expression once, makes a Const out of the resulting Datum and executes the >=, <= portions out of the Const sets. Of course, the parser does a fair amount of preparatory work for this to happen. Rod Taylor
-
- 16 Jul, 2002 1 commit
-
-
Tom Lane authored
functionality. Of note: dropping a table that has a SERIAL column defined now drops the associated sequence automatically.
-
- 12 Jul, 2002 1 commit
-
-
Tom Lane authored
pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY constraints all have real live entries in pg_constraint. pg_depend exists, and RESTRICT/CASCADE options work on most kinds of DROP; however, pg_depend is not yet very well populated with dependencies. (Most of the ones that are present at this point just replace formerly hardwired associations, such as the implicit drop of a relation's pg_type entry when the relation is dropped.) Need to add more logic to create dependency entries, improve pg_dump to dump constraints in place of indexes and triggers, and add some regression tests.
-
- 01 Jul, 2002 1 commit
-
-
Tom Lane authored
RESTRICT/CASCADE syntax to the DROP commands that need it, and propagates the behavioral option through the parser to the routines that execute drops. Doesn't do anything useful yet, but I figured I'd commit these changes so I could get out of the parser area while working on the rest.
-
- 20 Jun, 2002 2 commits
-
-
Bruce Momjian authored
-
Bruce Momjian authored
-
- 18 Jun, 2002 1 commit
-
-
Bruce Momjian authored
members in gram.y. This is the prefered method for WITH and arbitrary param/value pairs.
-
- 22 May, 2002 1 commit
-
-
Peter Eisentraut authored
function body (and other properties) as a function in the language is created. This generalizes ad hoc code that already existed for the built-in languages. The validation now happens after the pg_proc tuple of the new function is created, so it is possible to define recursive SQL functions. Add some regression test cases that cover bogus function definition attempts.
-
- 17 May, 2002 2 commits
-
-
Peter Eisentraut authored
-
Tom Lane authored
GUC support. It's now possible to set datestyle, timezone, and client_encoding from postgresql.conf and per-database or per-user settings. Also, implement rollback of SET commands that occur in a transaction that later fails. Create a SET LOCAL var = value syntax that sets the variable only for the duration of the current transaction. All per previous discussions in pghackers.
-
- 12 May, 2002 2 commits
-
-
Tom Lane authored
returns-set boolean field in Func and Oper nodes. This allows cleaner, more reliable tests for expressions returning sets in the planner and parser. For example, a WHERE clause returning a set is now detected and complained of in the parser, not only at runtime.
-
Tom Lane authored
some kibitzing from Tom Lane. Not everything works yet, and there's no documentation or regression test, but let's commit this so Joe doesn't need to cope with tracking changes in so many files ...
-