Re: [GENERAL] copying a large database to change encoding

2014-10-15 Thread Albe Laurenz
Matthew Chambers wrote: > Would something like this work best, or is it better to use pgdump? > > CREATE DATABASE newDatabase TEMPLATE oldDatabase ENCODING 'UTF8' > > Does using a template do a file system copy or just SQL copy everything over? Using the old database as template will not change

Re: [GENERAL] Will pg_repack improve this query performance?

2014-10-15 Thread Alban Hertroys
On 15 Oct 2014, at 4:33, Abelard Hoffman wrote: > I believe this query is well optimized, but it's slow if the all the blocks > aren't already in memory. > > Here's example explain output. You can see it takes over 7 seconds to run > when it needs to hit the disk, and almost all of it is rela

[GENERAL] How to start several PostgreSQL clusters at boot time on a Debian OS

2014-10-15 Thread Léa Massiot
Hello and thank you for reading my post. My question is about starting PostgreSQL clusters at boot time. The OS is Debian Wheezy. I have installed PostgreSQL from the sources (postgresql-9.3.5.tar.gz) at http://www.postgresql.org/ftp/source/v9.3.5/. In a shell and logged as "unprivileged_user" (

Re: [GENERAL] How to start several PostgreSQL clusters at boot time on a Debian OS

2014-10-15 Thread Guillaume Lelarge
Hi, 2014-10-15 12:18 GMT+02:00 Léa Massiot : > Hello and thank you for reading my post. > > My question is about starting PostgreSQL clusters at boot time. > > The OS is Debian Wheezy. > I have installed PostgreSQL from the sources (postgresql-9.3.5.tar.gz) at > http://www.postgresql.org/ftp/sour

[GENERAL] Re: How to start several PostgreSQL clusters at boot time on a Debian OS

2014-10-15 Thread Léa Massiot
It's perfect. Thank you very much. -- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-start-several-PostgreSQL-clusters-at-boot-time-on-a-Debian-OS-tp5823085p5823088.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-gen

Re: [GENERAL] How to start several PostgreSQL clusters at boot time on a Debian OS

2014-10-15 Thread Adrian Klaver
On 10/15/2014 03:18 AM, Léa Massiot wrote: Hello and thank you for reading my post. My question is about starting PostgreSQL clusters at boot time. The OS is Debian Wheezy. I have installed PostgreSQL from the sources (postgresql-9.3.5.tar.gz) at http://www.postgresql.org/ftp/source/v9.3.5/. I

[GENERAL] Any postgres API available to get errorcode for PQerrorMessage

2014-10-15 Thread Roopeshakumar Narayansa Shalgar (rshalgar)
HI, PQerrorMessage pirints the error message like (no space available,etc). Does postgres provide any API which gives the error code listed in the below appendix; http://www.postgresql.org/docs/9.1/static/errcodes-appendix.html I need the exact error code so that I can shutdown my application

Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

2014-10-15 Thread Tom Lane
"Roopeshakumar Narayansa Shalgar (rshalgar)" writes: > HI, > PQerrorMessage pirints the error message like (no space available,etc). Does > postgres provide > any API which gives the error code listed in the below appendix; > http://www.postgresql.org/docs/9.1/static/errcodes-appendix.html Use

Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

2014-10-15 Thread Rob Sargent
On 10/15/2014 02:17 AM, Roopeshakumar Narayansa Shalgar (rshalgar) wrote: HI, PQerrorMessage pirints the error message like (no space available,etc). Does postgres provide any API which gives the error code listed in the below appendix; http://www.postgresql.org/docs/9.1/static/errcodes-ap

Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

2014-10-15 Thread Roopeshakumar Narayansa Shalgar (rshalgar)
Thanks Tom, But that's not what I am looking for. I need the 'integer' errorcode equivalent of " errormsg string" returned by PQerrorMessage. /rK -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Wednesday, October 15, 2014 10:07 PM To: Roopeshakumar Narayansa Sha

Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

2014-10-15 Thread John R Pierce
On 10/15/2014 9:48 AM, Roopeshakumar Narayansa Shalgar (rshalgar) wrote: I need the 'integer' errorcode SQLSTATE Error codes are NOT integers, they are strings. note there's stuff in there like 0100C, 01P01, etc. -- john r pierce 37N 122W somewhere on t

[GENERAL] PL/Python prepare example's use of setdefault

2014-10-15 Thread Jonathan Rogers
I was just reading the PL/Python docs section "42.7.1 Database Access Functions" and saw this example: CREATE FUNCTION usesavedplan() RETURNS trigger AS $$ plan = SD.setdefault("plan", plpy.prepare("SELECT 1")) # rest of function $$ LANGUAGE plpythonu; The above example uses the plpy.prep

Re: [GENERAL] PL/Python prepare example's use of setdefault

2014-10-15 Thread Adrian Klaver
On 10/15/2014 02:39 PM, Jonathan Rogers wrote: I was just reading the PL/Python docs section "42.7.1 Database Access Functions" and saw this example: CREATE FUNCTION usesavedplan() RETURNS trigger AS $$ plan = SD.setdefault("plan", plpy.prepare("SELECT 1")) # rest of function $$ LANGUA

Re: [GENERAL] PL/Python prepare example's use of setdefault

2014-10-15 Thread Tom Lane
Adrian Klaver writes: > On 10/15/2014 02:39 PM, Jonathan Rogers wrote: >> I was just reading the PL/Python docs section "42.7.1 Database Access >> Functions" and saw this example: >> >> CREATE FUNCTION usesavedplan() RETURNS trigger AS $$ >> plan = SD.setdefault("plan", plpy.prepare("SELECT 1"))

Re: [GENERAL] PL/Python prepare example's use of setdefault

2014-10-15 Thread Jonathan Rogers
On 10/15/2014 05:51 PM, Adrian Klaver wrote: > On 10/15/2014 02:39 PM, Jonathan Rogers wrote: >> I was just reading the PL/Python docs section "42.7.1 Database Access >> Functions" and saw this example: >> >> CREATE FUNCTION usesavedplan() RETURNS trigger AS $$ >> plan = SD.setdefault("plan",

Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

2014-10-15 Thread Yogesh. Sharma
Dear All, I am facing some issue during postgresql service stop. Issue:- [root@localhost postgresql-9.0.18]# runuser -l postgres -c '/usr/pgsql/bin/pg_ctl stop -D '\''/var/lib/pgsql/data'\'' -s -m fast' /usr/pgsql/bin/pg_ctl: error while loading shared libraries: libpq.so.5: cannot open shared o

Re: [GENERAL] library path problems? (was: Completely unrelated)

2014-10-15 Thread John R Pierce
On 10/15/2014 8:10 PM, Yogesh. Sharma wrote: I am facing some issue during postgresql service stop. Issue:- [root@localhost postgresql-9.0.18]# runuser -l postgres -c '/usr/pgsql/bin/pg_ctl stop -D '\''/var/lib/pgsql/data'\'' -s -m fast' /usr/pgsql/bin/pg_ctl: error while loading shared libr

Re: [GENERAL] library path problems?

2014-10-15 Thread Adrian Klaver
On 10/15/2014 08:21 PM, John R Pierce wrote: On 10/15/2014 8:10 PM, Yogesh. Sharma wrote: I am facing some issue during postgresql service stop. Issue:- [root@localhost postgresql-9.0.18]# runuser -l postgres -c '/usr/pgsql/bin/pg_ctl stop -D '\''/var/lib/pgsql/data'\'' -s -m fast' /usr/pgsql