1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Allow input format xxxx-xxxx-xxxx for macaddr type

Author: Herwin Weststrate <herwin@quarantainenet.nl>
Reviewed-by: Ali Akbar <the.apaan@gmail.com>
This commit is contained in:
Peter Eisentraut
2014-10-21 16:16:39 -04:00
parent 5d93ce2d0c
commit 6f04368cfc
4 changed files with 25 additions and 14 deletions

View File

@@ -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);