aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/complex.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-07-27 17:10:07 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-07-27 17:10:07 +0000
commite8db9b26d03b9e58a30eb26ec2ee21c92293d3a2 (patch)
treec2adf83074db369ea5211b06e5181ebabf1a61d8 /src/tutorial/complex.c
parentaeea73d4eceb9b33ff16a69c77bd923a0394a6d0 (diff)
downloadpostgresql-e8db9b26d03b9e58a30eb26ec2ee21c92293d3a2.tar.gz
postgresql-e8db9b26d03b9e58a30eb26ec2ee21c92293d3a2.zip
elog mop-up.
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;