astro-datalab / fits2db

2 stars 3 forks source link

Header option may have problems with long column names #3

Closed weaverba137 closed 4 years ago

weaverba137 commented 5 years ago

While attempting to load the sdss_dr14_new.sdssebossfirefly table with

fits2db --sql=postgres --truncate -t sdss_dr14_new.sdssebossfirefly sdss_dr14_new.sdssebossfirefly.fits | psql tapdb datalab

psql complained of unexpected column names. It turns out the string double precision was being inserted into the COPY command at odd places:

COPY sdss_dr14_new.sdssebossfirefly (specobjid,bestobjid,plug_ra,plug_dec,sn_median_all,
    chabrier_miles_age_lightw,chabrier_miles_age_lightw_up,chabrier_miles_age_lightw_low,
    chabrier_miles_metallicity_lightdouble precision,chabrier_miles_metallicity_lightdouble precision,
    chabrier_miles_metallicity_lightdouble precision,chabrier_miles_stellar_mass,
    chabrier_miles_stellar_mass_up,chabrier_miles_stellar_mass_low,chabrier_miles_spm_ebv,
    chabrier_miles_ncomponentsssp,chabrier_miles_c ...

Maybe this has something to do with the long column names in this particular file. Setting the --noheader option allowed the load to proceed.

mjfitzpatrick commented 4 years ago

Closing this since it no longer appears to be a problem with that file.