<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to DevQuickStart_GraphDatabase</title><link>https://sourceforge.net/p/carbones/wiki/DevQuickStart_GraphDatabase/</link><description>Recent changes to DevQuickStart_GraphDatabase</description><atom:link href="https://sourceforge.net/p/carbones/wiki/DevQuickStart_GraphDatabase/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 20 Mar 2015 14:20:04 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/carbones/wiki/DevQuickStart_GraphDatabase/feed" rel="self" type="application/rss+xml"/><item><title>DevQuickStart_GraphDatabase modified by Anonymous</title><link>https://sourceforge.net/p/carbones/wiki/DevQuickStart_GraphDatabase/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="superceded"&gt;SUPERCEDED&lt;/h1&gt;
&lt;h2 id="these-instructions-are-superceded-by-the-later-instructions-in-howtosetupperiodandvariablebaseddatabasestructure"&gt;&lt;strong&gt;These instructions are superceded by the later instructions in &lt;a class="" href="/p/carbones/wiki/HowToSetupPeriodAndVariableBasedDatabaseStructure"&gt;HowToSetupPeriodAndVariableBasedDatabaseStructure&lt;/a&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;hr /&gt;
&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;The data for the regional time-series graphs are stored in a PostGreSQL database, &lt;strong&gt;carbones_graph&lt;/strong&gt;. These instructions explain how to set up this database &lt;strong&gt;carbones_graph&lt;/strong&gt; on a development machine. This is essential when preparing a development machine to work on the code. These steps would also be useful in deploying the application to a different server. &lt;/p&gt;
&lt;p&gt;See also the instructions on setting up Eclipse &lt;a class="" href="../DevQuickStart_Eclipse"&gt;DevQuickStart_Eclipse&lt;/a&gt;. &lt;/p&gt;
&lt;h1 id="details"&gt;Details&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Pre-requisites&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PostGreSQL &lt;/li&gt;
&lt;li&gt;pgAdmin III (not essential, but a very useful tool for administring PostGreSQL) &lt;/li&gt;
&lt;li&gt;The SQL and TXT files containing the database definition. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;TODO&lt;/strong&gt; we should store the SQL and TXT files in the SVN repository. &lt;/p&gt;
&lt;p&gt;Currently they are on the CERC network in the location given below. Copy them to a local directory. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is best to avoid deeply nested directories or directory names with spaces. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Location of SQL and TXT files&lt;/em&gt;&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nl"&gt;P:&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;FM&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;FM862_CARBONES&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;Web&lt;/span&gt; &lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="mi"&gt;20110506&lt;/span&gt;&lt;span class="n"&gt;_20yearGraphData&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="mi"&gt;20110729&lt;/span&gt;&lt;span class="n"&gt;_database_Structure&lt;/span&gt;\
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;1. Create database carbones_graph &lt;/p&gt;
&lt;p&gt;2. Run the SQL to create the structure of the database: "structure.sql"&lt;/p&gt;
&lt;p&gt;The procedure &lt;code&gt;linegraph_multiregion&lt;/code&gt; was added to the SQL on 11 Aug 2011. It is also available at &lt;code&gt;Q:\CRs\Utilities\CARBONES_F862\Website\CR0004 Change CSV to show region data in different columns\ChangedFilesAfterReview\linegraph_multiregion.txt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;3. Run the following SQL to insert the reference data from the TXT files &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You will need to change the paths in the SQL to the path to your local directory. &lt;/p&gt;
&lt;p&gt;COPY units("units_id","units_name")&lt;br /&gt;
FROM 'E:/PostgreSQL/units.txt'&lt;br /&gt;
WITH DELIMITER E'\t'&lt;br /&gt;
CSV HEADER;&lt;/p&gt;
&lt;p&gt;COPY variable("variable_id","variable_code","variable_name","units_id","isflux")&lt;br /&gt;
FROM 'E:/PostgreSQL/variable.txt'&lt;br /&gt;
WITH DELIMITER E'\t'&lt;br /&gt;
CSV HEADER; &lt;/p&gt;
&lt;p&gt;COPY region("region_id","region_code","region_name","island","isocean")&lt;br /&gt;
FROM 'E:/PostgreSQL/Region.txt'&lt;br /&gt;
WITH DELIMITER E'\t'&lt;br /&gt;
CSV HEADER;&lt;/p&gt;
&lt;p&gt;COPY temporal_filtering("temporal_filtering_id","temporal_filtering_name")&lt;br /&gt;
FROM 'E:/PostgreSQL/temporal_filtering.txt'&lt;br /&gt;
WITH DELIMITER E'\t'&lt;br /&gt;
CSV HEADER;&lt;/p&gt;
&lt;p&gt;COPY averaging_period("averaging_period_id","averaging_period_name")&lt;br /&gt;
FROM 'E:/PostgreSQL/AveragingPeriod.txt'&lt;br /&gt;
WITH DELIMITER E'\t'&lt;br /&gt;
CSV HEADER;&lt;/p&gt;
&lt;p&gt;COPY series("series_id","variable_id","averaging_period_id","temporal_filtering_id")&lt;br /&gt;
FROM 'E:/PostgreSQL/Series.txt'&lt;br /&gt;
WITH DELIMITER E'\t'&lt;br /&gt;
CSV HEADER;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;4. Import the latest graph data. The steps are described &lt;a class="" href="/p/carbones/wiki/SQLEnterDataIntoDatabase"&gt;here&lt;/a&gt;. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Fri, 20 Mar 2015 14:20:04 -0000</pubDate><guid>https://sourceforge.net4d4f8dc1637b8196fbb148f0814dff8ab7988abc</guid></item></channel></rss>