Re: [GENERAL] Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?

2009-05-02 Thread Craig Ringer
Daniel Verite wrote: > That's a permutation, as used in symmetric ciphering. A proven way to > build one is to use a Feistel network: Thanks. That looks to be pretty much what I'm after. > Here is a plpgqsl implementation: Wow. I really appreciate that. I'll have to test it out and chuck it on

Re: [GENERAL] Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?

2009-05-02 Thread Craig Ringer
Jasen Betts wrote: > That means storing a long list of numbers and doing queries similar to > the following to get ne next value for the sequence. > > select id from idtable > order by id > limit 1 > offset random(0, (select count (*) from idtable) > > a ramdom-looking 1:1 mapping is p

[GENERAL] Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?

2009-05-02 Thread Jasen Betts
On 2009-05-03, Erik Jones wrote: >> What I'm looking for is a function that, given an input within a >> constrained range (say, a 32 bit integer) produces a different output >> within the same range. For any given input, the output should be the >> same each time, and for any given output there s

Re: [GENERAL] Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?

2009-05-02 Thread Erik Jones
On May 1, 2009, at 6:06 AM, Craig Ringer wrote: What I'm looking for is a function that, given an input within a constrained range (say, a 32 bit integer) produces a different output within the same range. For any given input, the output should be the same each time, and for any given output

Re: [GENERAL] Two Questions Re: Warm Backup

2009-05-02 Thread Terry Lee Tucker
On Saturday 02 May 2009 13:08, Daniel Verite wrote: >Terry Lee Tucker writes > > > Q1: Can we set up a scenario where there is more that one > > warm standby? > > Yes. But you'll have to consider what you want to happen when one > standby is correctly receiving the WAL files and another is

Re: [GENERAL] Difference between array column type and separate table

2009-05-02 Thread Mike Christensen
Yeah I talked with some other SQL guru friends of mine and they all agree the separate table is the way to go for a number of reasons, so that's what I'll stick with. It was just one of those things where you see a new feature and try to find an excuse to try it out Thanks! Mike On Sat, May 2, 2

Re: [GENERAL] Two Questions Re: Warm Backup

2009-05-02 Thread Daniel Verite
Terry Lee Tucker writes Q1: Can we set up a scenario where there is more that one warm standby? Yes. But you'll have to consider what you want to happen when one standby is correctly receiving the WAL files and another is not, because the archive_command has to either fail or succee

Re: [GENERAL] Tracking down a deadlock

2009-05-02 Thread Tom Lane
Bill Moseley writes: > Not getting any nibbles, so allow me to try a short question: > If I have a deadlock situation (that will be reported as such by > Postgresql once the deadlock_timeout passes), does pg_stat_activity > show the queries that are blocking each other? In 8.2 or later it should

Re: [GENERAL] Tracking down a deadlock

2009-05-02 Thread Bill Moseley
Not getting any nibbles, so allow me to try a short question: If I have a deadlock situation (that will be reported as such by Postgresql once the deadlock_timeout passes), does pg_stat_activity show the queries that are blocking each other? I'm wondering if I'm misinterpreting what I'm seeing be

Re: [GENERAL] Possible to prevent transaction abort?

2009-05-02 Thread Thomas Kellerer
Adam B wrote on 02.05.2009 00:48: Strange indeed. Perhaps there's some background stuff happening that messes with the results (auto VACUUM?). In my mind, however, it makes sense that it would take longer: 2 extra operations against the server (save&release). Typical case of "problem sits b

Re: [GENERAL] 08P01: unexpected EOF on client connection

2009-05-02 Thread Jasen Betts
On 2009-05-01, Tomas Vondra wrote: > Hi, > > I've run into some strange troubles with a quite simple web application > that stores data in a PostgreSQL database. It is a simple image gallery, > displaying multiple thumbnails (stored in a bytea column) on a single > page generated by PHP. The pr

Re: [GENERAL] How to begin to debug FATAL: invalid frontend message type 77 error messages?

2009-05-02 Thread Thomas Pundt
Keaton Adams schrieb: Any ideas on how to debug these types of error messages? Apr 30 01:36:02 mxlqa401 postgres[23600]: [3-1] FATAL: invalid frontend message type 77 Apr 30 01:36:02 mxlqa401 postgres[23601]: [3-1] LOG: unexpected EOF on client connection Apr 30 01:36:02 mxlqa401 postgres[23

Re: [GENERAL] Difference between array column type and separate table

2009-05-02 Thread Alban Hertroys
On May 2, 2009, at 9:33 AM, Mike Christensen wrote: Using this, I could completely get rid of ThreadTags and have a table like this: create table Threads ( Id uuid not null, Posted timestamp not null, Subject varchar(255) not null, Replies int4 not null, PosterId uuid not null,

[GENERAL] Difference between array column type and separate table

2009-05-02 Thread Mike Christensen
Let's say you have a table called Threads, and each thread can have zero or more "tags" associated with it. A tag is just a byte which maps to some enum somewhere. There's two ways I can think of to do this. The first would be to have: create table Threads ( Id uuid not null, Posted timesta

Re: [GENERAL] Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?

2009-05-02 Thread Daniel Verite
Craig Ringer wrote: What I'm looking for is a function that, given an input within a constrained range (say, a 32 bit integer) produces a different output within the same range. For any given input, the output should be the same each time, and for any given output there should only be on

[GENERAL] Difference between array column type and separate table

2009-05-02 Thread Mike Christensen
Let's say you have a table called Threads, and each thread can have zero or more "tags" associated with it. A tag is just a byte which maps to some enum somewhere. There's two ways I can think of to do this. The first would be to have: create table Threads ( Id uuid not null, Posted timesta