aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/complex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tutorial/complex.c')
-rw-r--r--src/tutorial/complex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tutorial/complex.c b/src/tutorial/complex.c
index b95baa2be0e..c8d4cbe320f 100644
--- a/src/tutorial/complex.c
+++ b/src/tutorial/complex.c
@@ -38,10 +38,10 @@ complex_in(char *str)
Complex *result;
if (sscanf(str, " ( %lf , %lf )", &x, &y) != 2)
- {
- elog(ERROR, "complex_in: error in parsing \"%s\"", str);
- return NULL;
- }
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
+ errmsg("invalid input syntax for complex: \"%s\"", str)));
+
result = (Complex *) palloc(sizeof(Complex));
result->x = x;
result->y = y;