Commit Graph

12581 Commits

Author SHA1 Message Date
Tom Lane a5b370943e Teach query_tree_walker, query_tree_mutator, and SS_finalize_plan to
process function RTE expressions, which they were previously missing.
This allows outer-Var references and subselects to work correctly in
the arguments of a function RTE.  Install check to prevent function RTEs
from cross-referencing Vars of sibling FROM-items, which doesn't make
any sense (if you want to join, write a JOIN or WHERE clause).
2002-05-18 18:49:41 +00:00
Peter Eisentraut 2c50f6344b Revise command completion tags as per hackers message on 20 March. 2002-05-18 15:44:48 +00:00
Peter Eisentraut e8ac187c68 Allow functions to be executed with the privileges of the function owner.
I took the opportunity to remove the pg_proc.proistrusted field.
2002-05-18 13:48:01 +00:00
Tom Lane 51fd22abdd Change set_plan_references and join_references to take an rtable List
rather than a Query node; this allows set_plan_references to recurse
into subplans correctly.  Fixes core dump on full outer joins in
subplans.  Also, invoke preprocess_expression on function RTEs'
function expressions.  This seems to fix the planner's problems with
outer-level Vars in function RTEs.
2002-05-18 02:25:50 +00:00
Tom Lane 0a757154bd Add missing fix_expr_references() step for the funcexpr of a
FunctionScan plan node.
2002-05-18 00:42:55 +00:00
Tom Lane 22d641a7d4 Get rid of the last few uses of typeidTypeName() rather than
format_type_be() in error messages.
2002-05-17 22:35:13 +00:00
Tom Lane 940f772a29 Support temporary setting of search path during CREATE SCHEMA; this
allows the example in the CREATE SCHEMA ref page to actually work now.
Also, clean up when the transaction that initially creates a temp-table
namespace is later aborted.  Simplify internal representation of search
path by folding special cases into the main list.
2002-05-17 20:53:33 +00:00
Tom Lane 5f21560ae8 Dept. of second thoughts: interaction between DoIt and makeDepend
in set_config_option wasn't quite right.  Also clean up a couple other
things that could have been done better.
2002-05-17 20:32:29 +00:00
Peter Eisentraut 94bdc4855c Extend syntax of CREATE FUNCTION to resemble SQL99. 2002-05-17 18:32:52 +00:00
Tom Lane 97f7ceaaa6 Guard against empty-string results from pg_getlocale. 2002-05-17 02:20:26 +00:00
Tom Lane f0811a74b3 Merge the last few variable.c configuration variables into the generic
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.
2002-05-17 01:19:19 +00:00
Tom Lane fa613fa1ea Fix obsolete statement about permissions on COPY ref page, and confusion
about TO/FROM direction in several places.
2002-05-14 18:47:58 +00:00
Tom Lane cbd3b97e5a Remove unnecessary pfree's in geometric operators. At least one of these
is actively dangerous, per bug report from Ewald Geschwinde 14-May-02,
and several of the rest look suspicious to me.  Since there is no longer
any significant value in retail pfree's in these functions, just get
rid of all of them for safety's sake.
2002-05-14 18:16:51 +00:00
Thomas G. Lockhart cc2ce83633 Fix lookup tables used for rounding interval data values when not using
integer datetimes. Thanks to Tom Lane for spotting the problem.
2002-05-14 13:37:27 +00:00
Peter Eisentraut 5c4e5aa3ff Make regression tests locale-proof by setting some locale categories
to C at run-time, and providing alternative output files for different
sort orders.
2002-05-14 13:05:43 +00:00
Tatsuo Ishii cd61650f89 Fix bug in psql.
per report from sugita@sra.co.jp on Thu, 09 May 2002 11:57:51 +0900
(JST) at pgsql-patches list.

Illegal long options to pg_dump makes core on some systems, since it
lacks the last null sentinel of struct option array.

Attached is a patch made by Mr. Ishida Akio <iakio@pjam.jpweb.net>.
2002-05-14 04:20:15 +00:00
Barry Lind e25c93c7eb fixed problem connecting to server with client_min_messages set to debug. The code was not expecting to receive notice messages during the connection handshake. 2002-05-14 03:00:35 +00:00
Tom Lane ef9db25a7e Fix typo in _copyAlterUserSetStmt. 2002-05-13 20:39:43 +00:00
Tom Lane c5741a448e AVG probably shouldn't be upper case here, considering
that we don't upcase the others.
2002-05-13 19:22:06 +00:00
Tom Lane f69bc37be8 Make operators have their own comments separate from those of the
underlying function; but cause psql's \do to show the underlying
function's comment if the operator has no comment of its own, to preserve
the useful functionality of the original behavior.  Also, implement
COMMENT ON SCHEMA.  Patch from Rod Taylor.
2002-05-13 17:45:30 +00:00
Tom Lane 3389a110d4 Get rid of long-since-vestigial Iter node type, in favor of adding a
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.
2002-05-12 23:43:04 +00:00
Tom Lane f9e4f611a1 First pass at set-returning-functions in FROM, by Joe Conway with
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 ...
2002-05-12 20:10:05 +00:00
Tom Lane 71009354c8 Update for additional options in CREATE OPERATOR. 2002-05-11 02:09:41 +00:00
Tom Lane 9b5ca7ee0c Forgot to handle 'opaque' function arguments in regprocedurein/out. 2002-05-11 00:24:16 +00:00
Tom Lane 9f0ae0c820 First pass at schema-fying pg_dump/pg_restore. Much to do still,
but the basic capability seems to work.
2002-05-10 22:36:27 +00:00
Tom Lane 1011fb651d Suppress duplicate logging of utility commands under debug_print_query. 2002-05-10 20:22:13 +00:00
Peter Eisentraut 1944bff1d6 Make initdb print a message about which locale it is about to use.
Re-add warning if the locale prevents LIKE-optimization.  Done within
initdb now.
2002-05-09 13:30:24 +00:00
Hiroshi Inoue 16e22de53a Add a file for version control. 2002-05-09 04:10:22 +00:00
Tom Lane 2822788993 Accept SET SESSION AUTHORIZATION DEFAULT and RESET SESSION AUTHORIZATION
to reset session userid to the originally-authenticated name.  Also,
relax SET SESSION AUTHORIZATION to allow specifying one's own username
even if one is not superuser, so as to avoid unnecessary error messages
when loading a pg_dump file that uses this command.  Per discussion from
several months ago.
2002-05-06 19:47:30 +00:00
Tom Lane 15162aef24 Make dumpACL behave more reasonably for case where owner has revoked
some of his own privileges.
2002-05-06 18:33:45 +00:00
Tom Lane 340b66cc70 Cause fmtId to always use its internal buffer for the returned value,
in hopes of making erroneous usage more apparent.  Per discussion 15-Apr.
2002-05-06 17:34:45 +00:00
Tom Lane 1cf693ab86 Reorder snapshot checks to save a couple comparisons in the common case,
where the tuple's xmin or xmax is older than the snapshot xmin.  There
is no need to check it against snapshot xmax in that case.
2002-05-06 02:39:01 +00:00
Tom Lane 205b5c2f4b A little paranoia never hurt anyone. 2002-05-05 17:50:04 +00:00
Tom Lane c0e9dc1229 plpgsql_dstring_append was broken for long strings. 2002-05-05 17:38:26 +00:00
Tom Lane 846429e3d6 Not needed anymore. 2002-05-05 16:47:09 +00:00
Tom Lane d15c30d327 Add missing includes. 2002-05-05 16:14:24 +00:00
Tom Lane 17ea23dd17 Add a trivial testbed for pg_sema and pg_shmem code. 2002-05-05 16:02:37 +00:00
Tom Lane 2010a43fcb Cope with case that SEM_FAILED is not defined (assume failure code is -1) 2002-05-05 16:01:50 +00:00
Tom Lane 8df5625966 First test of Darwin port with POSIX semaphore code. 2002-05-05 01:03:26 +00:00
Tom Lane 3e48c66136 Fix code to work when isalpha and friends are macros, not functions. 2002-05-05 00:50:31 +00:00
Tom Lane 72a3902a66 Create an internal semaphore API that is not tied to SysV semaphores.
As proof of concept, provide an alternate implementation based on POSIX
semaphores.  Also push the SysV shared-memory implementation into a
separate file so that it can be replaced conveniently.
2002-05-05 00:03:29 +00:00
Tom Lane 91fc10fdac Fix compile errors in CYR_RECODE code, per report from Oliver Elphick. 2002-05-03 20:43:30 +00:00
Tom Lane 90739d4621 Make ruleutils.c schema-aware. Displayed names are schema-qualified
only if they would not be found without qualification given the current
search path, as per idea from Peter Eisentraut.
2002-05-03 20:15:02 +00:00
Tom Lane 1a69a37d5b Fix obsolete comments. 2002-05-03 17:42:11 +00:00
Tom Lane d662f29302 Use quote_identifier on relation names in EXPLAIN output, per suggestion
from Liam Stewart.  Minor code cleanups also.
2002-05-03 15:56:45 +00:00
Tom Lane 4a2fe8e03d Fix typo in usage instructions. 2002-05-03 14:21:38 +00:00
Tom Lane 8338cc03a8 Remove the last traces of datatypes datetime and timespan. 2002-05-03 04:11:08 +00:00
Tom Lane 53cedcac22 Retire xlateSqlType/xlateSqlFunc; all type name translations are now
handled as special productions.  This is needed to keep us honest about
user-schema type names that happen to coincide with system type names.
Per pghackers discussion 24-Apr.  To avoid bloating the keyword list
too much, I removed the translations for datetime, timespan, and lztext,
all of which were slated for destruction several versions back anyway.
2002-05-03 00:32:19 +00:00
Tom Lane c2def1b128 Fix backslash-n typo, per Joe Conway. 2002-05-02 21:44:43 +00:00
Tom Lane 3220fd2138 Tweak scanner/grammar interface so that the keyword-as-identifier rules
in gram.y can make use of the keywords.c string table, instead of having
their own copies of the keyword strings.  This saves a few kilobytes and
more importantly eliminates an opportunity for cut-and-paste errors.
2002-05-02 18:44:11 +00:00