PostgreSQL Installation By: Keerthi Nelaturu Previous version by Ahmed Jeddah & Miguel Garzon.

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are.
Unauthorized Reproduction Prohibited SkyPoint Alarm Integration Add-On Using OnGuard Alarms to create events in SkyPoint Also called ‘SkyPoint V0’ CR4400.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
George Blank University Lecturer. Creating A Web Site at NJIT Professor Blank.
Basic linux shell commands and Makefiles. Log on to engsoft.rutgers.edu Open SSH Secure Shell – Quick Connect Hostname: engsoft.rutgers.edu Username/password:
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
Virtual Machine and UNIX. What is a VM? VM stands for Virtual Machine. It is a software emulation of hardware. By using a VM, you can have the same hardware.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
7/17/2009 rwjBROOKDALE COMMUNITY COLLEGE1 Unix Comp-145 C HAPTER 2.
A crash course in njit’s Afs
1 Introduction to PostgreSQL. 2 Documents PostgreSQL 8 for Windows (*) Beginning Databases with PostgreSQL From Novice to Professional, Second Edition.
1 Day 3 Directories Files Moving & Copying. 2 Case Sensitive First thing to learn about UNIX is that everything is case sensitive. Thus the files: –enda.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
V Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 9 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM.
CNIT 132 Intermediate HTML and CSS Publish Web Page.
Connecting to USF Network for Web Site SSH Secure Shell is the FTP program you will use to download your http files onto the USF server. To get the SSH.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction Unix-like system is everywhere Linux Android for smartphones Google Chrome OS for Chromebook Web.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
HTML Hyper Text Markup Language A simple introduction.
ECT 250: Survey of E-Commerce Technology FrontPage Publishing pages Unix.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015.
TAMU CSCE 313 (the basics). Basic Unix/Linux programming Accessing CS systems  PuTTY (putty.exe) – a Telnet and SSH client  Common hosts: unix.cs.tamu.edu.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
IST 210 Introduction to UNIX (AIX) Todd Bacastow IST 210: Organization of Data.
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
Windows PostgreSQL installation. Pre-requisites Define a local non-administrative Windows account (eg. postgres) Must install on Console, not through.
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Lecture One. Objective: Provide description of the Command-Line Editor of Linux operating system. Enable students to understand the practical side of.
Linux and Java Basics. What is Linux? Operating system by Linus Torvalds that was a clone of Unix (thus Linux) Free and open source – this is the reason.
Lab 5: Building PostgreSQL Server from Source Code and Modifying Source Code.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
1 AHM -2-4 Sept 2003 e-Science Centre Running SRB Ananta Manandhar.
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
1 Tips for the assignment. 2 Socket: a door between application process and end- end-transport protocol (UDP or TCP) TCP service: reliable transfer of.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Assignprelim.1 Assignment Preliminaries © 2012 B. Wilkinson/Clayton Ferner. Modification date: Jan 16a, 2014.
Tutorial Six Linux Basics CompSci Semester Two 2016.
Precept I : Lab Environment, Unix, Bash, Emacs
Fundamental of Databases
ENEE150 Discussion 01 Section 0101 Adam Wang.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
SEEM3460 Tutorial Unix Introduction.
EE516: Embedded Software Project 1
CS1010: Intro Workshop.
Development Environment Basics
Tutorial Six Recap & Linux Basics CompSci Semester Two 2016.
Andy Wang Object Oriented Programming in C++ COP 3330
The Command Prompt Commands are the way to “do things” in Unix
Intro to UNIX System and Homework 1
Telnet/SSH Connecting to Hosts Internet Technology.
Web Programming Essentials:
Andy Wang Object Oriented Programming in C++ COP 3330
Video Notes.
CSCE 206 Lab Structured Programming in C
Presentation transcript:

PostgreSQL Installation By: Keerthi Nelaturu Previous version by Ahmed Jeddah & Miguel Garzon

Presentation Overview Prerequisite packages Connecting to SITE’s LINUX Server Some basic UNIX commands PostgreSQL Installation PgAdmin III Installation

Prerequisite packages SSH: click on the exe file and follow the instructions PostgreSQL: choose the file postgresql tar.gz (The version we will be using is ver 8.1.4) pgAdmin III: 32/ 32/ choose the.zip file This is only needed if you want to work in your own pc!

Connecting to SITE’s LINUX Server On-Campus: (FTP Server) 1- go to Programs-> SSH Secure Shell -> Secure File Transfer Client --- then click on Quick Connect

Connecting to SITE’s LINUX Server Continue: 2- In the host name field : linux.site.uottawa.ca, in the user name field : your site alias The password: site account password (remember the Autopass)

Connecting to SITE’s LINUX Server Go to Programs-> SSH Secure Shell -> Secure Shell Client --- then click on Quick Connect Host name : linux.site.uottawa.ca User name : site alias Password : site account password

Connecting to SITE’s LINUX Server Connecting Off-Campus -- for connecting to the Secure File Transfer – follow the same steps but Host name: ugate.site.uottawa.ca --for connecting to the Secure Shell – follow the same steps but Host name: ugate.site.uottawa.ca – and then, type: ssh linux.site.uottawa.ca (the server will then ask for a password – it is the same as the site account password) See for more details

Some basic UNIX commands pwd : show the full name of the current directory. – Note that in Unix; we use “/” in the file name description – while in windows we use “\” mkdir: create a new directory – e.g. mkdir new_folder Note 1: in Unix; Do NOT name directories with a space in them (i.e. A folder called My Documents will cause some problems). Note 2: Unix is case sensitive for commands and files– i.e. Mkdir new_folder is wrong statment

Some basic UNIX commands ls (list files in the current directory) cd ( current directory) – Examples: – cd new_folder (will go to the folder called new_folder) – cd ( return to your home directory) – cd.. (will go to the parent directory) – Hint: You can use “Tab” when writing the names of directories – it is as Auto Complete !

Some basic UNIX commands cp : copy a file (or folder) – cp source destination Figure out how it work for folders!! Try typing cp --help to get some help !! mv : move a file – mv file1 file2 (will move the contents of file1 to file2 – file1 no more exist)

Some basic UNIX commands Removing files and directories: – rmdir: (remove directory) Note: rmdir cannot remove directory that is not empty – rm: (remove file) – Examples: rm file1 rm Directory Error message: Directory1 is a directory rm --help --- show the documentation of command rm rm –r Directory1 -- No error message (works for files and folders – (Q. What does –r do ?!) rm –rf File == rm –r –f File --- (Q. What does –f do ?!) Other Commands – clear : clear the screen – history: display the history of commands

Some basic UNIX commands Compiling a c source code in Linux; – There exist many c compilers: GCC – LCC – PCC – TenDRA. – We are going to use GCC – We don’t need to install it now, it is already there !

Some basic UNIX commands Compiling C code #include int main(void) { printf("First file \n"); printf("Hello World \n"); return 0; } Write the following code and save it in hello.c

Some basic UNIX commands cd c // c is the directory where hello.c resides gcc hello.c ls // you will find a file called a.out./a.out // run executable file./a.out -bash-3.2$./a.out First file Hello World -bash-3.2$

Some basic UNIX commands We are not restricted to the file a.out; The statement: gcc hello.c –o b.out will generate the executable file b.out instead, “type gcc -- help for some more useful options;”

Some basic UNIX commands Makefile and the make command We can write many commands in a script file and run it all at once; For example: all: gcc hello.c –o b.out mkdir –p x mv b.out x 1) Write the previous commands in a file called Makefile-1.txt; (in the same directory of hello.c); 2) Type the command: make -f Makefile-1.txt Q1. What do this script do ? Q2. What does the –p in mkdir do ?

all: createFolder first: gcc hello.c -o b.out./b.out # *** File hello.c Compiled and executed *** createFolder: rm -rf newfolder mkdir newfolder second: gcc second.c./a.out # *** File calculations.c Compiled and executed *** clean: rm -rf *.out rm -rf newfolder Try these examples and observe the output: make –f makefile-5.txt make –f makefile-5.txt first make –f makefile-5.txt clean make –f makefile-5.txt second make –f makefile-5.txt all More options in MakeFile

Rename Makefile-5.txt to Makefile and then run make ; i.e. make all ; make clean ; make first etc... The default file that make look for is Makefile IMPORTANT NOTE: Makefile has NO extension; it is a UNIX file

More options in MakeFile Makefile may be more intelligent and powerful. We may have variables; Or we may also use if-else statements (see link: – (introduction) – html (more advanced) html

Installing PostgreSQL 1.Have the file postgresql tar.gz in your base file (i.e. home/infofa/h/users/you_user_name ) 2.Type gzip –d postgresql tar.gz 3.Type tar -xvf postgresql tar (Extraction) 3. cd postgresql

Installing PostgreSQL 4)./configure --prefix=PREFIX --enable- debug –enable-depend Replace PREFIX with the name of the folder you want to install PostgreSQL in; (i.e. /home/infofa/h/users/mgarz042/ postgresql /pgs) --enable-debug and –enable-depend are optional will be useful for the project

Installing PostgreSQL 5) gmake // or you may use make “Note” gmake has the same function as make; however; the default file in this case is GNUmakefile make, in this case, points to gmake (Read the file Makefile – intersting) Wait for this message: All of PostgreSQL successfully made. Ready to install.

Installing PostgreSQL 6) gmake check This step performs some testing before the installation Expect something like that: ======================= All 114 tests passed. =======================

Installing PostgreSQL 7) gmake install We are done if we see; PostgreSQL installation complete.

Installing PostgreSQL 8) Go to directory where you installed PostgreSQL (i.e. PREFIX) cd pgs 9) cd bin 10)./initdb –D../data Success. You can now start the database server using:./postgres -D../data or./pg_ctl -D../data -l logfile start

Installing PostgreSQL 11) Start the server side of the database with./postgres –D../data if Error: LOG: could not bind IPv4 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. WARNING: could not create listen socket for "localhost" FATAL: could not create any TCP/IP sockets then:./postgres –D../data –p xxxx // xxxx is any number

Installing PostgreSQL DONE !!! You may expect a message like this: LOG: database system was shut down at :34:14 EDT LOG: autovacuum launcher started LOG: database system is ready to accept connections

Not Done Yet ! - Open a new terminal window in SSH Secure Shell -Type in the client side:./psql postgres –p xxxx where xxxx is the same port number of the server side

DONE !!! Welcome to psql 8.3.4, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit postgres=# Now, you can write your SQL quiries !

SQL Commands Example of SQL commands; create table products (pnum int, pname varchar(20), price real); insert into products (pnum, pname, price) values (12, ‘coke’, 1.25); insert into products (pnum, pname, price) values (13, ‘burger’, 5.99); Insert into products (pnum, pname, price) values (551, ‘coffee’, 1.18); Select * from products ; Etc..

Installing PgAdmin III Unzip the file pgadmin zip Follow instructions. This is the same port number the database server is listening to

More configurations on PostgreSQL To connect pgAdmin with PostgreSql: – Go to the directory where the files of the database are located (i.e. in our case: /home/infofa/h/users/ajedd07/postgresql /data) -Look for #listen_addresses = 'localhost‘ in file postgresql.conf ; change it with listen_addresses = ‘*‘ -At the end of the file pg_hba.conf; add the line host all all /32 trust Unfortunatley, even with these changes, pgAdmin can not connect to the database serever from off-campus

References PostgreSQL Documentations pgAdmin III Documentations Unix commands A good reference for c and c++ PostgreSQL for developpers (useful for the next lectures)