2009-03-14

Last edit

Changed:

< psql -t cas -c 'copy ( select id, ra,dec, pm_ra, pm_dec, bmag, vmag, rmag from nomad.main where vmag >= 5 and vmag <=17) to stdout with csv' > nomad-x-5-17.csv

to

> psql -t cas -c 'copy (
> select id, ra,dec, pm_ra, pm_dec, bmag, vmag, rmag from nomad.main
> where vmag >= 5 and vmag <=17
> )
> to stdout with csv' > nomad-x-5-17.csv


CSV output

Надо было сделать подвыборку не всех полей из большой БД, оказалось очень просто можно сделать так:

psql -t cas -c 'copy ( 
select id, ra,dec, pm_ra, pm_dec, bmag, vmag, rmag from nomad.main 
where vmag >= 5 and vmag <=17
                      ) 
to stdout with csv' > nomad-x-5-17.csv