Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]
От | Josh Berkus |
---|---|
Тема | Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW] |
Дата | |
Msg-id | 4AB12326.5080109@agliodbs.com обсуждение исходный текст |
Ответ на | Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW] (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]
Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW] |
Список | pgsql-hackers |
> IIRC the original complaint was from someone trying to migrate code > from T/SQL or some other not-quite-PLSQL language. Like you, I'm on > the fence about whether to accept this patch, but it does have some > in-migration rationale. As someone who writes a lot of plpgsql, I'm in favor of the patch. 1. Compatibility with PL/SQL, especially in the extra features direction, has never been a tremendous priority for us before; 2. We don't particularly care if native plpgsql procedures can be back-ported to PLSQL, and if we did there are much greater compatibility issues than this one; 3. This patch eliminates a common plpgsql beginner error and saves all of us heavy plpgsql users some typing, especially when the use of a mutable variable means that we can eliminate the DECLARE section entirely, as in: This: CREATE PROCEDURE mod ( x int, y int ) RETURNS int LANGUAGE plpgsql AS $f$ DECLAREz INT := x; BEGINz := x % y;RETURN z; END; $f$ Becomes this: CREATE PROCEDURE mod ( x int, y int ) RETURNS int LANGUAGE plpgsql AS $f$ BEGINx := x % y;RETURN x; END; $f$ -- Josh Berkus PostgreSQL Experts Inc. www.pgexperts.com
В списке pgsql-hackers по дате отправления: