Re: [GENERAL] Return and sql tuple descriptions are incompatible

2014-04-27 Thread rob stone
O n Fri, 2014-04-25 at 23:58 +0800, Hengky Liwandouw wrote:T hanks to give me the right direction to get help. Okay, here is the detail. > > > CREATE table test (id SERIAL, produkid TEXT, warehousename TEXT, onhand > INTEGER); > > COPY test (id, produkid, warehousename, onhand) FROM stdin; > 1

Re: [GENERAL] Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-27 Thread Dorian Hoxha
Since my alternative is using json, that is heavier (need to store keys in every row) than composite-types. Updating an element on a specific composite_type inside an array of them is done by UPDATE table SET composite[2].x = 24; So last standing question, is it possible to insert an array of comp

Re: [GENERAL] Postgresql the right tool (queue using advisory_locks + long transactions)

2014-04-27 Thread Tom Lane
Hannes Erven writes: > On 2014-04-27 21:53, Tom Lane wrote: >> Sitting on an open transaction for hours would be a bad idea. > I'm wondering why this is and what the consequences might be - I > thought, the MVCC model would handle that rather well? Vacuum can't delete dead rows if there's some

Re: [GENERAL] Postgresql the right tool (queue using advisory_locks + long transactions)

2014-04-27 Thread John R Pierce
On 4/27/2014 2:07 PM, Hannes Erven wrote: On 2014-04-27 21:53, Tom Lane wrote: > Sitting on an open transaction for hours would be a bad idea. I'm wondering why this is and what the consequences might be - I thought, the MVCC model would handle that rather well? Could please someone elabora

Re: [GENERAL] Re: Postgresql the right tool (queue using advisory_locks + long transactions)

2014-04-27 Thread Dorian Hoxha
I'll probably ask @pgbouncer mailing list if i can use it with advisory_locks per session. If not, even raw sessions will be enough. Some comments inline. Thanks On Sun, Apr 27, 2014 at 10:07 PM, David G Johnston < david.g.johns...@gmail.com> wrote: > Dorian Hoxha wrote > > Hi list, > > > > I am

Re: [GENERAL] Postgresql the right tool (queue using advisory_locks + long transactions)

2014-04-27 Thread Hannes Erven
Hi, On 2014-04-27 21:53, Tom Lane wrote: > Sitting on an open transaction for hours would be a bad idea. I'm wondering why this is and what the consequences might be - I thought, the MVCC model would handle that rather well? Could please someone elaborate on this or provide some pointer? T

[GENERAL] Re: Postgresql the right tool (queue using advisory_locks + long transactions)

2014-04-27 Thread David G Johnston
Dorian Hoxha wrote > Hi list, > > I am trying to use postgresql as a queue for long-jobs (max ~4 hours) > using > advisory_locks. I can't separate the long-job into sub-jobs. > > >1. At ultimate-best-case scenario there will be ~100 workers, so no >web-scale performance required. >Is

Re: [GENERAL] Postgresql the right tool (queue using advisory_locks + long transactions)

2014-04-27 Thread Tom Lane
Dorian Hoxha writes: > I am trying to use postgresql as a queue for long-jobs (max ~4 hours) using > advisory_locks. I can't separate the long-job into sub-jobs. >1. At ultimate-best-case scenario there will be ~100 workers, so no >web-scale performance required. >Is there a problem w

[GENERAL] Postgresql the right tool (queue using advisory_locks + long transactions)

2014-04-27 Thread Dorian Hoxha
Hi list, I am trying to use postgresql as a queue for long-jobs (max ~4 hours) using advisory_locks. I can't separate the long-job into sub-jobs. 1. At ultimate-best-case scenario there will be ~100 workers, so no web-scale performance required. Is there a problem with 100 open sessions

Re: [GENERAL] a row not deletes

2014-04-27 Thread Rafał Pietrak
Thenx for explanations. W dniu 27.04.2014 16:56, David G Johnston pisze: Andres Freund-3 wrote Hi, On 2014-04-27 10:23:18 +0200, Rafał Pietrak wrote: I've just experienced an unexpected (for me) "loss" of DELETE. Is this a feature or a bug (postgres v.s. SQL)? I guess you're using 9.2 or ol

Re: [GENERAL] a row not deletes

2014-04-27 Thread David G Johnston
Andres Freund-3 wrote > Hi, > > On 2014-04-27 10:23:18 +0200, Rafał Pietrak wrote: >> I've just experienced an unexpected (for me) "loss" of DELETE. Is this a >> feature or a bug (postgres v.s. SQL)? > > I guess you're using 9.2 or older? You are not allowed to update the > deleted row in a BEFOR

Re: [GENERAL] a row not deletes

2014-04-27 Thread Andres Freund
Hi, On 2014-04-27 10:23:18 +0200, Rafał Pietrak wrote: > I've just experienced an unexpected (for me) "loss" of DELETE. Is this a > feature or a bug (postgres v.s. SQL)? > > test case - > test=# CREATE TABLE test (a int, b text); > test=# INSERT INTO

[GENERAL] a row not deletes

2014-04-27 Thread Rafał Pietrak
Hi the list, I've just experienced an unexpected (for me) "loss" of DELETE. Is this a feature or a bug (postgres v.s. SQL)? test case - test=# CREATE TABLE test (a int, b text); test=# INSERT INTO test (a,b) values (1,'asd'); test=# INSERT INTO