[GENERAL] Correct update statement

2014-05-15 Thread Khangelani Gama
Hi Please help, we are using postgreSQL 9.2.4. I need to update over 9000 rows. See the query below: A table called contact has got *addr_id *field as null which is incorrect. So now I need to update contact table for each account (cus_acno is in cus table) where contact_addr_id is null. For

[GENERAL] TODO: Expose parser support for decoding unicode escape literals to user

2014-05-15 Thread Craig Ringer
Hi all I just noticed a Stack Overflow question (http://stackoverflow.com/q/20124393/398670) where someone's asking how to decode '\u` style escapes *stored in database text fields* into properly encoded text strings. The parser supports this for escape-strings, and you can write E'\u011B'

Re: [GENERAL] Correct update statement

2014-05-15 Thread Sim Zacks
update contacts set addr_id=b.addr_id from (select distinct(cus_acno), contact.con_id, address.addr_id from address join person using (addr_id) join  cus using (per_id) join link_contact using (cus_acno) join contact using (con_id) where contact.addr_id is

Re: [GENERAL] Correct update statement

2014-05-15 Thread Khangelani Gama
Thank very much *From:* pgsql-general-ow...@postgresql.org [mailto: pgsql-general-ow...@postgresql.org] *On Behalf Of *Sim Zacks *Sent:* Thursday, May 15, 2014 10:42 AM *To:* pgsql-general@postgresql.org *Subject:* Re: [GENERAL] Correct update statement update contacts set addr_id=b.addr_id

Re: [GENERAL] are analyze statistics synced with replication?

2014-05-15 Thread Dorian Hoxha
If you don't do read queries on the slave than it will not have hot data/pages/rows/tables/indexes in ram like the primary ? (it smoked weed and was happy doing nothing so it was happy, but when responsibility came (being promoted to master) it failed hard) On Thu, May 15, 2014 at 6:46 AM, Kevin

Re: [GENERAL] TODO: Expose parser support for decoding unicode escape literals to user

2014-05-15 Thread Adrian Klaver
On 05/15/2014 01:31 AM, Craig Ringer wrote: Hi all I just noticed a Stack Overflow question (http://stackoverflow.com/q/20124393/398670) where someone's asking how to decode '\u` style escapes *stored in database text fields* into properly encoded text strings. The parser supports this for

[GENERAL] Re: TODO: Expose parser support for decoding unicode escape literals to user

2014-05-15 Thread David G Johnston
Adrian Klaver-4 wrote On 05/15/2014 01:31 AM, Craig Ringer wrote: Hi all I just noticed a Stack Overflow question (http://stackoverflow.com/q/20124393/398670) where someone's asking how to decode '\u` style escapes *stored in database text fields* into properly encoded text strings.

Re: [GENERAL] Re: TODO: Expose parser support for decoding unicode escape literals to user

2014-05-15 Thread Adrian Klaver
On 05/15/2014 07:13 AM, David G Johnston wrote: Adrian Klaver-4 wrote On 05/15/2014 01:31 AM, Craig Ringer wrote: Hi all I just noticed a Stack Overflow question (http://stackoverflow.com/q/20124393/398670) where someone's asking how to decode '\u` style escapes *stored in database text

Re: [GENERAL] are analyze statistics synced with replication?

2014-05-15 Thread Kevin Goess
On Thu, May 15, 2014 at 6:39 AM, Dorian Hoxha dorian.ho...@gmail.comwrote: If you don't do read queries on the slave than it will not have hot data/pages/rows/tables/indexes in ram like the primary ? Yeah, that was the first thing we noticed, the cacti graph shows it took two hours for the

Re: [GENERAL] Backups over slave instead master?

2014-05-15 Thread Bruce Momjian
On Thu, May 1, 2014 at 12:39:44PM -0700, bricklen wrote: On Thu, May 1, 2014 at 8:54 AM, Shaun Thomas stho...@optionshouse.com wrote: On 05/01/2014 10:31 AM, Edson Richter wrote: I'm wondering if would be possible to execute these backups in the slave

[GENERAL] Somebody hijacked @psql ?

2014-05-15 Thread Martín Marqués
Looks like someone hijacked the tweeter account @psql, and is posting what looks like spam on http://forum.postgresql.org.pl, and then spaming those posts with the tweeter account. I just wanted to let the person in charge know. Cheers, -- Martín Marqués http://www.2ndQuadrant.com/ PostgreSQL

Re: [GENERAL] Backups over slave instead master?

2014-05-15 Thread bricklen
On Thu, May 15, 2014 at 1:55 PM, Bruce Momjian br...@momjian.us wrote: On Thu, May 1, 2014 at 12:39:44PM -0700, bricklen wrote: Or alternatively, if backup = pg_dump, then backups can taken from the slave too. Have a look at pg_xlog_replay_pause() + pg_dump + pg_xlog_replay_resume().