summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-08-15 16:36:08 +0000
committerBruce Momjian <bruce@momjian.us>2002-08-15 16:36:08 +0000
commitb1a5f8720987fbfda23c6bfb4a0dd683b9bdae70 (patch)
tree9212ba16b7941ad741708dd0999beaf3e6948232 /src/test
parent38294db64bce9e78e6a1fc55fb6746074de59d2b (diff)
downloadpostgresql-b1a5f8720987fbfda23c6bfb4a0dd683b9bdae70.tar.gz
Tom Lane wrote:
> 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
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/create_type.out13
-rw-r--r--src/test/regress/sql/create_type.sql12
2 files changed, 25 insertions, 0 deletions
diff --git a/src/test/regress/expected/create_type.out b/src/test/regress/expected/create_type.out
index 06b992280b..68dc8fbd5e 100644
--- a/src/test/regress/expected/create_type.out
+++ b/src/test/regress/expected/create_type.out
@@ -37,4 +37,17 @@ SELECT * FROM default_test;
zippo | 42
(1 row)
+-- Test stand-alone composite type
+CREATE TYPE default_test_row AS (f1 text_w_default, f2 int42);
+CREATE FUNCTION get_default_test() RETURNS SETOF default_test_row AS '
+ SELECT * FROM default_test;
+' LANGUAGE SQL;
+SELECT * FROM get_default_test();
+ f1 | f2
+-------+----
+ zippo | 42
+(1 row)
+
+DROP TYPE default_test_row CASCADE;
+NOTICE: Drop cascades to function get_default_test()
DROP TABLE default_test;
diff --git a/src/test/regress/sql/create_type.sql b/src/test/regress/sql/create_type.sql
index a728bbd8b9..9b37981bd4 100644
--- a/src/test/regress/sql/create_type.sql
+++ b/src/test/regress/sql/create_type.sql
@@ -41,4 +41,16 @@ INSERT INTO default_test DEFAULT VALUES;
SELECT * FROM default_test;
+-- Test stand-alone composite type
+
+CREATE TYPE default_test_row AS (f1 text_w_default, f2 int42);
+
+CREATE FUNCTION get_default_test() RETURNS SETOF default_test_row AS '
+ SELECT * FROM default_test;
+' LANGUAGE SQL;
+
+SELECT * FROM get_default_test();
+
+DROP TYPE default_test_row CASCADE;
+
DROP TABLE default_test;