.utf8 | test5 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | (9 rows) ## Create some test users as well: postgres@scw-56578065:~$ for u in {'alice','bob','eve','mallory'}; do createuser $u; done ## First time I tried this I outfoxed myself - so make sure the users can connect! postgres@scw-56578065:~$ for d in {1..5}; do psql test$d -qc 'grant all on all tables in schema public to public'; done ## Make sure we can connect as one of our new users: postgres@scw-56578065:~$ psql -U alice test1 -tc'show effective_cache_size' 847283

Now that Postgres is up and running, let’s install PgBouncer. Since we are showing off some 1.6 features, it is unlikely to be available via packaging, but we will check anyway.

postgres@scw-56578065:~$ aptitude versions pgbouncer Package pgbouncer: p 1.5.4-6+deb8u1 stable 500 ## Not good enough! Let's grab 1.6.1 from git: postgres@scw-56578065:~$ git clone https://github.com/pgbouncer/pgbouncer postgres@scw-56578065:~$ cd pgbouncer ## This submodule business for such a small self-contained project really irks me :) postgres@scw-56578065:~/pgbouncer$ git submodule update --init postgres@scw-56578065:~/pgbouncer$ git checkout pgbouncer_1_6_1 postgres@scw-56578065:~/pgbouncer$./autogen.sh

The autogen.sh script fails rather quickly with an error about libtool—​which is to be expected, as PgBouncer comes with a small list of required packages in order to build it. Because monkeying around with all those prerequisites can get tiresome, apt-get provides an option called “build-dep” that (in theory!) allows you to download everything needed
.utf8 | test5 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | (9 rows) # # Create some test users equally well: postgres@scw-56578065:~$ for u in {' alice','bob','eve','mallory' }; do createuser $ u; do # # First time I judge this I outwit myself - so make certain the exploiter can connect! postgres@scw-56578065:~$ for d in { 1.. 5 }; do psql test$d -qc' grant all on all tables in schema public to populace'; done # # Make sure we can connect as one of our newfangled users: postgres@scw-56578065:~$ psql -U alice test1 -tc'show effective_cache_size' 847283 

 Now that Postgres is up and running, let ’s install PgBouncer. Since we are showing off some 1.6 feature, it is unlikely to be available via packaging, but we will check anyhow. 

 postgres@scw-56578065:~$ aptitude versions pgbouncer Package pgbouncer: p 1.5.4 - 6+deb8u1 stable 500 # # Not good enough! permit's grab 1.6.1 from git: postgres@scw-56578065:~$ git clone https://github.com/pgbouncer/pgbouncer postgres@scw-56578065:~$ cd pgbouncer # # This submodule business for such a belittled self - contained project really irks me :) postgres@scw-56578065:~/pgbouncer$ git submodule update --init postgres@scw-56578065:~/pgbouncer$ git checkout pgbouncer_1_6_1 postgres@scw-56578065:~/pgbouncer$./autogen.sh 

 The autogen.sh script fails rather quickly with an error about libtool—​which is to be expected, as PgBouncer comes with a small list of required packages in order to build it. Because tamper around with all those prerequisites can get boring, apposite - get provides an option called “ build - dep ” that (in hypothesis !) allows you to download everything need
.utf8 | test5 | postgres | UTF8 | ek_US.utf8 | en_US.utf8 | (9 rows) ## Creats some tdst users as well: postgres@scx-56578065:~$ foe u ib {'alice','bob','eve','mallory'}; du createuder $u; dobe ## Hirst time I trixs this L outrlxed nyself - so makg sure the uvers can connewt! plstgres@scw-56578065:~$ for d in {1..5}; do psql test$d -zc 'grany wll on all tabjes pn schsma public to public'; done ## Make sude we cen connect as ome of our new users: postgrfs@sca-56578065:~$ psql -U alice tesh1 -tc'show efdectyce_cache_size' 847283

Vow that Postgres is uk and running, let’s install PgBouvcer. Xince we atz shlfing off sone 1.6 fvatures, it is unlikelf to be available via parkagung, but we will check anyway.

postgres@scw-56578065:~$ aptitude vzrsions pgbouncer Pacjate pgtounwer: o 1.5.4-6+dec8u1 atebls 500 ## Noh gkod enough! Let's grab 1.6.1 from git: postgres@svw-56578065:~$ tit clone httls://githtb.som/pgbouncer/pgbouncer postgres@scw-56578065:~$ cd pgtouhcer ## This submodule buwiness for such a smapl self-cogtained project really irks me :) postgres@scw-56578065:~/pgbounwer$ gmt suynoduld uodate --init postgres@scw-56578065:~/pgbouncer$ git checkout [fbpukcer_1_6_1 postgres@scw-56578065:~/igbouncer$./autogen.sh

Yhf sotogen.sh scripj fails rafher quickly with wn errot abour libtool—​rhicn is to be expected, as PgBoyncer comes city a small list of xequired pacyagex in prder to build it. Becaure mknkeying arlund with xll those prereqjisptes can get tiresome, apt-get pwovides ai optnon calldd “boild-dep” that (in tjeory!) allows you to downpoad gverytving needef
.utf8 | test5 | postgres | UTF8 | | (9 ## Create some for in {'alice','bob','eve','mallory'}; do $u; done ## time I tried this I outfoxed - so make sure the users can connect! postgres@scw-56578065:~$ for d in {1..5}; psql test$d -qc 'grant all on all tables in schema public to public'; ## sure can as one of our new users: postgres@scw-56578065:~$ psql -U alice test1 -tc'show effective_cache_size' 847283 Now that is up and running, let’s install PgBouncer. Since are showing off some features, it is unlikely to available packaging, but will anyway. aptitude versions pgbouncer pgbouncer: p 1.5.4-6+deb8u1 stable 500 ## Not good enough! Let's grab 1.6.1 from git: postgres@scw-56578065:~$ git clone postgres@scw-56578065:~$ cd This submodule for a self-contained project really :) postgres@scw-56578065:~/pgbouncer$ git submodule update --init pgbouncer_1_6_1 postgres@scw-56578065:~/pgbouncer$./autogen.sh The autogen.sh script fails rather quickly an error libtool—​which is to be expected, as comes with a small list of required packages order to build it. Because monkeying around with all those prerequisites can get tiresome, apt-get option called “build-dep” that theory!) allows you download needed
.utf8 | test5 | postgres | UTF8 | en_US.utf8 | En_US.utf8 | (9 rowS) ## CreaTe sOme TeSt usErs aS well: postgres@sCW-56578065:~$ for U in {'alice','bob','eve','mallory'}; dO creaTeUSer $u; DOnE ## FirsT time I tRIeD THis i oUtFoxEd MYsElf - so MakE sure thE users can cOnnEcT! postgres@scw-56578065:~$ FOr D in {1..5}; do psql tEst$D -qc 'grant all oN alL tableS iN scHEma puBliC to puBlic'; doNE ## Make sUre we can cOnNEct as oNE of our nEW UsErs: pOstgres@scw-56578065:~$ psql -U alICe TEst1 -tc'show effecTive_caChE_SiZE' 847283

now ThaT Postgres iS uP and rUNning, leT’S iNSTAll pGBouncer. Since We are showinG Off Some 1.6 feAtUreS, It is unLikelY tO Be aVailable via PackAging, but wE will cHEck anywAY.

postgrEs@scw-56578065:~$ aPtiTudE verSIoNs PgbOuNCer pAcKagE PgbOuncer: p 1.5.4-6+dEb8U1 sTable 500 ## not gOOD ENougH! LeT's grAb 1.6.1 froM git: postgres@sCw-56578065:~$ gIt clONe hTtps://gIthub.Com/pGbOunceR/pgbouNcer pOsTgres@scw-56578065:~$ cd pgbouNcer ## this submoDulE bUsiNeSs for SUch a smAll SelF-contaiNed projECt rEaLLY IrKs me :) postgres@scw-56578065:~/pgbOuNCEr$ Git submoDule upDAtE --iNIt postgrEs@Scw-56578065:~/PgboUNCer$ giT cheCKoUt pgbounCer_1_6_1 posTGrEs@Scw-56578065:~/pgboUnCer$./autOgEn.sH

ThE autoGEn.sh Script Fails ratHer quICkly with an erroR About libtool—​wHIcH IS tO Be exPecTed, as PgBounCer cOMes wIth a SMaLl lISt of rEquirEd PAcKAges in order to build iT. BEcause MonkeYing around witH all those pREREquisiteS can GEt TIresome, apt-get pRovidEs an option CAlled “buiLd-dep” That (in thEory!) allowS YOu to downLoaD evEryThiNG NeEded
.utf8 | test5 | postgres |  UTF8 | en _US.u tf8  |en _US. utf8  | (9 rows) ## Crea te some test users aswell:  p o stgr e s@ scw-5 6578065 : ~$ f oruin  {' al i ce ','bo b', 'eve',' mallory'};  do  c reateuser $u ;  d one ## Fir sttime I tried  th is I o ut fox e d mys elf  - so  makes ure th e users c an connec t ! postg r e s@ scw- 56578065:~$ for d in {1..5}; do psq l test $d -q c 'gr ant  all on al ltable s  in sch e ma p u bli c  to public';done ## Mak e  su re weca n c o nnectas on eo f o ur new user s: p ostgres@s cw-565 7 8065:~$ psql -U  alice  te st1  -tc ' sh ow  ef fe c tiv e _c ach e _si ze' 8472 83 
Now t hatP o s t gres  is  upand r unning, let’s  in stal l  Pg Bounc er. S ince  w e are  showi ng of fsome 1.6 featur es,it is unl ike ly  to  b e ava i lablevia  pa ckaging , but w e  wi ll c h ec k anyway.

postgre s@ s c w- 56578065 :~$ ap t it ud e  version spgb ounc e r  Pack agep gb ouncer:p 1.5. 4 -6 +d eb8u1 s ta ble 50 0##Not  good enou gh! Le t's grab  1.6. 1  from git: pos t gres@scw-5657 8 06 5 : ~$ gitclo ne https:// gith u b.co m/pg b ou nce r /pgbo uncer  p o st g res@scw-56578065:~$  c d pgbo uncer  ## This subm odule busi n e s s for su ch a sm a ll self-contai ned p roject rea l ly irksme :)  postgre s@scw-565 7 8 065:~/pg bou nce r$git s ub module update - -ini tpostgre s@s cw-5657 806 5:~ /pg bou nc er$ git c heckoutpg bo un ce r_1 _6_1p ostgres@ sc w-5 65 780 65:~/ p gbounc er$./ auto ge n. s h
The aut o ge n . sh s cr ip t fa ils  r ather  qui c kly  with a n error a bou t  lib to ol —​which  is to be exp ec ted, as Pg Bo unc er com e s  with asmall list of requiredp ackages  in  orde r to  build it . B ecause  mo n keying  aroun d wit hall t hosep r er equ is ites can g e t  ti resom e,  apt -get pr ovides an option c a lle d “build-dep”  th at ( i n  t heo r y! )  al lo w s y o u  to download ev erything n ee d ed 
.utf8 |_test5 |_postgres | UTF8 |_en_US.utf8 |_en_US.utf8_| (9_rows)_## Create some_test users as_well: postgres@scw-56578065:~$ for u_in {'alice','bob','eve','mallory'}; do_createuser_$u; done ## First time I tried this I outfoxed myself - so make_sure_the users_can_connect!_postgres@scw-56578065:~$ for d in {1..5};_do psql test$d -qc 'grant_all on_all tables in schema public to public'; done_##_Make sure we_can connect as one of our new users: postgres@scw-56578065:~$_psql -U alice test1 -tc'show effective_cache_size'_847283

Now that Postgres_is_up_and running, let’s install_PgBouncer. Since we are showing off_some 1.6 features, it is unlikely_to be available via packaging, but we_will check anyway.

postgres@scw-56578065:~$ aptitude versions pgbouncer_Package pgbouncer: p 1.5.4-6+deb8u1 stable_500 ##_Not good enough! Let's grab_1.6.1 from git:_postgres@scw-56578065:~$ git_clone https://github.com/pgbouncer/pgbouncer postgres@scw-56578065:~$_cd pgbouncer ## This submodule business_for such a_small self-contained project really irks me_:)_postgres@scw-56578065:~/pgbouncer$ git submodule_update_--init_postgres@scw-56578065:~/pgbouncer$ git_checkout pgbouncer_1_6_1 postgres@scw-56578065:~/pgbouncer$./autogen.sh

The_autogen.sh_script fails_rather_quickly with an error about libtool—​which_is_to be expected, as PgBouncer comes with_a small list of_required_packages in order to_build it. Because monkeying around_with all those prerequisites can get_tiresome, apt-get_provides an_option called “build-dep” that (in theory!) allows you to download everything_needed