Re: [GENERAL] Corruption of files in PostgreSQL

2007-06-01 Thread Purusothaman A
Hi Tom Lane, In my case, we upload/download files to/from postgresql. And we don't change the content of the file after once loaded to postgresql. But as days going, more files stored to postgresql and never change file content after that. But download many times the stored files as per need. W

Re: [GENERAL] Continuous PITR (was Re: multimaster)

2007-06-01 Thread Greg Smith
On Fri, 1 Jun 2007, Ron Johnson wrote: How difficult would it be to modify the process (the postmaster?) that writes the xlogs(?) to tee them to a listening process across the cloud on the DR machine, which then applies them to the DR database? On an 8.2 server, you can practically do this ri

Re: [GENERAL] Corruption of files in PostgreSQL

2007-06-01 Thread Paolo Bizzarri
Hi Tom, as explained above, the problem seems quite random. So I need to understand what we have to check. Best regards. Paolo Bizzarri Icube S.r.l. On 6/2/07, Tom Lane <[EMAIL PROTECTED]> wrote: "Paolo Bizzarri" <[EMAIL PROTECTED]> writes: > Any hint? Please provide a reproducible test case

Re: [GENERAL] Corruption of files in PostgreSQL

2007-06-01 Thread Tom Lane
"Paolo Bizzarri" <[EMAIL PROTECTED]> writes: > Any hint? Please provide a reproducible test case ... regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Corruption of files in PostgreSQL

2007-06-01 Thread Paolo Bizzarri
Hi everyone, a little update. We have upgraded our system to 7.4.17. The problem of truncated files seems now better, but it is still present. We have not found a clearly understandable pattern on why this happens. Just to provide some further information: - we create a file and store on the D

Re: [GENERAL] debugging C functions

2007-06-01 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > [ much good advice snipped, but I have to weigh in on one point ] > 4. Start another console and determine the PID for the backend > session (this will wrap poorly -- I'll do my best to make it > readable) "select pg_backend_pid()" is another alter

Re: [GENERAL] debugging C functions

2007-06-01 Thread Joe Conway
Islam Hegazy wrote: I wrote a C function to call from PostgreSQL8.2.4 under Linux. The functions returns unexpected results. I did an extensive analysis to the function and it seems correct. I want to know if there is a way to debug C functions that are passed to PostgreSQL. Yes. Something al

[GENERAL] debugging C functions

2007-06-01 Thread Islam Hegazy
Hi there I wrote a C function to call from PostgreSQL8.2.4 under Linux. The functions returns unexpected results. I did an extensive analysis to the function and it seems correct. I want to know if there is a way to debug C functions that are passed to PostgreSQL. Thanks Islam

Partitioning (was Re: [GENERAL] Slightly OT.)

2007-06-01 Thread Ron Johnson
On 06/01/07 19:29, Jeff Davis wrote: [snip] You shouldn't use a volatile function in a check constraint. Use a trigger instead, but even that is unlikely to work for enforcing constraints correctly. In general, for partitioning, you have to make some sacrifices. It's very challenging (and/or exp

Re: One last Slony question (was Re: [GENERAL] Slightly OT.)

2007-06-01 Thread Ron Johnson
On 06/01/07 19:17, Joshua D. Drake wrote: Ron Johnson wrote: On 06/01/07 18:35, Joshua D. Drake wrote: Since DDL is infrequent, is that bottleneck an acceptable trade-off? Define infrequent? I have customers that do it, everyday in prod. They do it willingly and refuse to change that habit.

Re: [GENERAL] [HACKERS] table partitioning pl/pgsql helpers

2007-06-01 Thread Jim Nasby
Dropping -hackers; that list is for development of the database engine itself. The problem is that rules will happen before triggers, so what you're trying to do will never work. Instead, just have the trigger insert the data into the appropriate table. On May 30, 2007, at 9:55 AM, Enrico

Re: [GENERAL] There can be only one! How to avoid the "highlander-problem".

2007-06-01 Thread Erwin Brandstetter
RETURN was missing in the AFTER triggers. here is the corrected version: - begin of code CREATE TABLE mankind ( man_id integer primary key, people_id integer NOT NULL, -- references table people .., but that's irrelevant here .. king boolean NOT NULL DEFAULT false ); On

Re: [GENERAL] multimaster

2007-06-01 Thread Alexander Staubo
On 6/1/07, Chris Browne <[EMAIL PROTECTED]> wrote: There would be *some* scalability gains to be had, but the primary reason for looking for multimaster replication is that you need high availability so badly that you are willing to give up performance to get it. ...dependent on some specific d

[GENERAL] There can be only one! How to avoid the "highlander-problem".

2007-06-01 Thread Erwin Brandstetter
Hi group! In the course of trying to create a cleanly formated posting that would make my problem understandable I have eventually solved it myself. :) I now post the solution instead, maybe it is of interest to someone. :) Here is a showcase how to avoid to the "highlander-problem". Imagine a

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Jeff Davis
On Sat, 2007-06-02 at 01:44 +0200, Alexander Staubo wrote: > On 6/2/07, Jeff Davis <[EMAIL PROTECTED]> wrote: > > Here is some work going on that looks like what you want: > > > > http://archives.postgresql.org/pgsql-hackers/2007-03/msg00050.php > > I had no idea someone was working on WAL-log-bas

Re: [GENERAL] multimaster

2007-06-01 Thread Alexander Staubo
On 6/2/07, Guy Rouillier <[EMAIL PROTECTED]> wrote: Have you looked at raidb? http://c-jdbc.objectweb.org. Narrow niche, but if it happens to be the one you are in, then it's an option. I took a quick look at the user's page, and both of them were using PostgreSQL. Looked at it briefly. C-JD

Re: [GENERAL] multimaster

2007-06-01 Thread Alexander Staubo
On 6/1/07, Joshua D. Drake <[EMAIL PROTECTED]> wrote: Alexander Staubo wrote: > You mean aside from the obvious one, scalability? Multimaster doesn't give you scalability (at least not like a lot of people think it does). That depends on your particular definition of multimaster. Databases a

Re: One last Slony question (was Re: [GENERAL] Slightly OT.)

2007-06-01 Thread Joshua D. Drake
Ron Johnson wrote: On 06/01/07 18:35, Joshua D. Drake wrote: Since DDL is infrequent, is that bottleneck an acceptable trade-off? Define infrequent? I have customers that do it, everyday in prod. They do it willingly and refuse to change that habit. Even 2 or 3 ALTER TABLE or CREATE INDEX

Re: [GENERAL] High-availability

2007-06-01 Thread Alexander Staubo
On 6/1/07, Madison Kelly <[EMAIL PROTECTED]> wrote: After realizing that 'clustering' in the PgSQL docs means multiple DBs behind one server, and NOT multple machines, I am back at square one, feeling somewhat the fool. :P I remember being similarly disappointed in this rampant co-opting of

Re: One last Slony question (was Re: [GENERAL] Slightly OT.)

2007-06-01 Thread Ron Johnson
On 06/01/07 18:35, Joshua D. Drake wrote: Ron Johnson wrote: On 06/01/07 17:31, Andrew Sullivan wrote: On Sat, Jun 02, 2007 at 12:23:44AM +0200, Alexander Staubo wrote: Could you not (I ask naively) detect the first DDL statement is submitted in a transaction Maybe. on the master, then st

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Alexander Staubo
On 6/2/07, Jeff Davis <[EMAIL PROTECTED]> wrote: Here is some work going on that looks like what you want: http://archives.postgresql.org/pgsql-hackers/2007-03/msg00050.php I had no idea someone was working on WAL-log-based replication; I saw the TODO entry a while ago, but I missed the thread

Re: One last Slony question (was Re: [GENERAL] Slightly OT.)

2007-06-01 Thread Joshua D. Drake
Ron Johnson wrote: On 06/01/07 17:31, Andrew Sullivan wrote: On Sat, Jun 02, 2007 at 12:23:44AM +0200, Alexander Staubo wrote: Could you not (I ask naively) detect the first DDL statement is submitted in a transaction Maybe. on the master, then start a transaction on each slave, then funne

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Alexander Staubo
On 6/2/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: On Sat, Jun 02, 2007 at 12:05:20AM +0200, Alexander Staubo wrote: > All you would require is a simple boolean flag to enable or disable > automatic DDL propagation, surely. You know, it is just possible that some of the responses you are gett

One last Slony question (was Re: [GENERAL] Slightly OT.)

2007-06-01 Thread Ron Johnson
On 06/01/07 17:31, Andrew Sullivan wrote: On Sat, Jun 02, 2007 at 12:23:44AM +0200, Alexander Staubo wrote: Could you not (I ask naively) detect the first DDL statement is submitted in a transaction Maybe. on the master, then start a transaction on each slave, then funnel this and all subse

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Jeff Davis
On Sat, 2007-06-02 at 00:05 +0200, Alexander Staubo wrote: > On 6/2/07, Gregory Stark <[EMAIL PROTECTED]> wrote: > > "Alexander Staubo" <[EMAIL PROTECTED]> writes: > > > > > I would love for the answer to have been "sorry, we did not have time > > > or manpower enough to implement fully transparent

Re: [GENERAL] Restoring 8.2 to 8.0

2007-06-01 Thread Tom Lane
Robert Fitzpatrick <[EMAIL PROTECTED]> writes: > I have a dump from 8.2 restored to file that was pg_dump'd with format c > from a production server. I want to know if it is possible for me to > restore this to a 8.0 development server where I am not able to upgrade > at this time. I don't think y

[GENERAL] High-availability

2007-06-01 Thread Madison Kelly
Hi all, After realizing that 'clustering' in the PgSQL docs means multiple DBs behind one server, and NOT multple machines, I am back at square one, feeling somewhat the fool. :P Can anyone point me to docs/websites that discuss options on replicating in (as close as possible to) realtim

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Andrew Sullivan
On Sat, Jun 02, 2007 at 12:23:44AM +0200, Alexander Staubo wrote: > Could you not (I ask naively) detect the first DDL statement is > submitted in a transaction Maybe. > on the master, then start a transaction on > each slave, then funnel this and all subsequent statements > synchronously to eve

Re: [GENERAL] Restoring 8.2 to 8.0

2007-06-01 Thread Robert Fitzpatrick
On Fri, 2007-06-01 at 19:24 +0200, RW wrote: > I've never tried this but maybe it works if you use pg_dump > from 8.0 to do the dump. > > Greetings > Robert > > Robert Fitzpatrick wrote: > > I have a dump from 8.2 restored to file that was pg_dump'd with format c > > from a production server. I w

Re: [GENERAL] query log corrupted-looking entries

2007-06-01 Thread Tom Lane
"George Pavlov" <[EMAIL PROTECTED]> writes: >> From: Tom Lane [mailto:[EMAIL PROTECTED] >> What *exactly* is the logging setup you guys use, and have you tried >> alternatives? > ... Also redirect_stderr = on. Hm. Well, that's the bit that ought to get you into the PIPE_BUF exception. There's b

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Andrew Sullivan
On Sat, Jun 02, 2007 at 12:05:20AM +0200, Alexander Staubo wrote: > All you would require is a simple boolean flag to enable or disable > automatic DDL propagation, surely. You know, it is just possible that some of the responses you are getting in this thread have to do with the glib way you say

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Alexander Staubo
On 6/1/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: On Fri, Jun 01, 2007 at 11:08:50PM +0200, Alexander Staubo wrote: > That doesn't make any sense. As a database *user* it's my prerogative > to criticize the bits that make my life painful. Sure. And as a user of free software, it is your pre

Re: [GENERAL] multimaster

2007-06-01 Thread Guy Rouillier
Alexander Staubo wrote: As it stands today, horizontally partitioning a database into multiple separate "shards" is incredibly invasive on the application architecture, and typically relies on brittle and non-obvious hacks such as configuring sequence generators with staggered starting numbers,

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Joshua D. Drake
Scott Ribe wrote: ...fully transparent replication... There is no such thing. Asking for it implies ignorance of the issues involved and what is actually available with other database products. We are darn close ;) Argh, to be clear: I was referring to multimaster. Heh, that isn't even on

Re: [GENERAL] why postgresql over other RDBMS

2007-06-01 Thread Ron Johnson
On 06/01/07 16:38, PFC wrote: Will the synchronized seq scan patch be able to do this by issuing all the CREATE INDEX commands at the same time from several different database connections ? No, but it could someday. Actually I tested, it does it right now, albeit unconsciously (p

Re: [GENERAL] Continuous PITR (was Re: multimaster)

2007-06-01 Thread Ron Johnson
On 06/01/07 16:25, Andrew Sullivan wrote: On Fri, Jun 01, 2007 at 03:58:01PM -0500, Ron Johnson wrote: What you need are disk blocks to be mirrored to a machine at the DR site. Or "continuous PITR" to the DR machine. I thought you could already do this? (I'm not, but I was pretty sure someon

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Scott Ribe
>>> ...fully transparent replication... >> >> There is no such thing. Asking for it implies ignorance of the issues >> involved and what is actually available with other database products. >> > > We are darn close ;) Argh, to be clear: I was referring to multimaster. -- Scott Ribe [EMAIL PROT

Re: [GENERAL] query log corrupted-looking entries

2007-06-01 Thread Ed L.
On Friday 01 June 2007 3:36 pm, Tom Lane wrote: > What *exactly* is the logging setup you guys use, and have you > tried alternatives? redirect_stderr = on# Enable capturing of stderr into log log_directory = '/users/.../logs' # Directory where log files are written

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Alexander Staubo
On 6/2/07, Gregory Stark <[EMAIL PROTECTED]> wrote: "Alexander Staubo" <[EMAIL PROTECTED]> writes: > I would love for the answer to have been "sorry, we did not have time > or manpower enough to implement fully transparent replication yet, > because it's a rather complex, you see"; Would you st

Re: [GENERAL] query log corrupted-looking entries

2007-06-01 Thread Ed L.
On Friday 01 June 2007 3:36 pm, Tom Lane wrote: > "George Pavlov" <[EMAIL PROTECTED]> writes: > > On 5/29/2007 10:19 AM, Ed L. wrote: > >> FWIW, I've also been seeing this sort of query log > >> corruption for as long as I can remember, 7.1 through 8.2, > >> HPUX (parisc, ia64), Linux on intel, amd

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Gregory Stark
"Alexander Staubo" <[EMAIL PROTECTED]> writes: > I would love for the answer to have been "sorry, we did not have time > or manpower enough to implement fully transparent replication yet, > because it's a rather complex, you see"; Would you still love that if you're one of the people who use rep

Re: [GENERAL] query log corrupted-looking entries

2007-06-01 Thread George Pavlov
> From: Tom Lane [mailto:[EMAIL PROTECTED] > "George Pavlov" <[EMAIL PROTECTED]> writes: > > On 5/29/2007 10:19 AM, Ed L. wrote: > >> FWIW, I've also been seeing this sort of query log corruption for > >> as long as I can remember, 7.1 through 8.2, HPUX (parisc, ia64), > >> Linux on intel, amd...

Re: [Fwd: Re: [GENERAL] Autovacuum keeps vacuuming a table disabled in pg_autovacuum]

2007-06-01 Thread Ron St-Pierre
Alvaro Herrera wrote: FYI, in 8.2 and up the Xid wraparound problem is considered on a table by table basis, which means that only the tables that have not been vacuumed recently need to be vacuumed. The need for database wide vacuuming is gone. That's good. Time to start VACUUM FULL ANAL

Re: [GENERAL] Seq Scan

2007-06-01 Thread Tyler Durden
Ok, Thank all for the clarification. ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] query log corrupted-looking entries

2007-06-01 Thread Tom Lane
"George Pavlov" <[EMAIL PROTECTED]> writes: > On 5/29/2007 10:19 AM, Ed L. wrote: >> FWIW, I've also been seeing this sort of query log corruption for >> as long as I can remember, 7.1 through 8.2, HPUX (parisc, ia64), >> Linux on intel, amd... What *exactly* is the logging setup you guys use, and

Re: [GENERAL] why postgresql over other RDBMS

2007-06-01 Thread PFC
Will the synchronized seq scan patch be able to do this by issuing all the CREATE INDEX commands at the same time from several different database connections ? No, but it could someday. Actually I tested, it does it right now, albeit unconsciously (pg doesn't do anything to synchron

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Andrew Sullivan
On Fri, Jun 01, 2007 at 11:08:50PM +0200, Alexander Staubo wrote: > That doesn't make any sense. As a database *user* it's my prerogative > to criticize the bits that make my life painful. Sure. And as a user of free software, it is your prerogative to propose a way that the software can be modi

Re: [GENERAL] collision in serial numbers after INSERT?

2007-06-01 Thread PFC
In the last versions of postgres, do : INSERT INTO blah RETURNING blah_id No need to worry about sequences or anything. It inserts, then it returns the inserted id, as the name says. Very much unlike MySQL where insert_id() returns the id of the last insert, even if it

Re: [GENERAL] Continuous PITR (was Re: multimaster)

2007-06-01 Thread Andrew Sullivan
On Fri, Jun 01, 2007 at 03:58:01PM -0500, Ron Johnson wrote: > What you need are disk blocks to be mirrored to a machine at the DR > site. Or "continuous PITR" to the DR machine. I thought you could already do this? (I'm not, but I was pretty sure someone reported doing it already.) > This the

Re: [GENERAL] query log corrupted-looking entries

2007-06-01 Thread Ed L.
On Friday 01 June 2007 3:09 pm, George Pavlov wrote: > On 5/29/2007 10:19 AM, Ed L. wrote: > > On Wednesday 23 May 2007 1:04 pm, George Pavlov wrote: > > FWIW, I've also been seeing this sort of query log > > corruption for as long as I can remember, 7.1 through 8.2, > > HPUX (parisc, ia64), Linux

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Alexander Staubo
On 6/1/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: > I could be wrong, but I believe Slony fails at this because it is > trigger-based and simply cannot detect DDL changes. No, there were in fact alternatives (like, for instance, patching the back end code). But that was undesirable for the

Re: [GENERAL] Seq Scan

2007-06-01 Thread Tom Lane
Kevin Hunter <[EMAIL PROTECTED]> writes: > At 1:17p -0400 on 01 Jun 2007, Tyler Durden wrote: >> I find strange that a simple SELECT COUNT(...) is so slow with only >> 700 000 records. > The much more knowledgable will correct me, but the abbr. version is > that it is for data integrity and corr

Re: [GENERAL] warm standby server stops doingcheckpointsafterawhile

2007-06-01 Thread Frank Wittig
Teodor Sigaev schrieb: > Hope, attached patch fix that. Pls, test it. It still happens. The log is full of incomplete split dumps: <2007-06-01 23:00:00.001 CEST:%> LOG: GIN incomplete splits=8 <2007-06-01 23:00:00.001 CEST:%> CONTEXT: xlog redo checkpoint: redo D0/28020F48; undo 0/0; tli 1; xid

Re: [GENERAL] why postgresql over other RDBMS

2007-06-01 Thread Ron Johnson
On 06/01/07 11:22, Bruce Momjian wrote: PFC wrote: On Thu, 31 May 2007 22:20:09 +0200, Vivek Khera <[EMAIL PROTECTED]> wrote: On May 25, 2007, at 5:28 PM, Tom Lane wrote: That's true at the level of DDL operations, but AFAIK we could parallelize table-loading and index-creation steps pretty

Re: [GENERAL] collision in serial numbers after INSERT?

2007-06-01 Thread Ian Harding
On 31 May 07 09:46:47 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello all - I'm working on a site with PHP and Postgres, coming from a MySQL background. I was looking for an equivalent to the mysql_insert_id() function, and a site recommended this: Another option is INSERT...RETURNI

Re: [GENERAL] query log corrupted-looking entries

2007-06-01 Thread George Pavlov
On 5/29/2007 10:19 AM, Ed L. wrote: > On Wednesday 23 May 2007 1:04 pm, George Pavlov wrote: > FWIW, I've also been seeing this sort of query log corruption for > as long as I can remember, 7.1 through 8.2, HPUX (parisc, ia64), > Linux on intel, amd... Do you have any tricks for dealing with the p

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Alexander Staubo
On 6/1/07, Joshua D. Drake <[EMAIL PROTECTED]> wrote: As the owner of a company that actually actively developing a replication system and has for years... I suggest you start putting your code where your words are. That doesn't make any sense. As a database *user* it's my prerogative to critic

Re: [GENERAL] Seq Scan

2007-06-01 Thread Kevin Hunter
of the conversation. breaks the flow because it toppost Please don't At 1:17p -0400 on 01 Jun 2007, Tyler Durden wrote: Yes, either case happens the same. I'm come recently from MySQL and it works in a different way. I find strange that a simple SELECT COUNT(...) is so slow with only 700 000 re

[GENERAL] Continuous PITR (was Re: multimaster)

2007-06-01 Thread Ron Johnson
On 06/01/07 11:16, Andrew Sullivan wrote: [snip] My real question in all this is, "What is the problem you are trying to solve?" Hot failover using combinations of hardware and software, and a disk array that can be mounted across two machines, is actually probably good enough for most cases, a

Re: [GENERAL] collision in serial numbers after INSERT?

2007-06-01 Thread Michael Glaesemann
On Jun 1, 2007, at 15:00 , Tom Lane wrote: Michael Glaesemann <[EMAIL PROTECTED]> writes: On May 31, 2007, at 11:46 , [EMAIL PROTECTED] wrote: However, I wondered, if I were in an environment where there were many concurrent inserts, would it be possible that I didn't get the serial numbe

Re: [Fwd: Re: [GENERAL] Autovacuum keeps vacuuming a table disabled in pg_autovacuum]

2007-06-01 Thread Alvaro Herrera
Ron St-Pierre wrote: > I stopped using autovacuum months ago because of similar problems > (version 8.1.4). Because we do some major inserts and updates about four > times a day, there were a few tables that I didn't want autovacuumed. > Even after I turned autovacuum off for these tables it sti

[Fwd: Re: [GENERAL] Autovacuum keeps vacuuming a table disabled in pg_autovacuum]

2007-06-01 Thread Ron St-Pierre
I stopped using autovacuum months ago because of similar problems (version 8.1.4). Because we do some major inserts and updates about four times a day, there were a few tables that I didn't want autovacuumed. Even after I turned autovacuum off for these tables it still tried to vacuum them whil

[GENERAL] Interval Rounding

2007-06-01 Thread Mike Ginsburg
Hello, I have a table that contains a user's response and a timestamp at which it was last updated. I want to query for this response, and the amount of time that has elapsed since, rounded to the nearest unit (e.g. minutes, days, months, etc). I am using: SELECT NOW() - change_time FROM .

Re: [GENERAL] warm standby server stops doingcheckpointsafterawhile

2007-06-01 Thread Frank Wittig
Hi Teodor, Teodor Sigaev schrieb: > Hope, attached patch fix that. Pls, test it. The patch is running. I'll keep on reporting. Have a nice weekend. Greetings, Frank Wittig signature.asc Description: OpenPGP digital signature

Re: [GENERAL] multimaster

2007-06-01 Thread Chris Browne
[EMAIL PROTECTED] ("Alexander Staubo") writes: > On 6/1/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: >> These are all different solutions to different problems, so it's not >> surprising that they look different. This was the reason I asked, >> "What is the problem you are trying to solve?" > >

Re: [GENERAL] Seq Scan

2007-06-01 Thread Joshua D. Drake
Tyler Durden wrote: Hi, I'm having some problems in performance in a simple select count(id) from I have 700 000 records in one table, and when I do: # explain select (id) from table_name; -[ RECORD 1 ] QUERY PLAN | Seq Scan on

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Chris Browne
[EMAIL PROTECTED] writes: > I'm disappointed because SLONY-II has not been released yet to support > multi-master replication! PostgreSQL is going through all of the > releases - and that's great - BUT, where is the sync-up with the > powerhouse of a component, that Slony-II would bring to the tab

Re: [GENERAL] multimaster

2007-06-01 Thread Joshua D. Drake
Andrew Sullivan wrote: On Fri, Jun 01, 2007 at 11:50:09AM -0700, Joshua D. Drake wrote: What you are basically saying below is... web 2.0 developers such as rails developers have so fundamentally broken the way it is supposed to be done, we should too... I don't know that's all there is to it

Re: [GENERAL] collision in serial numbers after INSERT?

2007-06-01 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > On May 31, 2007, at 11:46 , [EMAIL PROTECTED] wrote: >> However, I wondered, if I were in an environment where there were many >> concurrent inserts, would it be possible that I didn't get the serial >> number of the insert that *I* just did? > No.

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Tom Lane
"Alexander Staubo" <[EMAIL PROTECTED]> writes: > On 6/1/07, Jeff Davis <[EMAIL PROTECTED]> wrote: >> To be fair to Slony-I, the fact that it does not replicate DDL is a >> feature, not a bug. It's table-based, which is a very flexible design. > I fail to see how that's an excuse not to replicate D

Re: [GENERAL] collision in serial numbers after INSERT?

2007-06-01 Thread Aurynn Shaw
Hi; Thanks Aurynn, but then I have another question -- Even if I do a 'SELECT nextval('your_sequence');', how do I prevent an insert from happening between me selecting the next serial value and then actually inserting it? It seems like I should lock the table if i want to be certain. S

Re: [GENERAL] multimaster

2007-06-01 Thread Andrew Sullivan
On Fri, Jun 01, 2007 at 11:50:09AM -0700, Joshua D. Drake wrote: > What you are basically saying below is... web 2.0 developers such as > rails developers have so fundamentally broken the way it is supposed to > be done, we should too... I don't know that's all there is to it. After all, we sup

Re: multimaster (was: [GENERAL] Slightly OT.)

2007-06-01 Thread Andrew Sullivan
On Fri, Jun 01, 2007 at 08:40:13PM +0200, Alexander Staubo wrote: > On 6/1/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: > >These are all different solutions to different problems, so it's not > >surprising that they look different. This was the reason I asked, > >"What is the problem you are try

Re: [GENERAL] collision in serial numbers after INSERT?

2007-06-01 Thread Michael Glaesemann
On May 31, 2007, at 11:46 , [EMAIL PROTECTED] wrote: However, I wondered, if I were in an environment where there were many concurrent inserts, would it be possible that I didn't get the serial number of the insert that *I* just did? No. http://www.postgresql.org/docs/faqs.FAQ.html#item4.11.

Re: [GENERAL] collision in serial numbers after INSERT?

2007-06-01 Thread Bill Moran
In response to [EMAIL PROTECTED]: > Hello all - > > I'm working on a site with PHP and Postgres, coming from a MySQL > background. > > I was looking for an equivalent to the mysql_insert_id() function, and > a site recommended this: > > function postg_insert_id($tablename, $fieldname) > { > gl

Re: [GENERAL] Interval Rounding

2007-06-01 Thread Michael Glaesemann
On Jun 1, 2007, at 13:00 , Mike Ginsburg wrote: age() is exactly what I needed. Now I just feel dumb for not looking into it. As far as getting the highest unit (day, month, year, etc) I am currently using CASES SELECT CASE WHEN (now() - change_time) < '1 min'::interva

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Andrew Sullivan
On Fri, Jun 01, 2007 at 08:57:36PM +0200, Alexander Staubo wrote: > I fail to see how that's an excuse not to replicate DDL. If I run > "alter table" on the master, there is no reason whatever that this > command cannot be executed on all the slaves -- which is what I would > expect of a replicatio

Re: [GENERAL] invalid memory alloc after insert with c trigger function

2007-06-01 Thread Dudás József
Thank you and other helpfully peoples the interest about my first steps in your world. I learned more than I hope. This function work fine now. Can you to offer me place where I find these information, because I read the postgresql source code to find these macros. Regards, Josef Dudás Józ

Re: [GENERAL] warm standby server stops doing checkpointsafterawhile

2007-06-01 Thread Dhaval Shah
I am following this thread with interest and hence as a request if the discussion is kept in this thread, is easier for me to follow it. Just recently I have put the WAL standby in production using 8.2.3 and would like to know the circumstances where I will need to upgrade. Hence the interest. R

[GENERAL] collision in serial numbers after INSERT?

2007-06-01 Thread lawpoop
Hello all - I'm working on a site with PHP and Postgres, coming from a MySQL background. I was looking for an equivalent to the mysql_insert_id() function, and a site recommended this: function postg_insert_id($tablename, $fieldname) { global connection_id; $result=pg_exec($connection_id, "SEL

[GENERAL] synchronisation with news.fr.postgresql.org?

2007-06-01 Thread stig erikson
Hi. What happened to the synchronization of news servers between news.postgresql.org and news.fr.postgresql.org. the latter is there, but the groups are empty. this is very sad since that server was very quick for us living in Europe. is it only a temporary problem or is it removed for some reas

[GENERAL] ERROR: domain domain1 does not allow null values

2007-06-01 Thread Юдыцкий Игорь Владислав ович
Hello. I've found unexpected behavior of PostgreSQL 8.2.3 CREATE DOMAIN "public"."domain1" AS integer NOT NULL; CREATE TABLE "public"."table1" ("field1" "public"."domain1") WITH OIDS; CREATE OR REPLACE FUNCTION "public"."function1" () RETURNS text AS $body$ declare a public.table1%ROWTYPE; beg

Re: [GENERAL] table partitioning pl/pgsql helpers

2007-06-01 Thread Robert Treat
On Wednesday 30 May 2007 12:55, Enrico Sirola wrote: > Hello, > > I'm trying to write a trigger on insert which should insert the row > in another > table. The table on which to insert the row should be selected at > runtime and > it is not know in advance. For example, let's say we have a table wi

[GENERAL] what happened with the news servers?

2007-06-01 Thread stig erikson
Hi. i am looking at the news (NNTP) servers news.postgresql.org and news.fr.postgresql.org, they both seem pretty empty. what happened? stig ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] invalid memory alloc after insert with c trigger function

2007-06-01 Thread Dudás József
This is the debug of last varcharout routine: Breakpoint 1, varcharout (fcinfo=0xbf8a1e7c) at varchar.c:441 441 VarChar*s = PG_GETARG_VARCHAR_P(0); 440 { (gdb) print fcinfo $25 = (FunctionCallInfo) 0xbf8a1e7c 441 VarChar*s = PG_GETARG_VARCHAR_P(0); 446

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Joshua D. Drake
Alexander Staubo wrote: On 6/1/07, Jeff Davis <[EMAIL PROTECTED]> wrote: On Fri, 2007-06-01 at 17:00 +0200, Alexander Staubo wrote: > the projected Slony-II design, but the setup seems dead simple, and > from the docs I have found it seems to transparently replicate schema > changes, unlike Slon

Re: [GENERAL] Multiple customers sharing one database?

2007-06-01 Thread Michael Glaesemann
On Jun 1, 2007, at 13:27 , Rick Schumeyer wrote: I'm developing an application that will be used by several independent customers. Conceptually, the data from one customer has no relation at all to another customer. In fact, each customer's data is private, and you would never combine da

Re: [GENERAL] warm standby server stops doingcheckpointsafterawhile

2007-06-01 Thread Simon Riggs
On Fri, 2007-06-01 at 22:42 +0400, Teodor Sigaev wrote: > Found a reason: if parent page is fully backuped after child's split then > forgetIncompleteSplit() isn't called at all. i.e. full_page_writes = on > Hope, attached patch fix that. Pls, test it. > > PS I'm going away for weekend, so I'll

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Alexander Staubo
On 6/1/07, Jeff Davis <[EMAIL PROTECTED]> wrote: On Fri, 2007-06-01 at 17:00 +0200, Alexander Staubo wrote: > the projected Slony-II design, but the setup seems dead simple, and > from the docs I have found it seems to transparently replicate schema > changes, unlike Slony-I. So that's something.

Re: [GENERAL] invalid memory alloc after insert with c trigger function

2007-06-01 Thread Gregory Stark
Dudás József <[EMAIL PROTECTED]> writes: > Yes! You are right! Now must me find out how to convert char* to numeric datum > and double to numeric datum and numeric datum to double :) If you have a char* you can usually call a types input function which is usally "type_in" or "typein" like: Dir

Re: [GENERAL] multimaster

2007-06-01 Thread Joshua D. Drake
Alexander Staubo wrote: On 6/1/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: These are all different solutions to different problems, so it's not surprising that they look different. This was the reason I asked, "What is the problem you are trying to solve?" You mean aside from the obvious o

Re: [GENERAL] warm standby server stops doingcheckpointsafterawhile

2007-06-01 Thread Teodor Sigaev
Found a reason: if parent page is fully backuped after child's split then forgetIncompleteSplit() isn't called at all. Hope, attached patch fix that. Pls, test it. PS I'm going away for weekend, so I'll not be online until Monday. -- Teodor Sigaev E-mail: [

Re: multimaster (was: [GENERAL] Slightly OT.)

2007-06-01 Thread Alexander Staubo
On 6/1/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: These are all different solutions to different problems, so it's not surprising that they look different. This was the reason I asked, "What is the problem you are trying to solve?" You mean aside from the obvious one, scalability? The dat

[GENERAL] Multiple customers sharing one database?

2007-06-01 Thread Rick Schumeyer
I'm developing an application that will be used by several independent customers. Conceptually, the data from one customer has no relation at all to another customer. In fact, each customer's data is private, and you would never combine data from different customers. I'm trying to decide whe

Re: [GENERAL] Slightly OT.

2007-06-01 Thread Jeff Davis
On Fri, 2007-06-01 at 17:00 +0200, Alexander Staubo wrote: > the projected Slony-II design, but the setup seems dead simple, and > from the docs I have found it seems to transparently replicate schema > changes, unlike Slony-I. So that's something. > To be fair to Slony-I, the fact that it does n

Re: [GENERAL] Interval Rounding

2007-06-01 Thread Mike Ginsburg
age() is exactly what I needed. Now I just feel dumb for not looking into it. As far as getting the highest unit (day, month, year, etc) I am currently using CASES SELECT CASE WHEN (now() - change_time) < '1 min'::interval THEN date_part('seconds', age(now(), change_time))

Re: [GENERAL] Seq Scan

2007-06-01 Thread Reece Hart
On Fri, 2007-06-01 at 18:24 +0100, Tyler Durden wrote: > It uses Index Scan for id>20 and Seq Scan for id>10?! Based on the statistics pg has for your table, and on the cost of using the index, the cost based optimizer decided that it's more efficient to seq scan all of the rows than to incu

Re: [GENERAL] Restoring 8.2 to 8.0

2007-06-01 Thread RW
I've never tried this but maybe it works if you use pg_dump from 8.0 to do the dump. Greetings Robert Robert Fitzpatrick wrote: I have a dump from 8.2 restored to file that was pg_dump'd with format c from a production server. I want to know if it is possible for me to restore this to a 8.0 dev

Re: [GENERAL] Seq Scan

2007-06-01 Thread Michael Glaesemann
On Jun 1, 2007, at 12:24 , Tyler Durden wrote: On 6/1/07, Joshua D. Drake <[EMAIL PROTECTED]> wrote: Nothing. You have to scan the table because you aren't giving postgresql anything to use the index by. # explain ANALYZE select id from table_name where id>20;

Re: [GENERAL] Interval Rounding

2007-06-01 Thread Michael Glaesemann
On Jun 1, 2007, at 12:11 , Mike Ginsburg wrote: SELECT NOW() - change_time FROM ... to get the interval, and am attempting to use either EXTRACT() or DATE_PART() to get the appropriate value, but the interval doesn't contain any unit higher than days. It'd be helpful to me to see the res

  1   2   >