postgresql hem güçlü hem güzel!

Click here to load reader

Post on 15-Apr-2017

276 views

Category:

Technology

7 download

Embed Size (px)

TRANSCRIPT

  • PostgreSQLPostgreSQL Hem G Hem Gzel!Hem G Hem Gzel!

    6 Mays 2015 Van Yznc Yl niversitesi Biliim enlii 2015

    Glin Yldrm

    http://www.yyu.edu.tr/http://bilisim.yyu.edu.tr/https://www.linkedin.com/pub/gulcin-yildirim/18/346/8ba

  • Ben Kimim?Ben Kimim?

    DBA @ DBA @ Blogger @ Blogger @ MarkafoniMarkafoni Kadn YazlmcKadn Yazlmc Twitter: Twitter: @[email protected]

    https://www.markafoni.com/http://kadinyazilimci.com/https://twitter.com/apatheticmagpie

  • PostgreSQL TarihiPostgreSQL Tarihi

    University of California at Berkeley (UCB) 1977.

    Michael Stonebraker Ingres Projesi'ni balatt.

  • PostgreSQL ok Gl!PostgreSQL ok Gl!

    Dnyann en gelimi ak kaynak kodlu veri tabandr.likisel bir veri taban ynetim sistemidir ( )ok byk verileri ve anlk ilem yk yksek olan projeleriPostgreSQL ile ynetmek mmkndr.

    ORDBMS

    https://www.wikiwand.com/en/Object-relational_database

  • PostgreSQL ok GlPostgreSQL ok GlGl, salam, ACID prensiplerine uygun, hata yapmayaengel olan gvenli bir yaps vardr.Aktif bir topluluk tarafndan desteklenmektedir.PostgreSQL iin ok fazla eklenti/ara gelitirilmektedir.PostgreSQL belge ve dokmantasyon olarak iyidir.SQL Standartlarna en ok uyum gsteren veri tabandr.Sorgu planlaycs harikadr!Performans iyiletirmek iin idealdir.Hata mesajlar ve log sistemi aktr, anlalrdr.Replikasyon metodlar zengindir.Ynetimi kolaydr.

  • PostgreSQL renmekPostgreSQL renmekPostgres kaydolun. Gnde 1 mail ile ne kadar

    ok ey renebileceinize inanamazsnz.mail listelerine

    Liste TanmPostgreSQL ynetimiKullanclar iin genel bir tartmaalanPostgres ve ona bal servisduyurularPostgres performansna ilikinkonular

    pgsql-adminpgsql-general

    psql-announce

    psql-performance

    http://www.postgresql.org/list/http://www.postgresql.org/list/pgsql-admin/http://www.postgresql.org/list/pgsql-general/http://www.postgresql.org/list/pgsql-announce/https://slides.com/secure/decks/406746/pgsql-performance

  • PostgreSQL renmekPostgreSQL renmek blogunu takip edin.

    ( , , , , , , , , , )

    Planet PostgreSQL2ndQuadrant pgExperts VMware OmniTI EnterpriseDB

    EndPoint credativ Cybertec CommandPrompt OpenSCG

    PostgreSQL bloglarnn tm bu blogda toplanr.

    http://planet.postgresql.org/http://www.2ndquadrant.com/http://www.pgexperts.com/http://www.vmware.com/http://omniti.com/shareshttp://blogs.enterprisedb.com/http://blog.endpoint.com/http://blog.credativ.com/en/postgresql/http://www.cybertec.at/http://www.commandprompt.com/blogs/http://www.openscg.com/blog/

  • PostgreSQL renmekPostgreSQL renmek

    Karlatnz her konsept iin yazlm bulup okuyun.

    Postgres belgeleme konusunda en zengin ak kaynak kodluprojelerden biridir.ok sk kullandnz zellikleri bile okuyun nk ufak birdetay hayat kurtarc olabilir.

    PostgreSQLbelgesini

    "Why do I love Postgres?- Because I'm not a DBA. "

    http://www.postgresql.org/docs/9.3/static/index.html

  • Postgres Neden Gzel?Postgres Neden Gzel?

  • Kurulumu ok KolayKurulumu ok KolayMac

    basit ve 'native' bir Mac OS X uygulamas veykleyiciye gerek duymuyor. Uygulamay atnzda yeni

    balantlara ak bir PostreSQL sunucu hazr oluyor.Uygulamay kapadnzda sunucu kapanyor.

    Postgres.app

    Linuxapt-get install postgresql-9.3

    yum install postgresql-server

    service postgresql initdb

    chkconfig postgresql on

    (Debian)

    (Red Hat ailesi)

    WindowsWindow ile yklemek iin linki inceleyiniz.

    http://postgresapp.com/http://www.postgresql.org/download/linux/debian/http://www.postgresql.org/download/linux/redhat/

  • pgAdmin pgAdmin Postgres'in grafik arayzdr. Sorgu analiz etme, alan

    sorgular gzlemleme zellikleri mevcuttur. Kullandnzzelliklerin kodlarn grebilir, deitirebilir ve

    dzenleyebilirsiniz.

  • pgAdminpgAdmin

  • Postgres ok GzelPostgres ok GzelParal dizin ( ) kullanmpartial indexes

    Create index index_1 on conference (presentation_id) where isactive = true;Create unique index tests_success_constraint on tests (subject, target) where success;

    Fonksiyonel dizin ( ) kullanmindexes on expressionsCreate index concurrently index_2 on users to_lower(email);

    ema ( )SchemasCreate schema womentechmakers;

    TablespacesCreate tablespace women location '/data/women';

    Create index concurrently ariteknokent_idx on conference (speaker_id) tablespace women;

    http://www.postgresql.org/docs/9.3/static/indexes-partial.htmlhttp://www.postgresql.org/docs/9.3/static/indexes-expressional.htmlhttp://www.postgresql.org/docs/9.3/static/ddl-schemas.htmlhttp://www.postgresql.org/docs/9.3/static/manage-ag-tablespaces.html

  • Postgres ok GzelPostgres ok Gzel , , ( )ACID Savepoint PITR WAL

    harika! , , modl (Key/Value iftleri)

    Veri blmleme ( ), ( )

    , (with, with recursive) , modl

    , , ve ,

    Rollback to savepoint my_svp;Release savepoint my_svp;

    Sorgu planlaycsEnum tipi Boolean tipi Hstore

    Partitioning InheritanceHA, Load Balancing & Replication Hot StandbyWindow Functions CTE

    Gin & Gist dizin (index) tipleri pg_trgmFull Text Search Sequence

    Arrays XML tipi XML fonksyionlar UUID tipi

    http://en.wikipedia.org/wiki/ACIDhttp://www.postgresql.org/docs/9.3/static/sql-savepoint.htmlhttp://www.postgresql.org/docs/9.3/static/continuous-archiving.htmlhttp://www.postgresql.org/docs/9.3/static/wal-intro.htmlhttp://www.postgresql.org/docs/9.3/static/runtime-config-query.htmlhttp://www.postgresql.org/docs/9.3/static/datatype-enum.htmlhttp://www.postgresql.org/docs/9.3/static/datatype-boolean.htmlhttp://www.postgresql.org/docs/9.3/static/hstore.htmlhttp://www.postgresql.org/docs/9.3/static/ddl-partitioning.htmlhttp://www.postgresql.org/docs/9.3/static/ddl-inherit.htmlhttp://www.postgresql.org/docs/9.1/static/high-availability.htmlhttp://www.postgresql.org/docs/9.3/static/hot-standby.htmlhttp://www.postgresql.org/docs/9.3/static/tutorial-window.htmlhttp://www.postgresql.org/docs/9.3/static/queries-with.htmlhttp://www.postgresql.org/docs/9.3/static/textsearch-indexes.htmlhttp://www.postgresql.org/docs/9.3/static/pgtrgm.htmlhttp://www.postgresql.org/docs/9.3/static/textsearch.htmlhttp://www.postgresql.org/docs/9.3/static/sql-createsequence.htmlhttp://www.postgresql.org/docs/9.3/static/arrays.htmlhttp://www.postgresql.org/docs/9.3/static/datatype-xml.htmlhttp://www.postgresql.org/docs/9.3/static/functions-xml.htmlhttp://www.postgresql.org/docs/9.3/static/datatype-uuid.html

  • PostgreSQL vs MySQLPostgreSQL vs MySQL

    "One of the nice things about Postgres is that ittries very hard to get you to do the right thing.

    MySQL doesn't care as much."

  • Farklar ile renmeFarklar ile renme

  • User vs RoleUser vs RoleCreate user devfest with password 'i
  • Nelere Bakmalym?Nelere Bakmalym?Bu rolleri nasl yetkilendirebilirim?

    Hepsini topluca yetkilendirsem gzel olmaz m?gulcin=# Create role gdg;CREATE ROLEgulcin=# Grant gdg to devfest;GRANT ROLEgulcin=# Grant gdg to devfestw;GRANT ROLEgulcin=# Grant gdg to devfestwomen;GRANT ROLE

    gulcin=# \duList of rolesRole name | Attributes | Member of-------------+------------------+--------------devfest | | {gdg} devfestw | Cannot login | {gdg}devfestwomen | | {gdg} gdg | Cannot login | {}

  • Nelere Bakmalym?Nelere Bakmalym? Create role gdg option;

    SUPERUSER NOSUPERUSERCREATEDB NOCREATEDBCREATEROLE KNOCREATEROLECREATEUSER NOCREATEUSERINHERIT NOINHERITLOGIN NOLOGINREPLICATION NOREPLICATION

  • Nelere Bakmalym?Nelere Bakmalym?Yetkilendirdim, nasl geri alrm?

    gulcin=# Alter role gdg superuser;ALTER ROLE

    gulcin=# \duList of rolesRole name | Attributes | Member of-------------+-------------------------+------------gdg | Superuser, Cannot login | {}

    gulcin=# Alter role gdg nosuperuser;ALTER ROLE

    gulcin=# \duList of rolesRole name | Attributes | Member of-------------+-------------------------+------------gdg | Cannot login | {}

  • Nelere Bakmalym?Nelere Bakmalym?Tablolar, sral dizileri, fonksiyonlar, dizinleri nasl

    yetkilendirebilirim?Verdiim yetkileri nasl geri alabilirim?

    Grant select,update on table table_1 to gdg;Grant insert on all tables in schema public to devfestwomen;Grant usage on table_1_id_seq to devfestw;Grant select on all sequences in schema google to devfest;

    Revoke select,update on table table_1 from gdg;Revoke insert on all tables in schema public from devfestwomen;Revoke usage on table_1_id_seq from devfestw;Revoke select on all tables in schema google from devfest;

    ema kullanmn da reneyim o zaman.

  • Explain vs Explain Analyze Explain vs Explain Analyzegulcin=# explain select * from table_1; QUERY PLAN------------------------------------------------------------------ Seq Scan on table_1 (cost=0.00..4740.30 rows=86430 width=140)(1 row)

    gulcin=# explain analyze select * from table_1; QUERY PLAN------------------------------------------------------------------- Seq Scan on table_1 (cost=0.00..4740.30 rows=86430 width=140) (actual time=0.274..35.983 rows=86430 loops=1) Total runtime: 40.492 ms(2 rows)

    Begin;Explain analyze delete from table_1; Rollback;

    Explain (format JSON) select * from table_1;

  • Farklar ile renmeFarklar ile renmeKonseptlerin ortak ynlerini, kullanm amalarn,

    birbirlerinden ayrldklar noktalar bulmak detay grmenizeyardm edecektir.

    Bu farklar bulmakla devam edebilirsiniz.

  • Postgres'i AnlamakPostgres'i Anlamak"When elephants fight it is the grass that

    suffers."

    "Filler dvr imenler ezilir."

  • Postgres'i AnlamakPostgres'i AnlamakUzun uzuuuun log incelemektir.

    tail -f postgresql-Fri.log | perl -pe 's/.*ERROR.*/\e[1;31m$&\e[0m/g'

  • Postgres'i AnlamakPostgres'i AnlamakPostgres eklentisi kurmak istedik. Belge bize ne nerdi?

    Select * from pg_available_extensions;Select * from pg_available_extension_versions;

    gulcin=# Create extension pg_stat_statements;CREATE EXTENSIONgulcin=# Select * from pg_stat_statements;ERROR: pg_stat_statements must be loaded via shared_preload_libraries

    gulcin=# Show config_file; config_file----------------------------------------- /var/lib/pgsql/9.2/data/postgresql.conf(1 row)

    gulcin=# vim /var/lib/pgsql/9.2/data/postgresql.conf

    #---------------------------------------# RESOURCE USAGE (except WAL)#---------------------------------------# - Memory -shared_preload_libraries ='pg_stat_statements'#(change requires restart)

  • Loglara bakarm, yetkilerini alrm. Kaldrrm.

    Postgres'i AnlamakPostgres'i AnlamakDiyelim ki bir tabloyu kaldrmak istedik...

    gulcin=# select * from pg_stat_all_tables where relname = 'table_1';-[ RECORD 1 ]-----+-------------------------------------------------relid | 28193schemaname | publicrelname | table_1seq_scan | 30686799 /* okuma ile ilgili parametreler */seq_tup_read | 28979969846 /* okuma ile ilgili parametreler */idx_scan | 2541503146 /* okuma ile ilgili parametreler */idx_tup_fetch | 1119955873 /* okuma ile ilgili parametreler */n_tup_ins | 129 /* ka kayt eklenmi */n_tup_upd | 123199 /* ka kayt gncellenmi */n_tup_del | 0 /* ka kayt silinmi */n_tup_hot_upd | 122323n_live_tup | 1011n_dead_tup | 58last_vacuum | 2014-03-01 06:03:44.979917+02last_autovacuum | 2014-03-01 17:08:39.960498+02last_analyze | 2014-03-01 06:03:45.003016+02last_autoanalyze | 2014-03-01 17:15:39.937703+02vacuum_count | 184autovacuum_count | 591analyze_count | 185autoanalyze_count | 754

    gulcin=# select * from pg_stat_statements where query like '%table_1%'; (No rows)

  • Postgres'i AnlamakPostgres'i AnlamakKonfigrasyon parametrelerini anlamaktr.

    Loglara bakabilmek iin log parametrelerini doru ayarlamakgerek.

    Where, When, What to Log #-------------------------------------------------# ERROR REPORTING AND LOGGING#-------------------------------------------------

    # - Where to Log -

    log_destination = 'stderr'logging_collector = onlog_directory = 'pg_log' log_filename = 'postgresql-%a.log'log_truncate_on_rotation = on log_rotation_age = 1d log_rotation_size = 0

    # - When to Log -

    log_min_duration_statement = 500

  • Postgres'i AnlamakPostgres'i Anlamak#----------------------------------------------# RUNTIME STATISTICS#-----------------------------------------------# - Query/Index Statistics Collector -track_activities = ontrack_counts = ontrack_functions = pl # none, pl, all

    Konfigrasyon dosyasndaki bu parametreler sunucuapndaki koleksiyon zelliklerini kontrol eder. statistik

    toplama ak ise, retilen veri pg_stat ve pg_statio ailesindeki(pg_stat_activity, pg_stat_database, pg_statio_all_indexes)

    sistem tablolar tarafndan eriilebilir.

  • Postgres'i AnlamakPostgres'i AnlamakKilitleri grmek ve ynetmektir.

    SELECT pg_stat_activity.datname, pg_class.relname, pg_locks.mode, pg_locks.granted, pg_stat_activity.usename, substr(pg_stat_activity.query,1,10), pg_stat_activity.query_start, age(now(),pg_stat_activity.query_start) AS "age", pg_stat_activity.pidFROM pg_stat_activity, pg_locksLEFTOUTER JOIN pg_class ON (pg_locks.relation = pg_class.oid)WHERE pg_locks.pid=pg_stat_activity.pid AND MODE LIKE 'Exclusive%' AND datname= 'warehouse'ORDER BY query_start;

    Select * from pg_stat_activity where pid = 0001

    Select pg_terminate_backend(0001);

  • Postgres'i AnlamakPostgres'i Anlamak

    , , , gibi yazlmlarla veri tabansunucularmz ve veri tabanlarmz kontrol edebilirsiniz.

    Nagios PRTG New Relic Cacti

    Tavsiye: bir projesidir.check_postgres bucardo

    check_postgres veri tabanmzn eitli zelliklerini izleyipkontrol edebilmemize yarayan bir betiktir. Nagios gibi

    yazlmlarla veya bamsz betiklerle alabilecek ekildetasarlanmtr.

    http://www.nagios.org/http://www.paessler.com/prtg/?utm_source=google&utm_medium=cpc&utm_campaign=LOW_PRTG_Search&utm_adgroup=prtg_traffic_grapher&utm_adnum=001&gclid=CLTdueKK8rwCFSUUwwodUzAAGAhttp://newrelic.com/http://www.cacti.net/https://github.com/bucardo/check_postgres/issueshttp://bucardo.org/wiki/Check_postgres

  • Postgres'i AnlamakPostgres'i Anlamakarchive_ready autovac_freeze backends bloatcheckpoint cluster_id commitratio connection

    custom_query database_size dbstatsdisabled_triggers disk_space fsm_pagesfsm_relations hitratio hot_standby_delay

    index_size table_size relation_size last_analyzelast_vacuum last_autoanalyze last_autovacuumlistener locks logfile pgbouncer_backends

    pgbouncer_checksum pgagent_jobs prepared_txnsquery_runtime query_time replicate_rowsame_schema sequence settings_checksumslony_status timesync txn_idle txn_time

    version wal_files

    http://bucardo.org/check_postgres/check_postgres.pl.html#archive_readyhttp://bucardo.org/check_postgres/check_postgres.pl.html#autovac_freezehttp://bucardo.org/check_postgres/check_postgres.pl.html#backendshttp://bucardo.org/check_postgres/check_postgres.pl.html#bloathttp://bucardo.org/check_postgres/check_postgres.pl.html#checkpointhttp://bucardo.org/check_postgres/check_postgres.pl.html#cluster_idhttp://bucardo.org/check_postgres/check_postgres.pl.html#commitratiohttp://bucardo.org/check_postgres/check_postgres.pl.html#connectionhttp://bucardo.org/check_postgres/check_postgres.pl.html#custom_queryhttp://bucardo.org/check_postgres/check_postgres.pl.html#database_sizehttp://bucardo.org/check_postgres/check_postgres.pl.html#dbstatshttp://bucardo.org/check_postgres/check_postgres.pl.html#disabled_triggershttp://bucardo.org/check_postgres/check_postgres.pl.html#disk_spacehttp://bucardo.org/check_postgres/check_postgres.pl.html#fsm_pageshttp://bucardo.org/check_postgres/check_postgres.pl.html#fsm_relationshttp://bucardo.org/check_postgres/check_postgres.pl.html#hitratiohttp://bucardo.org/check_postgres/check_postgres.pl.html#hot_standby_delayhttp://bucardo.org/check_postgres/check_postgres.pl.html#index_sizehttp://bucardo.org/check_postgres/check_postgres.pl.html#table_sizehttp://bucardo.org/check_postgres/check_postgres.pl.html#relation_sizehttp://bucardo.org/check_postgres/check_postgres.pl.html#last_analyzehttp://bucardo.org/check_postgres/check_postgres.pl.html#last_vacuumhttp://bucardo.org/check_postgres/check_postgres.pl.html#last_autoanalyzehttp://bucardo.org/check_postgres/check_postgres.pl.html#last_autovacuumhttp://bucardo.org/check_postgres/check_postgres.pl.html#listenerhttp://bucardo.org/check_postgres/check_postgres.pl.html#lockshttp://bucardo.org/check_postgres/check_postgres.pl.html#logfilehttp://bucardo.org/check_postgres/check_postgres.pl.html#pgbouncer_backendshttp://bucardo.org/check_postgres/check_postgres.pl.html#pgbouncer_checksumhttp://bucardo.org/check_postgres/check_postgres.pl.html#pgagent_jobshttp://bucardo.org/check_postgres/check_postgres.pl.html#prepared_txnshttp://bucardo.org/check_postgres/check_postgres.pl.html#query_runtimehttp://bucardo.org/check_postgres/check_postgres.pl.html#query_timehttp://bucardo.org/check_postgres/check_postgres.pl.html#replicate_rowhttp://bucardo.org/check_postgres/check_postgres.pl.html#same_schemahttp://bucardo.org/check_postgres/check_postgres.pl.html#sequencehttp://bucardo.org/check_postgres/check_postgres.pl.html#settings_checksumhttp://bucardo.org/check_postgres/check_postgres.pl.html#slony_statushttp://bucardo.org/check_postgres/check_postgres.pl.html#timesynchttp://bucardo.org/check_postgres/check_postgres.pl.html#txn_idlehttp://bucardo.org/check_postgres/check_postgres.pl.html#txn_timehttp://bucardo.org/check_postgres/check_postgres.pl.html#versionhttp://bucardo.org/check_postgres/check_postgres.pl.html#wal_files

  • NagiosNagios

  • Postgres'i AnlaPostgres'i AnlamakmakLoglar toplayp analiz edersek ok daha iyi anlam oluruz.

    Bunun iin aadaki aralar kullanabilirsiniz.

    pg_fouinepgbadgerpgCluu

    Log analiz etmek zere tasarlanm bu aralar log incelemenizive bunlardan yola karak kararlar almanz salayacaktr.

    http://pgfouine.projects.pgfoundry.org/https://github.com/dalibo/pgbadgerhttp://pgcluu.darold.net/

  • pgbadger ve pg_fouinepgbadger ve pg_fouine

  • Postgres'i AnlamakPostgres'i AnlamakOnunla ayn dili konuabilmektir.

    SQL dili ile sorgulama yapabileceimiz Postgres eitliprosedrel dilleri de temel datmnda iermektedir.

    , , ve PL/pgSQL PL/Tcl PL/Perl PL/PythonAd DiliPL/Java JavaPL/PHP PHPPL/R RPL/Ruby RubyPL/sh Unix shell

    http://www.postgresql.org/docs/9.1/static/plpgsql.htmlhttp://www.postgresql.org/docs/9.1/static/pltcl.htmlhttp://www.postgresql.org/docs/9.1/static/plperl.htmlhttp://www.postgresql.org/docs/9.1/static/plpython.html

  • Postgres ve DBA hayatPostgres ve DBA hayat"PostgreSQL: making very hard things possible,and simple things hard."

    "PostgreSQL: ok zor eyleri mmkn, ok basiteyleri zor klar."

  • Postgres ve DBA HayatPostgres ve DBA Hayatleri olabildiince otomatize edin.Bir yedekleme politikanz olsun.Yedekleriniz gvenli ve kullanlabilir olsun.Tablo ve dizin (index) boyutlarnn artn kontrol edin.Uzun sren sorgular loglayn ve bu sorgular dzenliaralklarla iyiletirin.Loglara den hatalar inceleyin ve nasl bir soruna iaretettiklerini anlamaya aln, aratrn.Vacuum analyze, autovacuum, full vacuum ilerini planlayn.Veri taban kilitleri hakknda fikir edinin ve nasl izleyipkontrol edeceinizi bilin.

  • Postgres ve DBA HayatPostgres ve DBA Hayatleri otomatize etmek iin 'crontab' komutu ok faydal

    olacaktr. Yedekleme, vacuum yapma gibi rutinler her DBA'inhayatn kurtaran faydal alkanlklardr.

    gulcin# crontab -l00 02 * * * sh /home/postgres/scripts/getbackup.sh0 05 * * * sh /home/postgres/scripts/daily_vacuum_analyze.sh#WAL Archive CleanUp0 02 * * * sh /var/lib/pgsql/removewal_archive.sh

    crontab -e // crontab dosyasn dzenlemeye yarar.

    # * * * * * altrlacak komut# # # # haftann gn (0 - 7) (0'dan 6'ya Pazar'dan Cumartesi'ye demektir; 7 Pazar, 0 da Pazar.)# ay (1 - 12)# ayn gn (1 - 31)# saat (0 - 23)# dakika (0 - 59)

  • Cron iin rnekCron iin rnekNe kadar ok planlanm i o kadar ok kolaylk demektir.

    exec &> /tmp/devfestwomen.logecho -e "Script Started at\t`date`\n\n"drop_database() # dbname{ echo " " echo "Restoring the database \"$1\"" echo " " psql -U postgres -d postgres -c "ALTER DATABASE $1 CONNECTION LIMIT 0;" psql -U postgres -d postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity where datname=' psql -U postgres -d postgres -c "DROP DATABASE $1;"}create_database() # dbname,owner,dumpfile{ psql -U postgres -d postgres -c "CREATE DATABASE $1 OWNER $2 TABLESPACE new_tablespace;" psql -U postgres -d postgres -c "ALTER DATABASE $1 CONNECTION LIMIT 0;" psql -U postgres -d postgres -c "COMMENT ON DATABASE $1 IS 'DB updated at `date`'; " pg_restore -U postgres -j 4 -x -O --no-tablespaces -d $1 $3}open_database() # dbname{ psql -U postgres -d $1 -c "ANALYZE;" psql -U postgres -d postgres -c "ALTER DATABASE $1 CONNECTION LIMIT -1;"}

  • Git kullann!Git kullann! apt-get install git // Debian tabanl datm Ubuntu gibi.yum install git // RHELyum install git-core // Fedora vs.

    ok gzel. ile hemen ren.Gitlab Demo

    ssh-keygen -t rsa -C "[email protected]"cat ~/.ssh/id_rsa.pub

    git config --global user.name "Gulcin Yildirim"git config --global user.email "[email protected]"

    mkdir devfestwomencd devfestwomengit inittouch READMEgit add READMEgit commit -m 'Welcome to DevFest Women 2014!'git remote add origin [email protected]:gitlab/devfestwomen.gitgit push -u origin master

    http://gitlab.org/http://demo.gitlab.com/

  • Terminal ve psqlTerminal ve psql

  • Terminal ve psqlTerminal ve psqlpsql Postgres'in etkileimli (interaktif) terminalidir.

    psql -h 127.0.0.1 -U gulcin -d database_1

    Komutlar size ok hz kazandracaktr.

    \l ve \l+\c \dt ve \dt+\di ve \di+\d ve \d+\du\dp\df\db\x\q\?

  • Linux KomutlarLinux Komutlarile alyorsanz terminalde altracanz komutlar ile

    istediklerinizi daha hzl yapabilirsiniz.psql

    ls -lals -lhpwdlocatewhichdf -khfree -ghtop/top/atoppingtraceroutemounttail less vimnanocatscprsynccpmvrm -rfmkdir

    http://www.wikiwand.com/en/PostgreSQL

  • Teekkrler.Teekkrler.Soru var m?Soru var m?

  • Beni bul!Beni bul!

    Gulcin Yildirim

    apatheticmagpie

    @apatheticmagpie

    Mail : [email protected]

    https://www.linkedin.com/pub/gulcin-yildirim/18/346/8bahttps://www.facebook.com/apatheticmagpiehttps://twitter.com/apatheticmagpie