Skip to content

Commit 457ad39

Browse files
committed
Add a more useful error message for the case where someone tries to pass
a whole row or record variable into a SQL function. Eventually this case should be made to actually work, but for now this is better than what it did before.
1 parent 8899a2a commit 457ad39

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

src/pl/plpgsql/src/gram.y

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* procedural language
55
*
66
* IDENTIFICATION
7-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.51 2004/02/25 18:10:51 tgl Exp $
7+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.52 2004/03/24 23:38:49 tgl Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -1660,6 +1660,20 @@ read_sql_construct(int until,
16601660
plpgsql_dstring_append(&ds, buf);
16611661
break;
16621662

1663+
case T_ROW:
1664+
/* XXX make this work someday */
1665+
ereport(ERROR,
1666+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1667+
errmsg("passing a whole row variable into a SQL command is not implemented")));
1668+
break;
1669+
1670+
case T_RECORD:
1671+
/* XXX make this work someday */
1672+
ereport(ERROR,
1673+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1674+
errmsg("passing a whole record variable into a SQL command is not implemented")));
1675+
break;
1676+
16631677
default:
16641678
plpgsql_dstring_append(&ds, yytext);
16651679
break;
@@ -1867,6 +1881,20 @@ make_select_stmt(void)
18671881
plpgsql_dstring_append(&ds, buf);
18681882
break;
18691883

1884+
case T_ROW:
1885+
/* XXX make this work someday */
1886+
ereport(ERROR,
1887+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1888+
errmsg("passing a whole row variable into a SQL command is not implemented")));
1889+
break;
1890+
1891+
case T_RECORD:
1892+
/* XXX make this work someday */
1893+
ereport(ERROR,
1894+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1895+
errmsg("passing a whole record variable into a SQL command is not implemented")));
1896+
break;
1897+
18701898
default:
18711899
plpgsql_dstring_append(&ds, yytext);
18721900
break;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy