///////////////////////////////////////////////////////////////
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
///////////////////////////////////////////////////////////////

These instructions are for preparing your out-of-box PostgreSQL installation so it would be usable with PostgreSQL indexing of Zest.

1. Creating login role and database
1.1. Using pgAdmin, connect to PostgreSQL database, and create database you intend to use to store Zest™ entity data, and login role for Zest™ application to use when it connects to database.
1.1. Update these values into your .properties file, if necessary.

2. Adding ltree as type
2.1. Using pgAdmin, connect to PostgreSQL database, and navigate to database which is intended to be used for Zest. (Click on it)
2.2. Executing arbitary SQL queries should be possible, click that button (button with SQL text on it, next to trash bin).
2.3. This will open new window, erase any text which pgAdmin generates there for you.
2.4. Then navigate to your PostgreSQL installation directory, then into 'share', and then into 'contrib'. Open file 'ltree.sql' in your favorite text editor.
2.5. Select all text, copy it, and paste to SQL query window which you opened in stage 2.2.
2.6. If you know what you are doing, you may change the line 'SET search_path = public;' to make search_path be 'pg_catalog', or name of schema that Zest™ application will use ('qi4j' by default). It's ok to leave it to 'public' though.
2.7. Hit F5 or go Query -> Execute Query to execute the SQL. It should print some notices into output window but no errors nor warnings should be present.
2.8. Ltree type should be now installed to your PostgreSQL installation.
