Re: Bug #432: Macaddr accepts empty string

Started by Tom Laneover 24 years ago2 messagesbugs
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

pgsql-bugs@postgresql.org writes:

The datatype macaddr accepts empty strings as data. I think this is
not correct; an empty string is no valid mac address.

This is already changed for 7.2.

regression=# select ''::macaddr;
ERROR: macaddr_in: error in parsing ""
regression=#

regards, tom lane

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: Bug #432: Macaddr accepts empty string

Not any more:

test=> create table pp (x macaddr);
CREATE
test=> insert into pp values ('');
ERROR: macaddr_in: error in parsing ""

Daniel Mantione (daniel@deadlock.et.tudelft.nl) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Macaddr accepts empty string

Long Description
Hello,

The datatype macaddr accepts empty strings as data. I think this is not correct; an empty string is no valid mac address.

It should accept NULL (which it does).

Greetings,

Daniel Mantione

Sample Code

No file was uploaded with this report

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026