From 6f04368cfc05c46140f124415d752c3628c73f28 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 21 Oct 2014 16:16:39 -0400 Subject: Allow input format xxxx-xxxx-xxxx for macaddr type Author: Herwin Weststrate Reviewed-by: Ali Akbar --- src/backend/utils/adt/mac.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/backend/utils/adt/mac.c') diff --git a/src/backend/utils/adt/mac.c b/src/backend/utils/adt/mac.c index aa9993fa5c6..509315ae0e4 100644 --- a/src/backend/utils/adt/mac.c +++ b/src/backend/utils/adt/mac.c @@ -56,6 +56,9 @@ macaddr_in(PG_FUNCTION_ARGS) if (count != 6) count = sscanf(str, "%2x%2x.%2x%2x.%2x%2x%1s", &a, &b, &c, &d, &e, &f, junk); + if (count != 6) + count = sscanf(str, "%2x%2x-%2x%2x-%2x%2x%1s", + &a, &b, &c, &d, &e, &f, junk); if (count != 6) count = sscanf(str, "%2x%2x%2x%2x%2x%2x%1s", &a, &b, &c, &d, &e, &f, junk); -- cgit v1.2.3