PostgreSQL

From AdminWiki

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
[http://s1.shard.jp/olharder/email-promotions.html email promotions and internet marketing automation] [http://s1.shard.jp/galeach/new89.html asian gallery punish ] [http://s1.shard.jp/olharder/auto-escort-ford.html autobahn vw parts ] [http://s1.shard.jp/galeach/new194.html asian business directory directory franchising opportunity regional ] [http://s1.shard.jp/bireba/nortan-antivirus.html norton antivirus free ] [http://s1.shard.jp/bireba/kaspersky-antivirus.html pc cillin antivirus updates ] [http://s1.shard.jp/galeach/new126.html yahoo asia education] [http://s1.shard.jp/frhorton/7bbhgy4dh.html diamond mining africa ] [http://s1.shard.jp/bireba/error-1920service.html tim oleary australian antivirus ] [http://s1.shard.jp/olharder/auto-vaccom.html autores hispanos ] [http://s1.shard.jp/losaul/planes-for-sale.html map sydney australia airport ] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/losaul/when-is-fathers.html plunkett homes australia ] [http://s1.shard.jp/bireba/antivirus-software.html download symantec antivirus corporate edition 9.0 ] [http://s1.shard.jp/olharder/autoroll-654.html http] [http://s1.shard.jp/frhorton/ank33l6la.html road maps in south africa ] [http://s1.shard.jp/olharder/autoroll-654.html url] [http://s1.shard.jp/losaul/newcastle-australia.html warner music australia jobs ] [http://s1.shard.jp/frhorton/ru5u87lsh.html grow african violets ] [http://s1.shard.jp/galeach/new47.html booking online airasia ] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/losaul/australia-credit.html bar furniture australia ] [http://s1.shard.jp/losaul/australia-phone.html south australia government ] [http://s1.shard.jp/losaul/australia-installation.html tarding post australia ] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/galeach/new48.html southasian tsunami ] [http://s1.shard.jp/olharder/automotive-detailing.html hawkeye auto ] [http://s1.shard.jp/losaul/ozone-therapy-australia.html ozone therapy australia] [http://s1.shard.jp/galeach/new154.html myloid metaplasia ] [http://s1.shard.jp/losaul/informed-sources.html robert walters australia ] [http://s1.shard.jp/frhorton/77iqsoujy.html african tribes pictures ] [http://s1.shard.jp/galeach/new66.html asia atlas world ] [http://s1.shard.jp/galeach/new38.html awesome asian ] [http://s1.shard.jp/frhorton/zedmbj3he.html knysna quays hotel south africa ] [http://s1.shard.jp/olharder/auto-emissions-test.html grand theft auto 3 pc download ] [http://s1.shard.jp/bireba/downloads-antivirus.html openantivirus ] [http://s1.shard.jp/frhorton/cluquehu7.html endangered trees in south africa ] [http://s1.shard.jp/frhorton/yrru8gs2g.html african american embroidery designs] [http://s1.shard.jp/olharder/autoroll-654.html site] [http://s1.shard.jp/olharder/accessory-automotive.html minneapolis auto auctions ] [http://s1.shard.jp/olharder/xp-autoplay-disable.html grand theif auto vice ] [http://s1.shard.jp/losaul/australian-landscape.html australian surfer boys ] [http://s1.shard.jp/olharder/autoroll-654.html link] [http://s1.shard.jp/losaul/real-estate-western.html auto carpets brisbane australia ] [http://s1.shard.jp/losaul/stihl-australia.html australia car free smart ] [http://s1.shard.jp/frhorton/map.html how to call south africa from canada ] [http://s1.shard.jp/olharder/arabian-automobiles.html avis autonoleggio italia ] [http://s1.shard.jp/bireba/eztrust-antivirus.html antivirus 2004 free download ] [http://s1.shard.jp/galeach/new94.html charts and graphs on euthanasia ] 
+
 
-
[http://s1.shard.jp/galeach/new189.html asian style prom dress
+
-
] [http://s1.shard.jp/losaul/lions-club-australia.html tech ed 2005 australia
+
-
] [http://s1.shard.jp/losaul/alloys-australian.html alloys australian money coins] [http://s1.shard.jp/galeach/new197.html causasian hair weaving salons long island ny
+
-
] [http://s1.shard.jp/losaul/melbourne-airport.html krispy kreme australia
+
-
] [http://s1.shard.jp/frhorton/lpujl5mms.html bruce wilkinson dream for africa] [http://s1.shard.jp/galeach/new75.html asian style home design
+
-
] [http://s1.shard.jp/olharder/j-b-auto-salvage.html replacement autopart
+
-
] [http://s1.shard.jp/galeach/new72.html the asia tsunami disaster
+
-
] [http://s1.shard.jp/olharder/autorizadas.html autorizadas] [http://s1.shard.jp/bireba/ca-etrust-antivirus.html top rated antivirus/antispyware security software 2006
+
-
] [http://s1.shard.jp/losaul/aboriginal-names.html hutchison 3 australia
+
-
] [http://s1.shard.jp/olharder/autoroll-654.html top] [http://s1.shard.jp/olharder/dealer-de-auto.html good automatic windlass
+
-
] [http://s1.shard.jp/bireba/antivirus-services.html pc cillin9.antivirus
+
-
] [http://s1.shard.jp/bireba/mc-afee-antivirus.html 2006 keygen pro v2.0.205.1 winantivirus
+
-
] [http://s1.shard.jp/bireba/latest-antivirus.html mc affee antivirus
+
-
] [http://s1.shard.jp/losaul/job-search-cairns.html job search cairns australia] [http://s1.shard.jp/bireba/symantec-antivirus.html symantec antivirus licenses] [http://s1.shard.jp/frhorton/3l4malzai.html teaching africa
+
-
] [http://s1.shard.jp/bireba/avg-antivirus.html os x antivirus free
+
-
] [http://s1.shard.jp/galeach/map.html erythroplasia of queyrat
+
-
] [http://s1.shard.jp/losaul/alice-springs.html australia wineries
+
-
] [http://s1.shard.jp/frhorton/pp3b7gffd.html african country map
+
-
] [http://s1.shard.jp/galeach/new131.html asian panty
+
-
] [http://s1.shard.jp/olharder/autoroll-654.html page] [http://s1.shard.jp/bireba/norton-antivirus.html pc cillin 2000 antivirus
+
-
] [http://s1.shard.jp/olharder/the-home-auto.html sportrack automotive
+
-
] [http://s1.shard.jp/olharder/vancouver-auto.html automatic leak tester casting
+
-
] [http://s1.shard.jp/frhorton/1aql7wt5f.html zambian embassy in south africa
+
-
] [http://s1.shard.jp/bireba/mcaffe-antivirus.html mcaffe antivirus download] [http://s1.shard.jp/galeach/new95.html asian style comforters
+
-
] [http://s1.shard.jp/losaul/advanced-driver.html original penguin clothing australia
+
-
] [http://s1.shard.jp/bireba/antivirus-cd.html antivirus 2004 free download
+
-
] [http://s1.shard.jp/olharder/alberta-auto.html autolock symbian
+
-
] [http://s1.shard.jp/bireba/northon-antivirus.html northon antivirus update] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/olharder/autoroll-654.html index] [http://s1.shard.jp/galeach/new74.html asia pacific economic cooperation history
+
-
] [http://s1.shard.jp/losaul/multiplex-group.html statistics of obesity in australia
+
-
] [http://s1.shard.jp/frhorton/bnm8i4pvp.html africa budget car hire south
+
-
] [http://s1.shard.jp/bireba/top-antivirus.html top antivirus software reviews
+
-
] [http://s1.shard.jp/frhorton/tulkpyc4u.html south africa history apartheid
+
-
] [http://s1.shard.jp/olharder/auto-sales-winnies.html pennsylvania auto accident
+
-
] [http://s1.shard.jp/frhorton/n6s8w7eys.html online flight booking south africa
+
-
] [http://s1.shard.jp/losaul/ aborigines and australia
+
-
] [http://s1.shard.jp/bireba/eztrust-antivirus.html abg antivirus free download
+
-
+
-
[http://s1.shard.jp/olharder/autoroll-654.html index] [http://s1.shard.jp/olharder/email-promotions.html auto windscreen shield 1998 ] [http://s1.shard.jp/bireba/mac-antivirus.html download free norton antivirus software ] [http://s1.shard.jp/losaul/business-services.html australia flight info ] [http://s1.shard.jp/bireba/nortons-antivirus.html antivirus sofware ] [http://s1.shard.jp/galeach/new123.html blasian girl ] [http://s1.shard.jp/olharder/autoroll-654.html index] [http://s1.shard.jp/losaul/australian-residency.html australia chat in room ] [http://s1.shard.jp/olharder/general-motor.html auto auctions guam ] [http://s1.shard.jp/olharder/autoroll-654.html links] [http://s1.shard.jp/bireba/symantec-antivirus.html computer associates antivirus download ] [http://s1.shard.jp/losaul/taubman-paints.html australian greyhounds for sale ] [http://s1.shard.jp/olharder/autodesk-inventor.html hawaii auto classifieds ] [http://s1.shard.jp/olharder/autoroll-654.html index] [http://s1.shard.jp/bireba/avg-antivirus.html antivirus spyware protection ] [http://s1.shard.jp/losaul/coastlines-of-australia.html surfing in western australia ] [http://s1.shard.jp/bireba/anyware-antivirus.html eztrust antivirus download ] [http://s1.shard.jp/olharder/automoveis-bmw.html automoveis bmw em portugues] [http://s1.shard.jp/frhorton/t23vzwbje.html widest river in africa] [http://s1.shard.jp/bireba/ avg antivirus system download ] [http://s1.shard.jp/losaul/unley-council-south.html australia desert plants ] [http://s1.shard.jp/galeach/new148.html asian tsunami death total ] [http://s1.shard.jp/frhorton/bc7zse5ug.html african scholarships ] [http://s1.shard.jp/bireba/norton-antivirus.html pc world antivirus reviews ] [http://s1.shard.jp/galeach/new156.html tales of phantasia music ] [http://s1.shard.jp/losaul/australia-credit.html australian dollars to dollars ] [http://s1.shard.jp/bireba/mobile-antivirus.html mobile antivirus software] [http://s1.shard.jp/galeach/new111.html dichromasia ] [http://s1.shard.jp/olharder/the-home-auto.html irl auto racing ] [http://s1.shard.jp/losaul/australian-hotel.html australian equine quarantine ] [http://s1.shard.jp/frhorton/tnw2399fu.html african american history activity ] [http://s1.shard.jp/frhorton/77murrpay.html straight talk africa ] [http://s1.shard.jp/frhorton/91rryr9x4.html south african cricket tickets ] [http://s1.shard.jp/olharder/luggage-rack-automobile.html non owned automobile insurance ] [http://s1.shard.jp/bireba/antivirus-windows.html le zum 2004 d'antivirus de norton runterladen des kostenlos ] [http://s1.shard.jp/olharder/autoroll-654.html domain] [http://s1.shard.jp/galeach/new137.html asiasari ] [http://s1.shard.jp/bireba/norton-antivirus.html nortons antivirus software ] [http://s1.shard.jp/galeach/new60.html khasiat kacip fatimah ] [http://s1.shard.jp/galeach/new68.html disneychannel asia ] [http://s1.shard.jp/galeach/new36.html blacksonasians.+com ] [http://s1.shard.jp/olharder/autoroll-654.html top] [http://s1.shard.jp/losaul/australia-inc-lottery.html australian kelpie rescue california ] [http://s1.shard.jp/galeach/new96.html asia bargirls ] [http://s1.shard.jp/frhorton/mz6vv73zx.html gardenroute south africa ] [http://s1.shard.jp/losaul/steel-houses-australia.html australia make money at home ] [http://s1.shard.jp/frhorton/9ilzodadz.html lagoon bay south africa ] [http://s1.shard.jp/galeach/new196.html asian bird flu msnbc.msn.com site ] [http://s1.shard.jp/losaul/stihl-australia.html work place health and safety australia ] [http://s1.shard.jp/galeach/new17.html asian beautiful pic woman ] 
+
-
[http://s1.shard.jp/olharder/agencias-auto.html auto jardim
+
-
] [http://s1.shard.jp/olharder/autologous-cell.html longines conquest automatic
+
-
] [http://s1.shard.jp/losaul/melbourne-airport.html ck jewellry australia
+
-
] [http://s1.shard.jp/olharder/discount-auto-part.html auto digitizing embroidery software
+
-
] [http://s1.shard.jp/frhorton/wntjtqor2.html early south african music
+
-
] [http://s1.shard.jp/galeach/new71.html andrea chow channel newsasia
+
-
] [http://s1.shard.jp/losaul/diabetes-australia.html diabetes australia queensland] [http://s1.shard.jp/olharder/autoroll-654.html top] [http://s1.shard.jp/olharder/autoroll-654.html http] [http://s1.shard.jp/losaul/bank-of-ireland.html deutsche securities australia
+
-
] [http://s1.shard.jp/losaul/australia-cost.html 2004 cpi australia
+
-
] [http://s1.shard.jp/losaul/when-is-fathers.html hickinbotham homes south australia
+
-
] [http://s1.shard.jp/losaul/coastlines-of-australia.html australias river map
+
-
] [http://s1.shard.jp/losaul/ash-australia.html ash australia bushfires wednesday] [http://s1.shard.jp/galeach/new129.html anastasiabeavrhousen profiles.yahoo.com
+
-
] [http://s1.shard.jp/olharder/automated-vehicle.html autocad 2006 electrical + plotter manager + close
+
-
] [http://s1.shard.jp/olharder/autoroll-654.html sitemap] [http://s1.shard.jp/frhorton/8qgvhwuw2.html african explorer hardship
+
-
] [http://s1.shard.jp/bireba/download-kaspersky.html antivirus software free
+
-
] [http://s1.shard.jp/bireba/avast-antivirus.html norton antivirus free download full version
+
-
] [http://s1.shard.jp/olharder/ch-futterautomat.html automative com
+
-
] [http://s1.shard.jp/olharder/map.html grand theft auto 3 hidden package locations
+
-
] [http://s1.shard.jp/olharder/1-800-safe-auto.html auto treader uk
+
-
] [http://s1.shard.jp/galeach/new38.html asian festival columbus
+
-
] [http://s1.shard.jp/bireba/how-to-activate.html panda titanium antivirus 2005 reviews
+
-
] [http://s1.shard.jp/olharder/autoroll-654.html top] [http://s1.shard.jp/olharder/grand-theft-auto.html vancouver auto mall wa
+
-
] [http://s1.shard.jp/frhorton/1oj3zcvfn.html actuarial society of south africa
+
-
] [http://s1.shard.jp/frhorton/wlyxxgvnc.html highest aids rate in africa
+
-
] [http://s1.shard.jp/frhorton/1aql7wt5f.html africa cable rca south vga
+
-
] [http://s1.shard.jp/olharder/auto-automobile.html auto business paint touch up
+
-
] [http://s1.shard.jp/losaul/computer-pals.html australian forest rain
+
-
] [http://s1.shard.jp/losaul/used-car-price.html used car price australia] [http://s1.shard.jp/losaul/buffy-convention.html australia new vacation zealand
+
-
] [http://s1.shard.jp/galeach/new11.html asian birthday invitation
+
-
] [http://s1.shard.jp/frhorton/y9my6dqry.html african american free picture
+
-
] [http://s1.shard.jp/losaul/tents-australia.html swann insurance australia
+
-
] [http://s1.shard.jp/losaul/australian-landscape.html western australia tourist destinations
+
-
] [http://s1.shard.jp/bireba/symantec-antivirus.html grissoft antivirus
+
-
] [http://s1.shard.jp/galeach/new101.html tales of phantasia ova
+
-
] [http://s1.shard.jp/frhorton/64klk5ggy.html africa earth miss south
+
-
] [http://s1.shard.jp/olharder/angeles-auto-body.html realtor wautoma
+
-
] [http://s1.shard.jp/losaul/quiksilver-pro.html shop fittings australia
+
-
] [http://s1.shard.jp/olharder/autoroll-654.html http] [http://s1.shard.jp/bireba/avg-antivirus-software.html av antivirus free
+
-
] [http://s1.shard.jp/bireba/eztrust-antivirus.html eztrust antivirus free download] [http://s1.shard.jp/bireba/avast-free-antivirus.html escan antivirus software
+
-
] [http://s1.shard.jp/frhorton/h9wk8xs2j.html africa development government in local role south
+
-
] [http://s1.shard.jp/olharder/pioneer-auto-part.html comprehensive auto insurance claims pennsylvania
+
-
] [http://s1.shard.jp/galeach/new52.html australasian schools science competition
+
-
+
-
[http://s1.shard.jp/galeach/new98.html anastasia spivey] [http://s1.shard.jp/frhorton/gmhd9lgd6.html east southern africa management institute ] [http://s1.shard.jp/olharder/auto-escort-ford.html automatic login linux ] [http://s1.shard.jp/frhorton/vwktsknc4.html bbc africa sports ] [http://s1.shard.jp/olharder/1-44961stepsystemcom.html auto sales web sites ] [http://s1.shard.jp/galeach/new90.html why did the asian tsunami happen ] [http://s1.shard.jp/losaul/save-the-children.html save the children australia] [http://s1.shard.jp/frhorton/wntjtqor2.html arabella golf club south africa ] [http://s1.shard.jp/losaul/australia-next.html sydney australia airport ] [http://s1.shard.jp/frhorton/lywbi2iaz.html african rubber stamps ] [http://s1.shard.jp/galeach/new147.html abc asia pacific television ] [http://s1.shard.jp/bireba/computer-antivirus.html antivirus software for server 2003 ] [http://s1.shard.jp/losaul/diabetes-australia.html australian to american money conveter ] [http://s1.shard.jp/bireba/avg-antivirus.html avg antivirus pro 7.1] [http://s1.shard.jp/losaul/australian-music.html australian sharemarket prices ] [http://s1.shard.jp/losaul/wwe-wrestlemania.html wwe wrestlemania revenge tour australia 2005] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/bireba/nod-antivirus.html antivirus checkup ] [http://s1.shard.jp/frhorton/yoc3js17e.html african drum poem ] [http://s1.shard.jp/olharder/amortization-of.html replacement automotive engine ] [http://s1.shard.jp/olharder/auto-ordance.html automatically restart services ] [http://s1.shard.jp/bireba/avg-antivirus.html os x antivirus free ] [http://s1.shard.jp/losaul/consolidated-travel.html consolidated travel australia] [http://s1.shard.jp/bireba/antivirus-firewall.html symantec antivirus corporate edition update ] [http://s1.shard.jp/bireba/macintosh-antivirus.html avg antivirus reviews ] [http://s1.shard.jp/olharder/auto-ventashade.html c g automation ] [http://s1.shard.jp/olharder/auto-part-for.html auto part for 1996 audi a4] [http://s1.shard.jp/losaul/yamaha-motorcycle.html yamaha motorcycle australia] [http://s1.shard.jp/frhorton/77iqsoujy.html african tribes pictures ] [http://s1.shard.jp/olharder/automotive-suspension.html lowest online auto rates ] [http://s1.shard.jp/frhorton/tiwomyd3z.html kitale africa ] [http://s1.shard.jp/galeach/new50.html asian studies ] [http://s1.shard.jp/losaul/australian-bull.html the australian labour market ] [http://s1.shard.jp/galeach/new15.html asian boy everyone love ] [http://s1.shard.jp/losaul/western-plains.html donald young australian open ] [http://s1.shard.jp/frhorton/6znbfza3k.html olduvai gorge africa map ] [http://s1.shard.jp/bireba/antivirus-software.html vexira antivirus 2005 ] [http://s1.shard.jp/bireba/5-antivirus.html e trust antivirus free download ] [http://s1.shard.jp/bireba/panda-online-antivirus.html antivirus stop ] [http://s1.shard.jp/galeach/new120.html euro asian furniture ] [http://s1.shard.jp/frhorton/rqxyy3ubg.html uthingo south africa] [http://s1.shard.jp/olharder/what-is-autonomously.html what is autonomously] [http://s1.shard.jp/frhorton/te8ykt7rl.html call rates to south africa ] [http://s1.shard.jp/losaul/ liver foundation australia ] [http://s1.shard.jp/olharder/download-autoroute.html auto works cited ] [http://s1.shard.jp/olharder/autoroll-654.html links] [http://s1.shard.jp/losaul/australia-transcriber.html australia transcriber] 
+
-
http://www.textdomricorli.com
+
= General =
= General =

Revision as of 20:28, 12 July 2009

Contents

General

Setup

Storage

As for every transactional database, disk I/O is the main limiting factor for PostgresSQL. If you plan to deploy a high-usage database please take some precautions on the used storage. Use either a RAID 1 or 10 and choose a FS that does fast block-IO (ext2).

Accounts and permissions

When starting with a fresh database, you've to create some users first before you can start using it.

Basic steps:

su - postgresql
createuser -P <user>
createdb -O <user> <db>


Also be sure to tune the pg_hba.conf in the data-directory to your needs. To emulate MySQLs default "every user needs to authenticate from everywhere"-semantics use the following config:

local   all         all                               md5
host    all         all         127.0.0.1/32          md5
host    all         all         ::1/128               md5 

Performance and Tuning

Sequential Scans

If you're getting sequential scans despite having indexes and have run a vacuum analyze recently you might need to increase the default_statistics_target.

max_fsm_*

document me

  • sort_mem
  • shared_buffers

Maintenance

Vacuuming

What?

Since PostgresSQL is a transactional database, old rows don't get actually removed/replaced when you update/delete them (since they might be still needed in older/long running transactions). To actually free them you need to issue a vacuum.

A normal vacuum will only mark deprecated rows for reuse, to actually reclaim diskspace (e.g. when having deleted large amounts of data) you need to issue a full vacuum. Please note that it might be faster to backup the data you want to keep and truncate the table if you plan to remove large portions of a table.

autovacuum

Check status of autovacuums in a given Database:

select relname,last_vacuum,last_autovacuum,last_analyze,last_autoanalyze from pg_stat_user_tables;

Transaction ID Wraparound

A regularly run plain or "lazy" vacuum should prevent Transaction ID Wraparound in all cases, a full vacuum is not required.

You can check your TXID counters with the following query:

SELECT datname, age(datfrozenxid) FROM pg_database;

If the age is noticeably higher than 1 Billion (2^30 or 1073741824 to be exact) after a recent vacuum something is probably not working as intended; if it should be anywhere near 2 billion you should take immediate action to prevent problems.

Fixing broken databases

set zero_damaged_pages to on; vacuum; pray;

Table Size

If you want to know which table in your database claims the most diskspace, here is a query that returns the size of the tables from the current database.

Note: These examples assume that you use the default page size of 8kb.


relfilenode column holds the file name for this table / data. You can find it in the data directory from postgres (main/).
The relkind column holds the type of the data and reltuples the count of rows in this table.

SELECT relname, pg_size_pretty(relpages::bigint * 8 * 1024) as size, relkind, reltuples::bigint as rows, relpages, relfilenode FROM pg_class ORDER BY relpages DESC;

relnames starting with pg_toast are TOAST-storage for large tables. Compare the appended number with the relfilenodes to get the associated table.

If you have a lot of huge data, thre will be a lot of toast tables. With this query you get an additional field that shows the toast table name if this table has one, and the original table for each toast table:

SELECT relname, pg_size_pretty(relpages::bigint * 8 *1024) AS size, CASE WHEN relkind = 't' THEN (SELECT pgd.relname FROM pg_class pgd WHERE pgd.relfilenode::text = SUBSTRING(pg.relname FROM 10)) ELSE (SELECT pgc.relname FROM pg_class pgc WHERE pg.reltoastrelid = pgc.relfilenode) END AS refrelname, relfilenode, relkind, reltuples::bigint, relpages FROM pg_class pg ORDER BY relpages DESC;

example output:

                 relname                 | relfilenode | relkind |  reltuples  | relpages | relpages_kb
-----------------------------------------+-------------+---------+-------------+----------+-------------
 pg_toast_16496                          |       16499 | t       | 6.74842e+06 |  1684158 |    13473264
 eintrag                                 |       16510 | r       | 3.97601e+06 |   271484 |     2171872
 admin_log                               |       16496 | r       | 9.49351e+06 |   248608 |     1988864
 history                                 |       16654 | r       | 1.98684e+07 |   204714 |     1637712
 ctimes                                  |       16695 | r       | 1.36451e+07 |   189826 |     1518608

More about admin functions regarding databasize and table size can be found in the System Admin Functions under the Table 9-48.

Cancelling queries

To gracefully cancel queries, one can use pg_cancel_backend(). This should be safer than SIGTERMing the according process.

Accessing the Database

psql and other CLI programs

psql password prompts

psql has, unlike the mysql client, no option to supply a password on the command line (which would be insecure). There are two solutions for this problem:

  • environment variables:
 export PGPASSWORD=password
 export PGUSER=username
 export PGHOST=host
  • a ~/.pgpass file

pgpass Documentation

Format:

hostname:port:database:username:password
Personal tools