0% found this document useful (0 votes)
59 views15 pages

Information Search and Analysis Skills (Isas) : C E P C C I T

Continuing Education Program on Computer for Computing and Information Technology Faculty of Engineering University of Indonesia. Paper entitled "postgresql" was prepared with the support of our parents. We accept suggestions and criticism that will help improve towards perfection.

Uploaded by

rayihafizaaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views15 pages

Information Search and Analysis Skills (Isas) : C E P C C I T

Continuing Education Program on Computer for Computing and Information Technology Faculty of Engineering University of Indonesia. Paper entitled "postgresql" was prepared with the support of our parents. We accept suggestions and criticism that will help improve towards perfection.

Uploaded by

rayihafizaaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Continuing Education Program on Computer for Computing

and Information Technology


Faculty of Engineering University of Indonesia

Information Search and Analysis Skills


( ISAS)

NAMA

FACULTY

Agung Prayitno
M. Rayi Hafiza
Faiq Miftakhul M.kom

SEMESTER

Gedung Pascasarjana Lt.3 Fakultas Teknik Universitas Indonesia


Kampus Baru UI Depok

Preface
Praise and gratitude we pray to Almighty God for the completion of a paper
entitled "PostgreSQL". Over the moral and material support given in the
preparation of this paper, then we say a big thank you to Mr. Faiq Miftakhul who
have given many suggestions and corrections in the preparation of this paper and
our parents who have provided facilities and pray that we can complete the task
with the right time.
Hopefully, this paper can be useful for the readers. We realize that in this
paper is still far from perfect, therefore we accept suggestions and criticism that
will help improve towards perfection. Finally, we say thank you

Jakarta, 26 november 2014

Table of contents
CHAPTER I :INTRODUCTION .................................................................................................... 4
1.1 Background .......................................................................................................................... 4
1.2

Writing objective ............................................................................................................ 4

1.3

Problem domain ............................................................................................................. 4

1.4

Writing Methodology ..................................................................................................... 4

Chapter II : Basic Theory................................................................................................................ 5


2.1 Database ............................................................................................................................... 5
2.2 PostgreSQL .......................................................................................................................... 5
CHAPTER III :PROBLEM ANALYSIS ................................................................................................... 6
3.1 History of PostgreSQL ........................................................................................................ 6
3.2

Advantages and Disadvantages ..................................................................................... 7

3.2.1

Advantages............................................................................................................... 7

3.2.2

Disadvantage ........................................................................................................... 7

3.3 View PostgreSQL application using Windows ................................................................. 8


3.4 Commands Related With Sql Command .......................................................................... 9
3.4 Commands In Connection With Command Psql ........................................................... 10
3.5 Sample database created using PostgreSQL: ................................................................ 12
CHAPTER IV : CONCLUSION AND SUGGESTION .............................................................. 14
4.1 Conclusion .......................................................................................................................... 14
4.2 Suggestion .......................................................................................................................... 14
BIBLIOGRAPHY ......................................................................................................................... 15

CHAPTER I :INTRODUCTION
1.1 Background
PostgreSQL is a powerful, open source object-relational database system. It has more
than 15 years of active development and a proven architecture that has earned it a strong
reputation for reliability, data integrity, and correctness. It runs on all major operating
systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris,
Tru64), and Windows. It is fully ACID compliant, has full support for foreign keys, joins,
views, triggers, and stored procedures (in multiple languages). It includes most SQL:2008
data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE,
INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including
pictures, sounds, or video. It has native programming interfaces for C/C++, Java, .Net, Perl,
Python, Ruby, Tcl, ODBC

1.2 Writing objective


The Purpose of this paper is:
1.
2.
3.
4.

To tell a little about the database


To tell about PostgreSQL
To tell the history and development of the PostgreSQL
To tell the advantages and disadvantages in this PostgreSQL

1.3 Problem domain


What is database?
What is PostgreSQL?
How development PostgreSQL?
What is advantages of PostgreSQL?
What is disadvantage of PostgreSQL?

1.4 Writing Methodology


In the preparation of this paper we obtain information from various sources on the
internet that is certain and accountable information. This data collection technique can be
called with the data analysis.

Chapter II : Basic Theory


2.1 Database
Database or database is a collection of data that is stored systematically in the
computer and can be processed or manipulated using the software (application program) to
produce information. Defining database includes specification of data types, structures, and
also limits the data that will be stored. The database is a very important aspect in the
information system where the database is a data warehouse that will be processed further.
The database is important because it can avoid duplication of data, relationships between
data that are not clear, the organization of data, and also updates complicated.

2.2 PostgreSQL
Any data contained in the SQL can be set according to need, an SQL language
composed of various key words. Some of these arithmetic and Procedural which in use is
always followed by the expression. Here are some basic SQL operators.

US (show the label column with another name)


AND and OR (using the standard three-valued Boolean logic)
BETWEEN (width determines the value of the lowest and highest values.)
LIKE (looking for a data only represented by one or more configurable and letters only.)
CASE (comparison in the form of the output column.)
DISTINCT (returns the results of the query that there is no duplication)
SET (change parameters of PostgreSQL)
SHOW (display parameters are active.)
RESET (session allows parameters to be returned to the position of the default value)
LIMIT and OFFSET (limiting the amount of output based on the number of rows)
UNION, EXCEPT, and INTERSECT (combining two queries)

CHAPTER III :PROBLEM ANALYSIS


3.1 History of PostgreSQL

1986
First developed by Professor Michael Stonebraker,Sponsored by the Defense Advanced
Research ProjectsAgency (DARPA). This year is the initial concept to System
development.

1987
Developed definition of the data model, creation of rules, conventions rational and
architecture of the storage media.

1989
Postgre version 1 was launched with a lot of weaknesses in the concept of the rule.

1990
Postgre version 2 launched with improvements to the main rules.

1991
Postgre version 3 is launched with the support of multiple storage managers, an increase in
query executioner, and written he repeated the rule system.

1993
Postgre launched version 4.2 which is the forerunner of the DBMS future with
comprehensive features.

1994
Postgre changed its name to Postgres 95. Andrew Yu and Jolly Chen, adding an
interpreter for the SQL language.

1996
Postgres 95 changed its name to PostgreSQL. And this version has reached PostgreSQL
version 6.0 with the ability to more good and marked by the commencement of the
Postgres project Berkeley Research.

1997
PostgresSQL has developed and continues to develop as a relational database with a GPL
license.

3.2 Advantages and Disadvantages


3.2.1 Advantages
1. Resisten about over-deployment By using PostgreSQL, no one can sue for breach of the
license agreement, as there is no license cost associated (combined) for the software. This
causes PostgreSQL provides additional advantages, among others:
business become more profitable with a wide-scale deployment
there is no possibility inspected for compliance with license
Flexible to execute the concept research and trial deployments without requiring any
additional licensing costs.
2. Support better addition to providing strong support, PostgreSQL also has a community of
experts and enthusiasts.
3. To reduce cost staffing PostgreSQL has been designed and manufactured in such a way
to have this level of maintenance and needs lower than previous systems database,
although still maintaining the quality of features, stability, and performance. So that the
cost required PostgreSQL become more effective and more manageable.
4. Trusted and stable Many companies report that PostgreSQL has never, even though, it
has crashed during operations with a high level of activity.
5. Extensible (can be extended) we do not require any small cost and only requires a little
effort to expand for PostgreSQL.
6. Cross PostgreSQL platform can run almost any kind of unix (34 platforms of the most
recently released), also in Windows using Cygwin.
7. Design for PostgreSQL uses environments high volume data storage with many rows
(multiple rows) is called MVCC. It aims to make PostgreSQL extremely responsive in
high volume environments.
8. Design database GUI and GUI administration tools Some high-quality tools available for
managing a database (pgAdmin, pgAccess), as well as the design of the database (Tora,
database architect).
9. Fitur feature strongly supports PostgreSQL is very rich in features that provide, among
other things: rules, views, triggers, unicode, sequences, inheritance, outer join, subselects, open APIs, and more.

3.2.2 Disadvantage
1. The less popular and suitable to work in a web environment when compared with mysql.
2. Lack of focus in terms of slimness of data and speed.

3. Architecture with multiprocessing is difficult to apply to Windows, because Windows sothread oriented.
4. PostgreSQL itself today can run on Windows, but through Cygwin emulation layer.
5. Less superior in terms of the availability of built-in functions.
6. Replication in PostgreSQL itself has not been included in the standard distribution.
7. PostgreSQL itself is limited only adding columns, renaming column, and renaming the
table.

3.3 View PostgreSQL application using Windows


View in Windows XP

http://screenshots.en.sftcdn.net/en/scrn/51000/51631/pgisql-interactive-sql-for-postgresql6.jpg

View in Windows 7

http://static.filehorse.com/screenshots/developer-tools/postgresql-screenshot-01.png

3.4 Commands Related With Sql Command


Here is a list of commands available assistance in PostgeSQL 8.2 if we
using the Command Prompt. If we want to use one of the commands
but forget the syntax of writing, then we can use the \ h <command name>
and PostgreSQL will display the syntax of the command.
postgres=# \h
Available help :
ABORT

CREATE OPERATOR CLASS

END

ALTER AGGREGATE
CREATE OPERATOR
ALTER CONVERSION
CREATE ROLE
ALTER DATABASE
CREATE RULE
ALTER DOMAIN
CREATE SCHEMA
ALTER FUNCTION
CREATE SEQUENCE
ALTER GROUP
CREATE TABLE
ALTER INDEX
CREATE TABLE AS
ALTER LANGUAGE
CREATE TABLESPACE
ALTER OPERATOR CLASS
CREATE TRIGGER
ALTER OPERATOR
CREATE TYPE
ALTER ROLE
CREATE USER
ALTER SCHEMA
CREATE VIEW
ALTER SEQUENCE
DEALLOCATE REASSIGN
ALTER TABLE
DECLARE
ALTER TABLESPACE
DELETE
ALTER TRIGGER
DROP AGGREGATE
ALTER TYPE
DROP CAST
ALTER USER
DROP CONVERSION
ANALYZE
DROP DATABASE
BEGIN
DROP DOMAIN
CHECKPOINT
DROP FUNCTION
CLOSE
DROP GROUP
CLUSTER
DROP INDEX
COMMENT
DROP LANGUAGE
COMMIT
DROP OPERATOR CLASS
COMMIT PREPARED
DROP OPERATOR
COPY
DROP OWNED
CREATE AGGREGATE
CREATE CAST
CREATE CONSTRAINT
TRIGGER
CREATE CONVERSION
CREATE DATABASE
CREATE DOMAIN
CREATE FUNCTION
CREATE GROUP
CREATE INDEX
CREATE LANGUAGE

DROP ROLE
DROP RULE
DROP SCHEMA
DROP SEQUENCE
DROP TABLE
DROP TABLESPACE
DROP TRIGGER
DROP TYPE
DROP USER
DROP VIEW

EXECUTE
EXPLAIN
FETCH
GRANT
INSERT
LISTEN
LOAD
LOCK
MOVE
NOTIFY
PREPARE
PREPARE TRANSACTION
OWNED
REINDEX
RELEASE SAVEPOINT
RESET
REVOKE
ROLLBACK
ROLLBACK PREPARED
ROLLBACK TO SAVEPOINT
SAVEPOINT
SELECT
SELECT INTO
SET
SET CONSTRAINTS
SET ROLE
SET SESSION
AUTHORIZATION
SET TRANSACTION
SHOW
START TRANSACTION
TRUNCATE
UNLISTEN
UPDATE
VACUUM
VALUES

3.4 Commands In Connection With Command Psql


Here is a list of commands associated with the use PSQL (Procedural SQL) In
PostgreSQL 8.2. The commands below are aimed at to facilitate the database administrator
to manage databases with PostgreSQL.
postgres=# \?
General
\c

[connect] [DBNAME|- USER|- HOST|- PORT|-]


connect to new database (currently "postgres")

\cd [DIR]
change the current working directory
\copyright
show PostgreSQL usage and distribution terms
\encoding [ENCODING] show or set client encoding
\h [NAME]
help on syntax of SQL commands, * for all commands
\q
quit psql
\set [NAME [VALUE]]
set internal variable, or list all if no parameters
\timing
toggle timing of commands (currently off)
\unset NAME
unset (delete) internal variable
\! [COMMAND]
execute command in shell or start interactive shell
Input/Output
\echo [STRING]
\i FILE
\o [FILE]
\qecho [STRING]

write string to standard output


execute commands from file
send all query results to file or |pipe
write string to query output stream (see \o)

Informational
\d [NAME]
describe table, index, sequence, or view
\d{t|i|s|v|S} [PATTERN] (add "+" for more detail)
list tables/indexes/sequences/views/system tables
\da [PATTERN]
list aggregate functions
\db [PATTERN]
list tablespaces (add "+" for more detail)
\dc [PATTERN]
list conversions
\dC
list casts
\dd [PATTERN]
show comment for object
\dD [PATTERN]
list domains
\df [PATTERN]
\dg [PATTERN]
\dn [PATTERN]
\do [NAME]
\dl
\dp [PATTERN]
\dT [PATTERN]
\du [PATTERN]
\l
\z

list functions (add "+" for more detail)


list groups
list schemas (add "+" for more detail)
list operators
list large objects, same as \lo_list
list table, view, and sequence access privileges
list data types (add "+" for more detail)
list users
list all databases (add "+" for more detail)
[PATTERN] list table, view, and sequence access privileges (same as\
dp)

Formatting
\a
toggle between unaligned and aligned output mode
\C [STRING]
set table title, or unset if none
\f [STRING]
show or set field separator for unaligned query output
\H
toggle HTML output mode (currently off)
\pset NAME [VALUE]
set table output option
(NAME := {format|border|expanded|fieldsep|footer|null|
numericlocale|recordsep|tuples_only|title|tableattr|pager})
\t
show only rows (currently off)
\T [STRING]
set HTML <table> tag attributes, or unset if none
\x
toggle expanded output (currently off)

Copy, Large Object


\copy ...
perform SQL COPY with data stream to the client host
\lo_export LOBOID FILE
\lo_import FILE [COMMENT]
\lo_list
\lo_unlink LOBOID
large object operations

3.5 Sample database created using PostgreSQL:


Settings report
content of settings_report.psql
\o settings_report.html(1)
\T 'cellspacing=0 cellpadding=0'(2)
\qecho '<html><head><style>H2{color:maroon}</style>'(3)
\qecho '<title>PostgreSQL Settings</title></head><body>'(4)
\qecho '<table><trvalign=''top''><td><h2>Planner Settings</h2>'(5)
\x on(6)
\t on(7)
\pset format html(8)
SELECT category, string_agg(name || '=' || setting, E'\n' ORDER BY name(9)) As
settings(10)
FROM pg_settings
WHERE category LIKE '%Planner%'
GROUP BY category
ORDER BY category;
\H
\qecho '</td><td><h2>File Locations</h2>'(11)
\x off(12)
\t on(13)
\pset format html(14)
SELECT name, setting FROM pg_settings WHERE category = 'File Locations' ORDER BY
name;
\qecho '<h2>Memory Settings</h2>'
SELECT name, setting, unit FROM pg_settings WHERE category ILIKE '%memory%'
ORDER BY name;
\qecho '</td></tr></table>'
\qecho '</body></html>'
\o

(1) - Redirect query output to a file.


(2) - HTML table settings for query output.
(3), (4), (5), (11) - Write additional content beyond the query output to our output file.

(6) -Set to expanded mode. The first query is output in expanded mode which means that
the column headers are repeated for each row and the column of each row is output as a
separate row.
(8), (14) -Force the queries to output as HTML tables.
(9), (10) - We use the aggregate function string_agg(), which was introduced in
PostgreSQL
9.0 To concatenate all properties in the same category into a single column. We are also
taking advange of the new ORDER BY clause for aggregate functions introduced in 9.0 to
sort properties by name.
(12) - Set to expanded mode off. The second and third query are output in non-expanded
mode which means that there is one output row per table row.
(7), (13) -Set to tuples only mode. This causes queries to not have any column headers or
row count.

CHAPTER IV : CONCLUSION AND SUGGESTION


4.1 Conclusion
PostgreSQL is an application created to process the database. postgres application can be used by
anyone for free of charge and easily obtained. Coupled with a variety of features to simplify the
manufacture and processing of database and continue to be developed by experts.

4.2 Suggestion
PostgreSQL is a database processing application that is great for beginners because it has
a variety of features to simplify database processing, but PostgreSQL requires a lot of data
for processing. PostgreSQL is also very slow when performing the process

BIBLIOGRAPHY
Reference from Site:
http://blog.uin-malang.ac.id/
www.postgresql.org
https://help.ubuntu.com/community/PostgreSQL

E-Books:

PostgreSQL: Up And Running


Manual Books PostgreSQL 8.2.0
Kadir, Abdul. 2002. PenuntunPraktisBelajar SQL. Yogyakarta :Penerbit Andi.
Owo-Postgres

You might also like