• Bruce Momjian's avatar
    Depending on my interpreting (and programming) skills, this might solve · bcaabc56
    Bruce Momjian authored
    anywhere from zero to two TODO items.
    
    * Allow flag to control COPY input/output of NULLs
    
    I got this:
    COPY table .... [ WITH NULL AS 'string' ]
    which does what you'd expect. The default is \N, otherwise you can use
    empty strings, etc. On Copy In this acts like a filter: every data item
    that looks like 'string' becomes a NULL. Pretty straightforward.
    
    This also seems to be related to
    
    * Make postgres user have a password by default
    
    If I recall this discussion correctly, the problem was actually that the
    default password for the postgres (or any) user is in fact "\N", because
    of the way copy is used. With this change, the file pg_pwd is copied out
    with nulls as empty strings, so if someone doesn't have a password, the
    password is just '', which one would expect from a new account. I don't
    think anyone really wants a hard-coded default password.
    
    Peter Eisentraut                  Sernanders väg 10:115
    bcaabc56
copy.c 31.1 KB