[GENERAL] Question about isolation level documentation

2014-04-08 Thread Elliot S
Is there a discussion somewhere regarding this line from the docs on transaction isolation: When you select the level Read Uncommitted you really get Read Committed, and phantom reads are not possible in the PostgreSQL implementation of Repeatable Read? I get that RU is the same as RC and why

Re: [GENERAL] Question about isolation level documentation

2014-04-08 Thread Elliot S
On 04/08/2014 04:09 PM, Alvaro Herrera wrote: Elliot S wrote: Is there a discussion somewhere regarding this line from the docs on transaction isolation: When you select the level Read Uncommitted you really get Read Committed, and phantom reads are not possible in the PostgreSQL implementation

Re: [GENERAL] PL/pgSQL Copy data from one table to another

2014-02-05 Thread Elliot
On 2014-02-05 10:36, ChoonSoo Park wrote: On Wed, Feb 5, 2014 at 7:53 AM, George Ant g.antonopoulos...@gmail.com mailto:g.antonopoulos...@gmail.com wrote: Hey Guys, I am trying to copy data from one table to another using plpgsql. The two tables have different structure cause

Re: [GENERAL] Puzzling table scan in a CTE

2013-11-22 Thread Elliot
On 2013-11-22 11:54, sl...@centrum.sk wrote: Good day, I have a recursive CTE where a table scan occurs, even though there doesn't seem to be a good reason for it. It seems the planner came to the conclusion that columns that are not actually used in the output, joins or a where clause are

Re: [GENERAL] Puzzling table scan in a CTE

2013-11-22 Thread Elliot
On 2013-11-22 12:49, sl...@centrum.sk wrote: Thanks for the suggestion. I've tried it with seqscan set to off, but there's still a bitmap heap scan going on: http://explain.depesz.com/s/zIJl I have random_page_cost set to 1.5 at the moment, as the database is on a solid state disk.

Re: [GENERAL] Primary Key

2013-11-21 Thread Elliot
On 2013-11-21 15:40, Joey Quinn wrote: I have a table (5 columns) with approximately 670 million rows. It has had an index (unique) on an inet column from the beginning. Today I added a primary key constraint based on the same column thinking that since it already had an index, this would be a

Re: [GENERAL] Help : Sum 2 tables based on key from other table

2013-11-18 Thread Elliot
On 2013-11-18 04:37, Ken Tanzer wrote: If the tables aren't huge, you're not concerned about optimization, and you just want to get your numbers, I think something like this would do the trick. I haven't actually tried it 'cause I didn't have easy access to your tables: SELECT

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Elliot
On 2013-11-14 10:13, Dang Minh Huong wrote: Hi all, I am using PostgreSQL 9.1 and get a syntax error with the following PL/pgSQL clause. Is there any equivalent syntax in PL/pgSQL to solve it. -- rec typ[]; (typ[1]).t1 := 1; -- typ is type which was created by command below. Create

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Elliot
On 2013-11-14 10:32, Dang Minh Huong wrote: Hi, 2013/11/15 0:20、Elliot yields.falseh...@gmail.com のメッセージ: On 2013-11-14 10:13, Dang Minh Huong wrote: Hi all, I am using PostgreSQL 9.1 and get a syntax error with the following PL/pgSQL clause. Is there any equivalent syntax in PL/pgSQL

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Elliot
On 2013-11-14 10:56, Dang Minh Huong wrote: Hi, 2013/11/15 0:38、Elliot yields.falseh...@gmail.com のメッセージ: On 2013-11-14 10:32, Dang Minh Huong wrote: Hi, 2013/11/15 0:20、Elliot yields.falseh...@gmail.com のメッセージ: On 2013-11-14 10:13, Dang Minh Huong wrote: Hi all, I am using PostgreSQL

Re: [GENERAL] ON DELETE CASCADE Question

2013-11-04 Thread Elliot
On 2013-11-04 14:44, Jason Long wrote: CREATE TABLE t_a ( id bigint NOT NULL, CONSTRAINT pk_a PRIMARY KEY (id) ); CREATE TABLE t_b ( id bigint NOT NULL, CONSTRAINT pk_b PRIMARY KEY (id), CONSTRAINT fk_b_a FOREIGN KEY (id) REFERENCES t_a (id) ON DELETE CASCADE ); INSERT INTO t_a

Re: [GENERAL] Undocumented feature? USING INDEX TABLESPACE

2013-10-30 Thread Elliot
On 2013-10-30 06:32, Tim Kane wrote: Hi all, I've been looking for a facility to specify the tablespace of an index that is implicitly created when adding a PK constraint. It turns out that this does indeed exist, though I could find no mention of it in the documentation. ALTER TABLE

Re: [GENERAL] Table partitioning

2013-10-28 Thread Elliot
On 2013-10-28 12:27, Herouth Maoz wrote: I have a rather large and slow table in Postgresql 9.1. I'm thinking of partitioning it by months, but I don't like the idea of creating and dropping tables all the time. I'm thinking of simply creating 12 child tables, in which the check condition

Re: [GENERAL] Table partitioning

2013-10-28 Thread Elliot
On 2013-10-28 12:47, Herouth Maoz wrote: Thanks. Assuming there is an index on the time_arrived column, and that there are about 10.5 million records in each child table, how bad will performance be if the query actually accesses all the 12 tables? Will it be as bad as using the full table?

Re: [GENERAL] Count of records in a row

2013-10-25 Thread Elliot
On 2013-10-24 17:09, Robert James wrote: On 10/22/13, Elliot yields.falseh...@gmail.com wrote: It looks like you already found a solution, but here's one with a CTE. I cobbled this together from an older query I had for doing something similar, for which I unfortunately lost the original source

Re: [GENERAL] Detecting change in event properties

2013-10-25 Thread Elliot
On 2013-10-25 13:35, Robert James wrote: On 10/25/13, Robert James srobertja...@gmail.com wrote: I have a table of (timed) events, and I'm interested in marking events whose properties have changed from the previous event. I believe this can be done with window functions, but I'm not sure how.

Re: [GENERAL] Count of records in a row

2013-10-22 Thread Elliot
On 2013-10-21 20:38, Robert James wrote: I have a table of event_id, event_time. Many times, several events happen in a row. I'd like a query which replaces all of those events with a single record, showing the count. Eg: Take A,A,A,B,C,A,D,A,A,D,D,B,C,C and return: A,3; B,1; C,1; A,1; D,1;

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread Elliot
On 2013-09-27 14:27, mdr wrote: I had a question on creating PK with alter table, after table is created. I understand I create a PK id during create table by stating id as follows: id serial primary key It implicitly creates index and the sequence testing_id_seq to be associated with the id

Re: [GENERAL] Sharing data directories between machines

2013-08-06 Thread Elliot
On 2013-08-06 15:28, John McKown wrote: Me again. Perhaps what is needed, in this case, is for a distributor which looks like a PostgreSQL server running on a given system (i.e. it is listening on the default TCPIP ports and UNIX sockets and insert whatever for Windows) but would simply act

[GENERAL] forums.postgresql.com.au

2011-04-06 Thread Elliot Chance
disappointed they cannot post. - Elliot -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] forums.postgresql.com.au

2011-04-06 Thread Elliot Chance
disappointed they cannot post. - Elliot

Fwd: [GENERAL] Postgres forums ... take 2

2010-12-30 Thread Elliot Chance
Sorry folks, this is an old message I forgot to copy pgsql-general on. Begin forwarded message: From: Elliot Chance elliotcha...@gmail.com Date: 21 December 2010 11:48:07 AM AEDT To: Thom Brown t...@linux.com Subject: Re: [GENERAL] Postgres forums ... take 2 On 21/12/2010, at 11:26 AM

Re: [GENERAL] Postgres forums ... take 2

2010-12-30 Thread Elliot Chance
On 31/12/2010, at 12:43 AM, Carlos Mennens wrote: On Mon, Dec 20, 2010 at 7:26 PM, Thom Brown t...@linux.com wrote: I know this topic has gone quiet, I still think it's worth investing time and resources in. I don't expect any progress to be made until the new year now, but I hope we can

Re: [GENERAL] #include funcapi.h

2010-12-26 Thread Elliot Chance
#undef typename #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif }; Now there is no collision with the C++ keywords. On 26/12/2010, at 5:14 PM, Craig Ringer wrote: On 12/26/2010 02:14 PM, Elliot Chance wrote: In file included from /usr/include/pgsql/server/access/heapam.h

[GENERAL] C functions with COMMIT/ROLLBACK?

2010-12-26 Thread Elliot Chance
Hi everyone, Is is possible to add handlers so that a C function is fired when a transaction is committed or rolled back, for example (pseudo code): BEGIN; CALL my_function(1); CALL my_function(2); CALL my_function(3); ROLLACK; my_function() Create my_file.txt.tmp Write some information to

[GENERAL] SQL queries inside a C function?

2010-12-26 Thread Elliot Chance
Hi everyone, How do I get the active connection handle from inside a C function linked as a PL/pgSQL function, like: Datum pg_do_something(PG_FUNCTION_ARGS) { PGconn *conn = ? // now do some SELECTs / INSERTs PG_RETURN_INT32(result); } Thanks, Elliot -- Sent via pgsql-general

[GENERAL] #include funcapi.h

2010-12-25 Thread Elliot Chance
Hi everyone, From what i've read in the documentation you need funcapi.h to return SETOF from a C function, the problem is when I include the header file the compile throws heaps of errors; offending code 1. extern C { 2. #include postgres.h 3. #include fmgr.h 4. #include

[GENERAL] Load C++ for functions?

2010-12-24 Thread Elliot Chance
I'm trying to link up a C++ project with postgres functions, the following code compiles (as C++): extern C { #include postgres.h #include fmgr.h #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif }; extern C { PG_FUNCTION_INFO_V1(pg_xversion); };

Re: [GENERAL] Load C++ for functions?

2010-12-24 Thread Elliot Chance
Cheers! It works. On 24/12/2010, at 11:13 PM, Dmitriy Igrishin wrote: Hey Elliot, See http://www.postgresql.org/docs/9.0/static/extend-cpp.html Probably compiling with -fno-exceptions solve you problem. 2010/12/24 Elliot Chance elliotcha...@gmail.com I'm trying to link up a C

[GENERAL] RAISE with C?

2010-12-20 Thread Elliot Chance
is it further possible to catch the message that RAISE EXCEPTION sends? Like 'Something bad: bla bla' Thanks, Elliot -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Recreate C functions?

2010-12-14 Thread Elliot Chance
and create the function it still returns 100? However if I compile it as funcs2.so it will then create the function with the correct 200 result ... what am I doing wrong? Thanks, Elliot -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Fwd: [GENERAL] Recreate C functions?

2010-12-14 Thread Elliot Chance
or reload while the server it running? I couldn't find anything in the docs about it though. Regards Pavel Stehule 2010/12/14 Elliot Chance elliotcha...@gmail.com: Hi, I seem to be having trouble recreating C functions, the source: === test.c #include postgres.h #include fmgr.h

Re: [GENERAL] Recreate C functions?

2010-12-14 Thread Elliot Chance
2010/12/14 Elliot Chance elliotcha...@gmail.com: Hi, I seem to be having trouble recreating C functions, the source: === test.c #include postgres.h #include fmgr.h PG_MODULE_MAGIC; int32 plpgsql_test(text* s) { return 100; } === end === Then compile: $ cc -fpic -c -I/usr

Re: [GENERAL] Postgres forums ... take 2

2010-11-28 Thread Elliot Chance
: On 22 November 2010 14:05, Bruce Momjian br...@momjian.us wrote: Magnus Hagander wrote: On Sat, Nov 20, 2010 at 16:54, Bruce Momjian br...@momjian.us wrote: Elliot Chance wrote: Also, if someone registers on the forum, do they get a major domo registration email? ?And if so, would

Re: [GENERAL] The first dedicated PostgreSQL forum

2010-11-22 Thread Elliot Chance
On 22/11/2010, at 10:22 PM, Gurjeet Singh wrote: On Fri, Nov 19, 2010 at 1:07 AM, Thom Brown t...@linux.com wrote: As has been said previously, an unlinked forum (one which has no interaction with the mailing list) is destined to fail, as others have in the past. It's creates a fragmented

Fwd: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-21 Thread Elliot Chance
On 21/11/2010, at 2:59 AM, Bruce Momjian wrote: Magnus Hagander wrote: On Sat, Nov 20, 2010 at 14:46, Elliot Chance elliotcha...@gmail.com wrote: for...@postgresql.com.au is pointed to a black hole so that email disappears but the mailing list gets another copy. When the mailing list gets

[GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
On 20/11/2010, at 9:52 PM, Magnus Hagander wrote: On Sat, Nov 20, 2010 at 02:57, Elliot Chance elliotcha...@gmail.com wrote: On 20/11/2010, at 3:58 AM, Magnus Hagander wrote: On Fri, Nov 19, 2010 at 16:14, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Dave Page's

[GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
in the forum system) -- this would solve Dave's concern.) That would solve it, yes. I don't think mj2 will allow that though - we've been looking for something similar for sysadmin use. So let's patch Mj2. If we use a pattern like the persons unique username: Elliot Chance forums-chan

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
On 20/11/2010, at 11:52 PM, Magnus Hagander wrote: On Sat, Nov 20, 2010 at 12:26, Elliot Chance elliotcha...@gmail.com wrote: On 20/11/2010, at 9:52 PM, Magnus Hagander wrote: On Sat, Nov 20, 2010 at 02:57, Elliot Chance elliotcha...@gmail.com wrote: On 20/11/2010, at 3:58 AM, Magnus

[GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
Begin forwarded message: From: Magnus Hagander mag...@hagander.net Date: 20 November 2010 3:58:41 AM AEDT To: Alvaro Herrera alvhe...@commandprompt.com Cc: Dave Page dp...@pgadmin.org, Elliot Chance elliotcha...@gmail.com, pgsql-www pgsql-...@postgresql.org Subject: Re: [pgsql-www

Fwd: [GENERAL] The first dedicated PostgreSQL forum

2010-11-20 Thread Elliot Chance
Apple Mail has not been copying the mailing list, so excuse the reposts if you got one. Begin forwarded message: From: Elliot Chance elliotcha...@gmail.com Date: 19 November 2010 9:18:18 AM AEDT To: Daniel Verite dan...@manitou-mail.org Subject: Re: [GENERAL] The first dedicated PostgreSQL

Fwd: [GENERAL] Postgres forums ... take 2

2010-11-20 Thread Elliot Chance
Apple Mail has not been copying the mailing list, so excuse the reposts if you got one. Begin forwarded message: From: Elliot Chance elliotcha...@gmail.com Date: 15 November 2010 9:02:43 PM AEDT To: Thom Brown t...@linux.com Subject: Re: [GENERAL] Postgres forums ... take 2 On 15/11/2010

Fwd: [GENERAL] Postgres forums ... take 2

2010-11-20 Thread Elliot Chance
Apple Mail has not been copying the mailing list, so excuse the reposts if you got one. Begin forwarded message: From: Elliot Chance elliotcha...@gmail.com Date: 16 November 2010 4:57:27 PM AEDT To: Craig Ringer cr...@postnewspapers.com.au Subject: Re: [GENERAL] Postgres forums ... take 2

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
Using the reply to all, thanks. On 21/11/2010, at 12:32 AM, Magnus Hagander wrote: On Sat, Nov 20, 2010 at 14:22, Elliot Chance elliotcha...@gmail.com wrote: On 20/11/2010, at 11:52 PM, Magnus Hagander wrote: On Sat, Nov 20, 2010 at 12:26, Elliot Chance elliotcha...@gmail.com wrote

Re: [GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
On 21/11/2010, at 2:41 AM, Tom Lane wrote: Elliot Chance elliotcha...@gmail.com writes: Then I can create a catch-all so that when an email is sent to forums-chan...@postgresql.com.au it finds the user chancey gets the real address and sends it on. If there were a way we could register

Fwd: [GENERAL] The first dedicated PostgreSQL forum

2010-11-20 Thread Elliot Chance
Apple Mail has not been copying the mailing list, so excuse the reposts if you got one. Begin forwarded message: From: Elliot Chance elliotcha...@gmail.com Date: 14 November 2010 12:30:19 PM AEDT To: Tom Lane t...@sss.pgh.pa.us Subject: Re: [GENERAL] The first dedicated PostgreSQL forum

Re: [GENERAL] Postgres forums ... take 2

2010-11-17 Thread Elliot Chance
:15 PM, Magnus Hagander wrote: On Wed, Nov 17, 2010 at 00:00, Elliot Chance elliotcha...@gmail.com wrote: On 17/11/2010, at 6:22 AM, Stephen Cook wrote: On 11/16/2010 10:51 AM, Magnus Hagander wrote: What I'm more interested in is still a word from the people who would actually *use* a forum

Re: [GENERAL] Postgres forums ... take 2

2010-11-16 Thread Elliot Chance
it make any serious difference from what we're already doing? Cheers, Elliot -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Postgres forums ... take 2

2010-11-16 Thread Elliot Chance
On 17/11/2010, at 6:22 AM, Stephen Cook wrote: On 11/16/2010 10:51 AM, Magnus Hagander wrote: What I'm more interested in is still a word from the people who would actually *use* a forum on how this would be better than sites like Nabble and Gmane. I'm one of those. I'm subscribed to

[GENERAL] Postgres forums ... take 2

2010-11-15 Thread Elliot Chance
is that all new topics are pushed into the General Other category as the script can't differentiate what category it should in fact belong to, once the topic is moved it will stay there. This shouldn't be a real problem as theres not many new topics being created on any given day. Cheers, Elliot

Fwd: [GENERAL] Postgres forums ... take 2

2010-11-15 Thread Elliot Chance
On 15/11/2010, at 8:37 PM, Thom Brown wrote: On 15 November 2010 08:34, Elliot Chance elliotcha...@gmail.com wrote: Hi again, I've taken in all the feedback about http://forums.postgresql.com.au and the general consensus is that nobody wants a separate entity - a few people mentioned

Re: [GENERAL] Postgres forums ... take 2

2010-11-15 Thread Elliot Chance
forum mappings as needed, and I could add post processing. So for example an email to pgsql-general with the title perl won't connect will recognise perl and move it to the Languages Perl. On 15/11/2010, at 9:42 PM, Magnus Hagander wrote: On Mon, Nov 15, 2010 at 11:08, Elliot Chance elliotcha

Fwd: [GENERAL] Postgres forums ... take 2

2010-11-15 Thread Elliot Chance
On 16/11/2010, at 2:01 PM, Craig Ringer wrote: On 15/11/10 17:37, Thom Brown wrote: That's actually some good work you've done there! I didn't know phpBB supported bidirectional mailing list support. Yikes. Neither did I. I've always seen phpBB as the barren wasteland of web forums -

[GENERAL] The first dedicated PostgreSQL forum

2010-11-12 Thread Elliot Chance
feedback would be appreciated. - Elliot -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] pg_dump with low priority?

2005-10-22 Thread Bryan Field-Elliot
We have a huge database which must be backed up every day with pg_dump. The problem is, it takes around half an hour to produce the dump file, and all other processes on the same box are starved for cycles (presumably due to I/O) during the dump. It's not just an inconvenience, it's now

[GENERAL]

2005-07-28 Thread Bryan Field-Elliot
subscribe

[GENERAL] How to optimize select count(*)..group by?

2005-07-28 Thread Bryan Field-Elliot
We have this simple query: select status, count(*) from customer group by status; There is already a btree index on status, but, the customer table is huge, and this query must be executed very frequently... an explain on this query shows that it is quite costly (and we notice it runs

[GENERAL] Stuck processes, viewing the queries inside

2003-11-17 Thread Bryan Field-Elliot
We have a running server (v7.3) which, over time, seems to accumulate a bunch of stuck PostgreSQL instances which appear to be dead inside of a transaction. For example, ps reveals many of these: postgres 17683 0.0 0.4 7376 1032 ?SNov13 0:21 postgres: bryan sourceid 127.0.0.1

[GENERAL] Show triggers in psql?

2000-09-14 Thread Bryan Field-Elliot
Forgive me if I am missing the obvious, but can someone please tell me how to show a list of triggers, or the code in a specific trigger, via the pgsql utility? Thank you, Bryan

[GENERAL] Q: Truncated output

2000-06-01 Thread Elliot Finley
| | email| text not null default '' | var | +--+--+---+ Index:employee_pkey -- Elliot ([EMAIL PROTECTED]) Weird Science!

Re: [GENERAL] btree index and max()

2000-06-01 Thread Elliot Finley
I remember correctly) be quite as fast as an isam for a range lookup, but still very fast. Also, btree allows for dynamic index expansion. -- Elliot ([EMAIL PROTECTED]) Weird Science!

[GENERAL] Benchmarking PGSQL against Microsoft SQL 7.0?

1999-01-08 Thread Bryan Field-Elliot
Please forgive my newbieness but I am extremely new to both Postgresql AND Linux. I've been a consultant for 6 years working mostly on Microsoft platforms (NT, MSSQL). I have developed many data-driven websites using WinNT/IIS/ASP/MSSQL. Now, getting sick of MS and being enamored with the whole