[PL/pgSQL] %TYPE and array declaration - second patch

From: Wojciech Muła <wojciech_mula(at)poczta(dot)onet(dot)pl>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PL/pgSQL] %TYPE and array declaration - second patch
Date: 2011-10-23 14:31:48
Message-ID: 20111023163148.3df58163@cat.tac
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Pavel Stehule reviewed my first patch and pointed many
issues - thanks! This patch resolves three problems:

1. The main issue - variables with copied types (%TYPE
and %ROWTYPE attributes) can be declared as arrays.
Grammar has been extended to match new syntax.

2. It's possible to copy type from function argument of
composite type[1].

3. Enabling copying types from wider range of objects,
data type resolution takes into account more cases.
For example it wasn't possible to declare variable
of row type, and then copy type from field of such
variable (something like: declare x table%ROWTYPE;
y x.field%TYPE).

Patch includes new test cases and few words in documentation.

best regards
Wojciech Muła

[1] http://stackoverflow.com/questions/7634704/declare-variable-of-composite-type-in-postgresql-using-type

Attachment Content-Type Size
plpgsql_type_array.patch text/x-patch 60.9 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message thready 2011-10-23 15:17:20 Re: Visual Studio 2010/Windows SDK 7.1 support
Previous Message Thom Brown 2011-10-23 09:00:30 Re: synchronized snapshots