Re: [GENERAL] UPDATE on two large datasets is very slow

2007-04-04 Thread Martijn van Oosterhout
On Mon, Apr 02, 2007 at 08:24:46PM -0700, Steve Gerhardt wrote: I've been working for the past few weeks on porting a closed source BitTorrent tracker to use PostgreSQL instead of MySQL for storing statistical data, but I've run in to a rather large snag. The tracker in question buffers its

[GENERAL] OS X Kernel settings

2007-04-04 Thread Jamie Deppeler
Is it possible to set shared memory settings on the fly in OS X like you can in Linux e.g. sysctl -w kernel.shmmax=134217728 I have tried sysctl -w kern.sysv.shmmax=134217728 with no luck, i know you can edit /etc/sysctl.conf file. But i would sooner set these settings as part of the

Re: [GENERAL] UPDATE on two large datasets is very slow

2007-04-04 Thread Tommy Gildseth
Martijn van Oosterhout wrote: On Mon, Apr 02, 2007 at 08:24:46PM -0700, Steve Gerhardt wrote: I've been working for the past few weeks on porting a closed source BitTorrent tracker to use PostgreSQL instead of MySQL for storing statistical data, but I've run in to a rather large snag. The

[GENERAL] Problem with a transaction on dump

2007-04-04 Thread Froggy / Froggy Corp.
Hello everyone, It is the second time i got this error message (sorry, its french, i prefer to c/p this one than making a bad translation) : ---88---8--- pg_dump: ERREUR: Impossible d'accéder au statut de la transaction 892415538 DETAIL: Impossible d'ouvrir le

Re: [GENERAL] COPY FROM - how to identify results?

2007-04-04 Thread Jaime Silvela
I agree that with a temp table, the portfolio_id could be cleanly inserted as you suggest, from the temp table into the staging table. The staging table would need a portfolio_id, since it could house data from several different spreadsheets at the same time. In fact, the staging table could

Re: [GENERAL] COPY FROM - how to identify results?

2007-04-04 Thread Jaime Silvela
I can't use triggers because I need a specific my_id. Here's the scenario: a user is browsing the web page for portfolio_id = 3, and wants to update the values. He uploads a CSV file, and I need its entries to be tagged with portfolio_id = 3, as another user could be uploading a CSV file for

Re: [GENERAL] Problem with a transaction on dump

2007-04-04 Thread Alvaro Herrera
Froggy / Froggy Corp. wrote: Hello everyone, It is the second time i got this error message (sorry, its french, i prefer to c/p this one than making a bad translation) : ---88---8--- pg_dump: ERREUR: Impossible d'accéder au statut de la transaction

Re: [GENERAL] OS X Kernel settings

2007-04-04 Thread Guido Neitzer
On 03.04.2007, at 23:00, Jamie Deppeler wrote: Is it possible to set shared memory settings on the fly in OS X like you can in Linux e.g. sysctl -w kernel.shmmax=134217728 If this wasn't changed recently - no you can't. If you use /etc/sysctl.conf make sure it is loaded in /etc/rc before

Re: [GENERAL] Problem with a transaction on dump

2007-04-04 Thread Froggy / Froggy Corp.
Alvaro Herrera wrote: Froggy / Froggy Corp. wrote: Hello everyone, It is the second time i got this error message (sorry, its french, i prefer to c/p this one than making a bad translation) : ---88---8--- pg_dump: ERREUR: Impossible d'accéder

Re: [GENERAL] Problem with a transaction on dump

2007-04-04 Thread Alvaro Herrera
Froggy / Froggy Corp. wrote: Alvaro Herrera wrote: Froggy / Froggy Corp. wrote: Hello everyone, It is the second time i got this error message (sorry, its french, i prefer to c/p this one than making a bad translation) : ---88---8---

Re: [GENERAL] Problem with a transaction on dump

2007-04-04 Thread Froggy / Froggy Corp.
Alvaro Herrera wrote: Froggy / Froggy Corp. wrote: Alvaro Herrera wrote: Froggy / Froggy Corp. wrote: Hello everyone, It is the second time i got this error message (sorry, its french, i prefer to c/p this one than making a bad translation) :

Re: [GENERAL] Problem with a transaction on dump

2007-04-04 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Froggy / Froggy Corp. wrote: pg_dump: ERREUR: Impossible d'accéder au statut de la transaction 892415538 What files are there in main/pg_clog? Doesn't really matter --- I'd say it's pretty obviously a data corruption problem. That value equates to

Re: [GENERAL] UPDATE on two large datasets is very slow

2007-04-04 Thread Martijn van Oosterhout
On Wed, Apr 04, 2007 at 11:34:22AM +0200, Tommy Gildseth wrote: For the record, this is what the SQL MERGE command is for... I don't think anyone is working on implementing that though... This will possibly provide a solution to this question:

Re: [GENERAL] use superuser connection from php

2007-04-04 Thread [EMAIL PROTECTED]
Martijn van Oosterhout wrote: To use the superuser connections you need to login as superuser... Eh... OK. I feel a bit stupid :) Thanks ;) Iv ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] use superuser connection from php

2007-04-04 Thread [EMAIL PROTECTED]
Albe Laurenz wrote: You can connect as superuser on a different connection and issue that SELECT statement. OK But I wouldn't do that. What if there is a problem and all availaible superuser connections are exhausted? You would not be able to connect to the database any more, even as

Re: [GENERAL] Using C# to create stored procedures

2007-04-04 Thread Andrus
Who dreads PL/pgSQL? It's a pretty easy language to learn. Granted, not as easy as one you already know, but I'm not aware of any RDBMS that supports C# as a stored procedure language. I needd to re-write a lot of compliatated SQL select statements to run them in server which generate

Re: [GENERAL] UPDATE on two large datasets is very slow

2007-04-04 Thread Steve Gerhardt
Tom Lane wrote: You're focusing on the wrong thing --- there's nothing wrong with the plan. It's only taking 9 seconds to perform the merge join. The other 183 seconds are going somewhere else; you need to find out where. One thing that came to mind was triggers, which would be shown in the

Re: [GENERAL] inserting multiple values in version 8.1.5

2007-04-04 Thread Jonathan Vanasco
On Apr 3, 2007, at 10:33 AM, A. Kretschmer wrote: am Tue, dem 03.04.2007, um 7:19:15 -0700 mailte [EMAIL PROTECTED] folgendes: I need to do like 1000 inserts periodically from a web app. Is it better to do 1000 inserts or 1 insert with the all 1000 rows? Is using copy command faster

[GENERAL] newid() in postgres

2007-04-04 Thread marcel.beutner
Hello NG, Is there an equivalent in postgres for the newid() function like in sqlserver? I need to generate a unique identifier in my select statement: SELECT X, newid(), Y FROM MyTable X newid() Y

[GENERAL] Postgres 7.4: how to disconnect users without restarting postmaster

2007-04-04 Thread Manoj Lal
Hi, I have the following requirements, and I want to do them without shutting down postgres. Any help appreciated. 1. Get a list of connections to the postgres server 2. Disconnect some/all connections from postgres 3. I modified the pg_hba.conf to block a particular user from connecting to

[GENERAL] a couple of newbie question - deferrable, varchar vs text, 2 dbs

2007-04-04 Thread Sergei Shelukhin
1) Do I understand it correctly that cross database queries are not possible? Two dbs on the same server are used in this case. 2) What's the difference between unlimited length varchar and text columns? I am mostly interested in performance, namely = 'blah' and like '%blah%' queries over these

Re: [GENERAL] Webappication and PostgreSQL login roles

2007-04-04 Thread Ben Trewern
I think it's something like SELECT 'md5' + md5(password + username); Regards, Ben Thorsten Kraus [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This would be a possible way. Now the question is which algorithm implementation of md5 PostgreSQL uses... Bye, Thorsten Ben

Re: [GENERAL] Postgres 7.4: how to disconnect users without restarting postmaster

2007-04-04 Thread Manoj Lal
Retrying after subscribing... got a delayed delivery message earlier. Hi, I have the following requirements, and I want to do them without shutting down postgres. Any help appreciated. 1. Get a list of connections to the postgres server 2. Disconnect some/all connections from postgres 3.

Re: [GENERAL] UPDATE on two large datasets is very slow

2007-04-04 Thread Steve Gerhardt
The problem with this approach is really that the tracker + website combination is designed to show really detailed statistics for every user on every torrent, which (as you mentioned) complicates things a great deal. It's also able to store all the history information for all the clients,

[GENERAL] Need your help on using partion

2007-04-04 Thread Huynh Ngoc Doan
/*I'm learning how to use the partion in Postgres 8.2.3 so I want to do some test for my awareness. I create 2 tables: The parent table is cities:*/ CREATE TABLE xxx.cities ( id serial NOT NULL, name text, population real, altitude integer, CONSTRAINT pk_cities PRIMARY KEY (id) )

[GENERAL] Storing blobs in PG DB

2007-04-04 Thread Nikolay Moskvichev
Hi All! Question is : How suitable PG for storing about 2 000 000 binary files 0,5-2,0 Mb size each ? It is not planned the big number of clients or a plenty of updatings. Like photoalbum on local host. ---(end of broadcast)--- TIP 3: Have you

Re: [GENERAL] Storing blobs in PG DB

2007-04-04 Thread Listmail
You don't like filesystems ? On Wed, 04 Apr 2007 07:44:57 +0200, Nikolay Moskvichev [EMAIL PROTECTED] wrote: Hi All! Question is : How suitable PG for storing about 2 000 000 binary files 0,5-2,0 Mb size each ? It is not planned the big number of clients or a plenty of

Re: [GENERAL] UPDATE on two large datasets is very slow

2007-04-04 Thread Listmail
Any suggestions for finding out where all the time is being spent? I'm - time spent updating indexes ? do you have a lot of them ? - try with fsync off (not in production, but it will give you an idea) ---(end of broadcast)---

[GENERAL] dropping role w/dependent objects

2007-04-04 Thread Ed L.
This is pgsql 8.2.3: % psql -c drop role mygroup ERROR: role mygroup cannot be dropped because some objects depend on it DETAIL: 227 objects in this database How do I identify what these dependent objects are? I've removed all of the users from this group, turned up server logging to

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Alvaro Herrera
Ed L. wrote: This is pgsql 8.2.3: % psql -c drop role mygroup ERROR: role mygroup cannot be dropped because some objects depend on it DETAIL: 227 objects in this database How do I identify what these dependent objects are? Hum, this seems to be a bug. The objects are supposed to be

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Ed L.
On Wednesday April 4 2007 4:35 pm, Alvaro Herrera wrote: Note that you can give the objects owned by that role to someone else with REASSIGN OWNED, and drop the objects with DROP OWNED (note that they act differently regarding grants; see the docs) Yes, but how do identify what they are so

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Ed L.
On Wednesday April 4 2007 4:39 pm, Ed L. wrote: On Wednesday April 4 2007 4:35 pm, Alvaro Herrera wrote: Note that you can give the objects owned by that role to someone else with REASSIGN OWNED, and drop the objects with DROP OWNED (note that they act differently regarding grants; see

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Ed L.
On Wednesday April 4 2007 4:41 pm, Ed L. wrote: On Wednesday April 4 2007 4:39 pm, Ed L. wrote: On Wednesday April 4 2007 4:35 pm, Alvaro Herrera wrote: Note that you can give the objects owned by that role to someone else with REASSIGN OWNED, and drop the objects with DROP OWNED (note

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Alvaro Herrera
Ed L. wrote: On Wednesday April 4 2007 4:35 pm, Alvaro Herrera wrote: Note that you can give the objects owned by that role to someone else with REASSIGN OWNED, and drop the objects with DROP OWNED (note that they act differently regarding grants; see the docs) Yes, but how do

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Martin Gainty
Ed-- check out REASSIGN OWNED http://www.postgresql.org/docs/current/static/sql-reassign-owned.html then use CASCADE option of DROP OWNED to drop dependents e.g. DROP OWNED BY FUBAR CASCADE http://www.postgresql.org/docs/current/static/sql-drop-owned.html HTH, Martin -- This email message and

Re: [GENERAL] newid() in postgres

2007-04-04 Thread Peter Eisentraut
marcel.beutner wrote: I've searched in the groups already, but couldn't find any helpful information - only to use a sequence, which returns just a number and not a unique identifier. Which properties do your unique identifiers posses that are not satisfied by a number returned by a sequence?

Re: [GENERAL] a couple of newbie question - deferrable, varchar vs text, 2 dbs

2007-04-04 Thread Peter Eisentraut
Sergei Shelukhin wrote: 1) Do I understand it correctly that cross database queries are not possible? Yes. 2) What's the difference between unlimited length varchar and text columns? Mostly only the spelling. 3) Will adding deferrable to FKs that reference very large tables speed up

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Alvaro Herrera
Ed L. wrote: On Wednesday April 4 2007 4:39 pm, Ed L. wrote: On Wednesday April 4 2007 4:35 pm, Alvaro Herrera wrote: Note that you can give the objects owned by that role to someone else with REASSIGN OWNED, and drop the objects with DROP OWNED (note that they act differently

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Ed L.
On Wednesday April 4 2007 4:48 pm, Alvaro Herrera wrote: Yes, but how do identify what they are so that I know if I want to DROP OWNED them? There's no way AFAICT, short of peeking the catalogs (or information_schema). Try pg_shdepend. I guess if the bug were fixed, it'd be a non-issue.

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Alvaro Herrera
Ed L. wrote: On Wednesday April 4 2007 4:48 pm, Alvaro Herrera wrote: Yes, but how do identify what they are so that I know if I want to DROP OWNED them? There's no way AFAICT, short of peeking the catalogs (or information_schema). Try pg_shdepend. I guess if the bug were fixed,

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Ed L.
On Wednesday April 4 2007 5:02 pm, Alvaro Herrera wrote: I guess if the bug were fixed, it'd be a non-issue. Sure, please submit a patch.  It should not be too difficult. Perhaps this could be added to the TODO list? I won't get to it anytime soon. Ed ---(end of

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Bruce Momjian
Ed L. wrote: On Wednesday April 4 2007 5:02 pm, Alvaro Herrera wrote: I guess if the bug were fixed, it'd be a non-issue. Sure, please submit a patch. ?It should not be too difficult. Perhaps this could be added to the TODO list? I won't get to it anytime soon. Yes. What should the

[GENERAL] PG 8.2.3, FSM warning VACUUM

2007-04-04 Thread Sergey E. Koposov
Hello All, Recently I experienced the strange PG behaviour with the large tables in PG 8.2.3 which I didn't have in 8.1: I have the large table: around 1 million records and around 400 columns. When I try to run VACUUM ANALYZE on it, I'm getting the message: WARNING: relation public.xx

[GENERAL] OS X Kernel settings

2007-04-04 Thread Jamie Deppeler
Is this a safe setting for g5 1gig ram Os 10.4.9 sysctl -w kern.sysv.shmmax=167772160 sysctl -w kern.sysv.shmmin=1 sysctl -w kern.sysv.shmmni=32 sysctl -w kern.sysv.shmseg=8 sysctl -w kern.sysv.shmall=65536 ---(end of broadcast)--- TIP 9: In

Re: [GENERAL] dropping role w/dependent objects

2007-04-04 Thread Ed L.
On Wednesday April 4 2007 5:37 pm, Bruce Momjian wrote: Perhaps this could be added to the TODO list? I won't get to it anytime soon. Yes. What should the TODO text be? See if the attached patch is acceptable. If not, perhaps the TODO text should be: Enable end user to identify

[GENERAL] Problem with oids for table names getting out of sync?

2007-04-04 Thread Omar Eljumaily
This is with 8.1.8, but I don't see any mention of any bug fixes that cover this. I've run into this sort of obscure problem. I'm using libpq with a front end database api where I need to track column names and how they're returned in libpq queries. What's happening is that I start out

Re: [GENERAL] OS X Kernel settings

2007-04-04 Thread Guido Neitzer
On 04.04.2007, at 16:55, Jamie Deppeler wrote: Is this a safe setting for g5 1gig ram Os 10.4.9 sysctl -w kern.sysv.shmmax=167772160 sysctl -w kern.sysv.shmmin=1 sysctl -w kern.sysv.shmmni=32 sysctl -w kern.sysv.shmseg=8 sysctl -w kern.sysv.shmall=65536 Why shouldn't it be safe? cug

Re: [GENERAL] Problem with oids for table names getting out of sync?

2007-04-04 Thread Omar Eljumaily
One other thing about this issue. A work around is that I can parse sql statements myself to come up with the table names. Yes, it's a bit of work, but not too bad. My question is whether or not column/table combinations are guaranteed to return in the order that the table names appear in a

Re: [GENERAL] Storing blobs in PG DB

2007-04-04 Thread Harvey, Allan AC
I find it fine. Bit different usage though. I store about 200 50MB items. Allan Hi All! Question is : How suitable PG for storing about 2 000 000 binary files 0,5-2,0 Mb size each ? It is not planned the big number of clients or a plenty of updatings. Like photoalbum on local host.

Re: [GENERAL] newid() in postgres

2007-04-04 Thread Postgres User
Marcel, A sequence represents a unique identifier. You can call the function 'nextval' to get the next unique value in the sequence. See related functions here: http://www.postgresql.org/docs/8.2/interactive/functions-sequence.html In this code, I get the next sequence, insert it into a

Re: [GENERAL] Need your help on using partion

2007-04-04 Thread Postgres User
My guess is that when you insert into Cities, the sequence field is incremented one time (=2), and when the Rule is executed to insert into Capital, the sequence is incremented a second time (=3). As a result of these 2 operations, the sequence is incremented 2 times. I don't know anything

Re: [GENERAL] Storing blobs in PG DB

2007-04-04 Thread Postgres User
I recently heard from Josh Berkus that at least one major CMS application uses Postgres to store entire HTML pages (including image files) in order to support full versioning. As a general rule, I prefer not to store BLOBS in a DB- I'd rather leave the BLOB in the file system and let the db save

Re: [GENERAL] Using MS Access front-end with PG]

2007-04-04 Thread Postgres User
Oleg, This looks like a great module, do you have a pointer to it in English? If can send this module to me as a compressed file, I'll take the time to post it on PgFoundry as a new project that everyone can easily access and download. Paul- if you go with the lower() edits route, be sure to

Re: [GENERAL] Using MS Access front-end with PG]

2007-04-04 Thread Oleg Bartunov
On Wed, 4 Apr 2007, Postgres User wrote: Oleg, This looks like a great module, do you have a pointer to it in English? unfortunately, no. If can send this module to me as a compressed file, I'll take the time to post it on PgFoundry as a new project that everyone can easily access and

Re: [GENERAL] Granting permissions

2007-04-04 Thread A. Kretschmer
am Wed, dem 04.04.2007, um 22:23:20 -0700 mailte Postgres User folgendes: Is there a way to grant INSERT and UPDATE permissions on all the tables in a database? I don't want to type-in every table name...

[GENERAL] Granting permissions

2007-04-04 Thread Postgres User
Is there a way to grant INSERT and UPDATE permissions on all the tables in a database? I don't want to type-in every table name... ---(end of broadcast)--- TIP 6: explain analyze is your friend