CAVI Model Database Export - HOWTO

Document created by DanielSweatman77140633 on Mar 15, 2016Last modified by Melissa Potvin on Jul 13, 2016
Version 2Show Document
  • View in full screen mode

Hi guys,

 

If you or your organisation needs to have a copy of the entire Model Database in CSV format you can follow these steps.

 

As root user, log onto your CAVI server.

 

This first command calls the postgres executable, connects to the VDC database, sets an output file name, sets a delimiter as a csv and removes the "table" style formatting.

 

#/usr/local/pgsql/bin/psql -d vdc_repos -o /tmp/vi_models.csv -F ',' -A

 

Once inside the database you can execute the following query:

 

SELECT type.name,vendor.name,pline.name,mod.name

FROM res.device_model mod

JOIN res.device_pline pline ON pline.id = mod.pline_id

JOIN res.device_type_en type ON mod.type_id = type.id

JOIN res.device_vendor vendor ON vendor.id = pline.vendor_id

ORDER BY type.name,vendor.name,pline.name,mod.name;

 

Do not forget the ';' to finalise the query.

 

Type '\q' to exit.

 

You should now have a csv file in /tmp called vi_models.csv with the data listing of every model, their product line, vendor and device type attachment.

 

HI Daniel,

 

do you think that you can convert this post into a document (instead of a question)? if you cannot do it I can do it for you.

A document is a more suitable type for this kind of posts.

 

Thanks!

Nestor

 

This document was generated from the following discussion: How To: CAVI Model Database Export

Attachments

    Outcomes