Re: [GENERAL] PL/R download

2011-07-07 Thread jc9121
Hi Joe, I think your website is down again - I'm trying to install PLR on my windows machine and your instructions can come in handy :) thanks James -- View this message in context: http://postgresql.1045698.n5.nabble.com/PL-R-download-tp1903585p4559990.html Sent from the PostgreSQL - general

Re: [GENERAL] ERROR: malformed record literal: "",DETAIL: Missing left parenthesis?

2011-07-07 Thread Albe Laurenz
> A question about: ERROR: malformed record literal: "" > DETAIL: Missing left parenthesis. > > Can someone tell me what cause the error? > > > Table z_drop; > Column| Type > -+ > run_date| character varying(128)

Re: [GENERAL] failed archive command

2011-07-07 Thread Craig Ringer
On 7/07/2011 12:39 PM, Joe Lester wrote: DETAIL: The failed archive command was: /usr/bin/scp -B /Volumes/DataDrive/data/pg_xlog/000100740086 postgres@172.20.204.55:/Volumes/DataDrive/wals_from_master/000100740086 LOG: archiver process (PID 17771) exited with exit cod

Re: [GENERAL] Request for help - Does anyone in Seattle need a Postgres job?

2011-07-07 Thread Peter Geoghegan
It is in the wrong place. There is a jobs mailing list though. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services

[GENERAL] Latency problems with simple queries

2011-07-07 Thread Adrian Schreyer
I randomly get latency/performance problems even with very simple queries, for example fetching a row by primary key from a small table. Since I could not trace it back to specific queries, I decided to give LatencyTOP (http://www.latencytop.org/) a go. Soon after running a couple of queries, I saw

Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore is very slow

2011-07-07 Thread David Hartveld
> -Oorspronkelijk bericht- > Van: Simon Riggs [mailto:si...@2ndquadrant.com] > Verzonden: donderdag 7 juli 2011 01:07 > Aan: David Hartveld > CC: pgsql-general@postgresql.org > Onderwerp: Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore > is very slow > > On Wed, Jul 6, 20

Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore is very slow

2011-07-07 Thread Simon Riggs
On Thu, Jul 7, 2011 at 1:12 PM, David Hartveld wrote: >> >> On Wed, Jul 6, 2011 at 4:54 PM, David Hartveld >> wrote: >> >> > Is there possibly a known issue with the beta, or do I have to >> > configure my cluster differently for 9.1? >> >> Thanks for trying 9.1beta >> >> No known bugs, no diffe

Re: [GENERAL] Request for help - Does anyone in Seattle need a Postgres job?

2011-07-07 Thread Adrian Klaver
On Wednesday, July 06, 2011 4:00:11 pm Brendan Prouty wrote: > Greetings Postgres Community, > > > I am certain that I am signing my own death certificate by emailing to a > general address that is out of place, but I was referred to this list by a > Postgres advocate here in Seattle, who suggest

[GENERAL] Trying to find miss and mister of the last month with highest rating

2011-07-07 Thread Alexander Farber
Hello, at my website users can rate each other: # select id, nice, last_rated from pref_rep where nice=true order by last_rated desc limit 7; id | nice | last_rated +--+ OK152565298368 | t| 2011-07

[GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread akp geek
Hi all - Are there any open source tools available for migrating from oracle to postgres. We have 20 tables in oracles that we needed to get to postgres. Appreciate your help Regards

[GENERAL] Documentation issue

2011-07-07 Thread salah jubeh
Hello, In http://www.postgresql.org/docs/8.4/static/xfunc-c.html, there is a missing include to the utils/geo_decls.h which leads to compilation errors. i.e #include "utils/geo_decls.h" needs to be added to the code. Kind regards

Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore is very slow

2011-07-07 Thread David Hartveld
> > Your output indicates that there is a problem in your replication > > setup and this is why the slave does not catch up. > > > > This is not a performance issue. It is either a bug in replication, or > > a user configuration issue. Since few things have changed in 9.1 in > > this area, at the m

[GENERAL] DELETE taking too much memory

2011-07-07 Thread vincent dephily
Hi, I have a delete query taking 7.2G of ram (and counting) but I do not understant why so much memory is necessary. The server has 12G, and I'm afraid it'll go into swap. Using postgres 8.3.14. I'm purging some old data from table t1, which should cascade-delete referencing rows in t2. Here's an

Re: [GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread Craig Ringer
On 7/07/2011 9:55 PM, akp geek wrote: Hi all - Are there any open source tools available for migrating from oracle to postgres. We have 20 tables in oracles that we needed to get to postgres. Appreciate your help One avenue you may wish to investigate is ETL tools like Talend.

Re: [GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread casp
Good truth migration between Oracle and PostgreSQL are not things difficult: Indicates that your database has: Tables: 20 Shema:? functions:? Views:? They need help to migrate ... Or what are you suggestions if you need a tool that already does this task for you good people have a tool interprise

Re: [GENERAL] Trying to find miss and mister of the last month with highest rating

2011-07-07 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alexander Farber Sent: Thursday, July 07, 2011 9:54 AM To: pgsql-general Subject: [GENERAL] Trying to find miss and mister of the last month with highest rating # select id,

Re: [GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread Andrew Sullivan
On Thu, Jul 07, 2011 at 09:55:45AM -0400, akp geek wrote: > Hi all - > >Are there any open source tools available for migrating from > oracle to postgres. We have 20 tables in oracles that we needed to get to > postgres. Appreciate your help I have used ora2pg. It was not seamles

Re: [GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread salah jubeh
Hello, I do no have any experience with oracle, try to dump the oracle database in plain format and then try to execute the DDL and DML statements. It might be cumbersome to fix all the errors you might get. But as an initial solution give it a shot. Regards __

Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore is very slow

2011-07-07 Thread Simon Riggs
On Thu, Jul 7, 2011 at 2:59 PM, David Hartveld wrote: > I've been looking at my log files on master and slave a bit better, after > having set log_min_messages = debug5. I can see that somehow the master and > slave don't properly work together: the slave attempts to send some data > ('sending

Re: [GENERAL] Latency problems with simple queries

2011-07-07 Thread Jeff Davis
On Thu, 2011-07-07 at 12:13 +0100, Adrian Schreyer wrote: > I randomly get latency/performance problems even with very simple > queries, for example fetching a row by primary key from a small table. > Since I could not trace it back to specific queries, I decided to give > LatencyTOP (http://www.la

Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore is very slow

2011-07-07 Thread Simon Riggs
On Thu, Jul 7, 2011 at 3:37 PM, David Hartveld wrote: > Other suggestions? If speed is your concern, a little performance tuning might help, judging from your configs. http://www.2ndQuadrant.com/books/ or other sources will help. I'm interested in seeing some ERROR messages from either system,

Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore is very slow

2011-07-07 Thread Tom Lane
Looking back, I notice that you built with gcc 4.6.0. At least on Red Hat machines, that gcc has a rather nasty optimization bug that breaks WAL replay, with symptoms that seem to match what you have here --- namely, the replay process quits and has to be restarted every few pages. I'm betting Deb

Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore is very slow

2011-07-07 Thread Karsten Hilbert
On Thu, Jul 07, 2011 at 11:14:05AM -0400, Tom Lane wrote: > Looking back, I notice that you built with gcc 4.6.0. At least on Red > Hat machines, that gcc has a rather nasty optimization bug that breaks > WAL replay, with symptoms that seem to match what you have here --- > namely, the replay pro

Re: [GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread Jacqui Caren-home
On 07/07/2011 15:21, salah jubeh wrote: > > Hello, > > I do no have any experience with oracle, try to dump the oracle database in plain format and then try to execute the DDL and DML statements. It might be cumbersome to fix all the errors you might get. > But as an initial solution give it a s

Re: [GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread Lennin Caro
--- On Thu, 7/7/11, Craig Ringer wrote: From: Craig Ringer Subject: Re: [GENERAL] Oracle to Postgres migration open source tool To: "akp geek" Cc: "pgsql-general" Date: Thursday, July 7, 2011, 2:02 PM On 7/07/2011 9:55 PM, akp geek wrote: > Hi all - > >                 Are there any open sou

Re: [GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread akp geek
Thank you all for the responses. All we have is just table migrations, no procedures, triggers involved. I will try to do the migration using ora2pg. I downloaded it, while installing it I am getting an error. Will try to resolve that and proceed Writing /export/home/postgres/perl_5_10_0/lib/perl5

Re: [GENERAL] Trying to find miss and mister of the last month with highest rating

2011-07-07 Thread Alexander Farber
Hello, I will do 2 queries - one for female users (to find "the miss of last month) and one for males (the "mister of last month"). Here I can fetch all females rated nicely in June: # select r.id, nice, r.last_rated from pref_rep r, pref_users u where r.nice=true and to_char(current_timestamp -

Re: [GENERAL] Trying to find miss and mister of the last month with highest rating

2011-07-07 Thread Alexander Farber
Do you think this query is good? (or is it allocating loads of strings for the month comparisons?) # select r.id, count(r.id) from pref_rep r, pref_users u where r.nice=true and to_char(current_timestamp - interval '1 month', 'IYYY-MM') = to_char(r.last_rated, 'IYYY-MM') and u.female=true and r.id

Re: [GENERAL] Streaming replication on 9.1-beta2 after pg_restore is very slow

2011-07-07 Thread Tom Lane
Karsten Hilbert writes: > On Thu, Jul 07, 2011 at 11:14:05AM -0400, Tom Lane wrote: >> I'm betting Debian hasn't fixed that bug yet either and so you need this >> post-beta2 patch: >> >> http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=c2ba0121c73b7461331104a46d140156e847572a >

Re: [GENERAL] Trying to find miss and mister of the last month with highest rating

2011-07-07 Thread Alexander Farber
This seems to work, but I wonder if my query for "the miss of the last month" could be improved # select r.id, count(r.id), u.first_name, u.avatar, u.city from pref_rep r, pref_users u where r.nice=true and to_char(current_timestamp - interval '1 month', 'IYYY-MM') = to_char(r.last_rated, 'IYYY-MM

Re: [GENERAL] Oracle to Postgres migration open source tool

2011-07-07 Thread Andrew Sullivan
On Thu, Jul 07, 2011 at 12:01:56PM -0400, akp geek wrote: > Thank you all for the responses. All we have is just table migrations, no > procedures, triggers involved. I will try to do the migration using ora2pg. > I downloaded it, while installing it I am getting an error. Will try to > resolve tha

[GENERAL] Insufficient privileges.

2011-07-07 Thread Dave Coventry
I am getting the following error message in my Drupal install. PDOException: SQLSTATE[42501]: Insufficient privilege: 7 ERROR: permission denied for sequence currenttest_id_seq: INSERT INTO currentTest (score) VALUES (:db_insert_placeholder_0); This is a table that I created using the postgres su

Re: [GENERAL] Insufficient privileges.

2011-07-07 Thread Rick Genter
On Thu, Jul 7, 2011 at 10:03 AM, Dave Coventry wrote: > I am getting the following error message in my Drupal install. > > PDOException: SQLSTATE[42501]: Insufficient privilege: 7 ERROR: > permission denied for sequence currenttest_id_seq: INSERT INTO > currentTest (score) VALUES (:db_insert_plac

Re: [GENERAL] Insufficient privileges.

2011-07-07 Thread Dave Coventry
Hi Rick, Thanks for the response. What is "the sequence"? and how do I grant the privileges needed to insert data into the database? Is it a postgres issue? ~ Dave On 7 July 2011 19:05, Rick Genter wrote: > > > On Thu, Jul 7, 2011 at 10:03 AM, Dave Coventry wrote: >> >> I am getting the foll

Re: [GENERAL] Insufficient privileges.

2011-07-07 Thread Rick Genter
On Thu, Jul 7, 2011 at 10:26 AM, Dave Coventry wrote: > Hi Rick, > > Thanks for the response. > > What is "the sequence"? and how do I grant the privileges needed to > insert data into the database? > > Is it a postgres issue? > Yes. I don't know drupal, so I don't know the correct way to fix th

[GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Rich Shepard
I'm having difficulty finding the correct syntax to modify an existing table. The modification is to add two columns, each a foreign reference to the two key columns of another table. The other table: CREATE TABLE station_type ( sta_type VARCHAR(50), secondary_type VARCHAR(50), natural

[GENERAL] Creating temp tables inside read only transactions

2011-07-07 Thread mike beeper
I have a function that creates a temp table, populate it with results during intermediate processing, and reads from it at the end. When the transaction is marked as read only, it does not allow creation of temp table, even though there are no permanent writes to the db. Are there any work

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Alan Hodgson
On July 7, 2011 10:40:11 AM Rich Shepard wrote: > alter table station_information add column sta_type varchar(50) > unique not null references station_type(sta_type); > NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index > "station_information_sta_type_key" for table "station_information"

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Rich Shepard
On Thu, 7 Jul 2011, Alan Hodgson wrote: You need a unique index on station_type.sta_type Alan, station_type(sta_type) is part of a composite primary key. Doesn't primary key automatically imply unique and not null? Thanks, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgr

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Alan Hodgson
On July 7, 2011 11:55:25 AM Rich Shepard wrote: > On Thu, 7 Jul 2011, Alan Hodgson wrote: > > You need a unique index on station_type.sta_type > > Alan, > >station_type(sta_type) is part of a composite primary key. Doesn't > primary key automatically imply unique and not null? It implies the

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Rich Shepard
On Thu, 7 Jul 2011, Alan Hodgson wrote: It implies the composite is unique. Not sta_type. OK. Now I understand. How, then, do I add a unique constraint to each component of the composite key so I can add them as foreign keys to the station_information table? Or, is there another way to add t

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Alan Hodgson
On July 7, 2011 12:30:35 PM Rich Shepard wrote: > On Thu, 7 Jul 2011, Alan Hodgson wrote: > > It implies the composite is unique. Not sta_type. > >OK. Now I understand. How, then, do I add a unique constraint to each > component of the composite key so I can add them as foreign keys to the > s

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread David Johnston
To do what you want to do look up "CREATE INDEX" in the documentation. You may wish to provide the PK/FK schema for the tables in questions as it appears - at first take - that you are doing something wrong If you have a compound Primary Key with component fields that are also "UNIQUE". You proba

Re: [GENERAL] Insufficient privileges.

2011-07-07 Thread John R Pierce
On 07/07/11 10:03 AM, Dave Coventry wrote: I am getting the following error message in my Drupal install. PDOException: SQLSTATE[42501]: Insufficient privilege: 7 ERROR: permission denied for sequence currenttest_id_seq: INSERT INTO currentTest (score) VALUES (:db_insert_placeholder_0); This is

Re: [GENERAL] [PERFORM] DELETE taking too much memory

2011-07-07 Thread French, Martin
How up to date are the statistics for the tables in question? What value do you have for effective cache size? My guess would be that planner thinks the method it is using is right either for its current row number estimations, or the amount of memory it thinks it has to play with. -Origina

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread John R Pierce
On 07/07/11 10:40 AM, Rich Shepard wrote: I'm having difficulty finding the correct syntax to modify an existing table. The modification is to add two columns, each a foreign reference to the two key columns of another table. The other table: CREATE TABLE station_type ( sta_type VARCHAR

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Rich Shepard
On Thu, 7 Jul 2011, Alan Hodgson wrote: create unique index index_name on table (column). Alan, This worked like a charm. Many thanks for the lesson, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [GENERAL] Insufficient privileges.

2011-07-07 Thread Dave Coventry
Hi John, Thanks. On 7 July 2011 21:48, John R Pierce wrote: > I recommend dropping your drupal database (since I doubt its worked right if > the objects are owned by postgres), and recreate it owned by the drupaluser, > then let the drupaluser populate it during the initial install. :~) Well t

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Rich Shepard
On Thu, 7 Jul 2011, John R Pierce wrote: Since your PK of station_type is a composite, your foreign key must also be composite. CREATE TABLE stuffed ( id serial; otherestuffs text; sta varchar(50), sec varchar(50), FOREIGN KEY (sta, sec) REFERENCES station_type(sta_type, seconda

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread John R Pierce
On 07/07/11 1:02 PM, Rich Shepard wrote: On Thu, 7 Jul 2011, Alan Hodgson wrote: create unique index index_name on table (column). Alan, This worked like a charm. Many thanks for the lesson, Rich if your original table has Primary Key of (sta_type, secondary_type) I would not expect

Re: [GENERAL] Creating temp tables inside read only transactions

2011-07-07 Thread Guillaume Lelarge
On Thu, 2011-07-07 at 16:01 +, mike beeper wrote: > I have a function that creates a temp table, populate it with results > during intermediate processing, and reads from it at the end. When > the transaction is marked as read only, it does not allow creation of > temp table, even though there

Re: [GENERAL] DELETE taking too much memory

2011-07-07 Thread Guillaume Lelarge
On Thu, 2011-07-07 at 15:34 +0200, vincent dephily wrote: > Hi, > > I have a delete query taking 7.2G of ram (and counting) but I do not > understant why so much memory is necessary. The server has 12G, and > I'm afraid it'll go into swap. Using postgres 8.3.14. > > I'm purging some old data from

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread David Johnston
-Original Message- From: Rich Shepard [mailto:rshep...@appl-ecosys.com] Sent: Thursday, July 07, 2011 4:05 PM To: David Johnston Subject: RE: [GENERAL] Add Foreign Keys To Table On Thu, 7 Jul 2011, David Johnston wrote: > To do what you want to do look up "CREATE INDEX" in the document

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Rich Shepard
On Thu, 7 Jul 2011, John R Pierce wrote: if your original table has Primary Key of (sta_type, secondary_type) I would not expect EITHER of those fields to be unique by themselves Surely there can be more than one of the same sta_type with different secondary_type's, just as there could be mo

Re: [GENERAL] Trying to find miss and mister of the last month with highest rating

2011-07-07 Thread David Johnston
-Original Message- And why can't I add u.name, u.avatar to fetch all the info I need in 1 pass? # select r.id, count(r.id), u.name, u.avatar, u.city from pref_rep r, pref_users u where r.nice=true and to_char(current_timestamp - interval '1 month', 'IYYY-MM') = to_char(r.last_rated, 'IYYY

Re: [GENERAL] Add Foreign Keys To Table

2011-07-07 Thread Dr. Tingrong Lu
You have a wrong concept of foreign keys. "sta_type" is not a key of table station_type, which cannot be referened as a foreign key. -- From: "Rich Shepard" Sent: Friday, July 08, 2011 1:40 AM To: Subject: [GENERAL] Add Foreign Keys To Ta

Re: [GENERAL] failed archive command

2011-07-07 Thread Joe Lester
I tried to use only %p to specify the path, but it does not seem to output the full path according to the server log. It only starts at /pg_xlog: archive_command = '/usr/bin/scp -B "%p" postgres@172.20.204.55:/Volumes/DataDrive/wals_from_master/%f' DETAIL: The failed archive co

Re: [GENERAL] Creating temp tables inside read only transactions

2011-07-07 Thread Darren Duncan
Guillaume Lelarge wrote [on pgsql-general]: On Thu, 2011-07-07 at 16:01 +, mike beeper wrote [on pgsql-general]: I have a function that creates a temp table, populate it with results during intermediate processing, and reads from it at the end. When the transaction is marked as read only, i

Re: [HACKERS] [GENERAL] Creating temp tables inside read only transactions

2011-07-07 Thread Jeff Davis
On Thu, 2011-07-07 at 20:56 -0700, Darren Duncan wrote: > > When you create a temporary table, PostgreSQL needs to add rows in > > pg_class, pg_attribute, and probably other system catalogs. So there are > > writes, which aren't possible in a read-only transaction. Hence the > > error. And no, ther

Re: [HACKERS] [GENERAL] Creating temp tables inside read only transactions

2011-07-07 Thread Darren Duncan
Jeff Davis wrote: On Thu, 2011-07-07 at 20:56 -0700, Darren Duncan wrote: When you create a temporary table, PostgreSQL needs to add rows in pg_class, pg_attribute, and probably other system catalogs. So there are writes, which aren't possible in a read-only transaction. Hence the error. And no,