Re: [GENERAL] Rules and conditions

2009-12-09 Thread Guillaume Lelarge
Le mercredi 9 décembre 2009 à 01:52:03, George Silva a écrit : [...] I can't seem to understand why a simples if is not working on the creation of rules. I tried both ways (am i missing something?): Sure. IF does not exist in SQL, and you can only put SQL statements in a rule. Instead,

Re: [GENERAL] how to ensure a client waits for a previous transaction to finish?

2009-12-09 Thread Dan Kortschak
Thanks Tom, That was my initial view and I'm still not convinced that I'm wrong - I can see no way that the server can tell that the query came from a process without a terminal (though I may be missing something here). Unfortunately I'm working at the boundary of my knowledge for both torque and

Re: [GENERAL] how to ensure a client waits for a previous transaction to finish?

2009-12-09 Thread Dan Kortschak
Thanks for that clarification Merlin, The server/client is on a workstation that is essentially private (I share some time with students, but they don't have pg access). The locks are across sessions. There are three perl scripts that connect to a pg db, one loads the database and creates some

Re: [GENERAL] Rules and conditions

2009-12-09 Thread Leif Biberg Kristensen
On Wednesday 9. December 2009 09.06.12 Guillaume Lelarge wrote: Le mercredi 9 décembre 2009 à 01:52:03, George Silva a écrit : [...] I can't seem to understand why a simples if is not working on the creation of rules. I tried both ways (am i missing something?): Sure. IF does not

Re: [GENERAL] Rules and conditions

2009-12-09 Thread George Silva
Hello guys, Still having some trouble with this. I'm trying to use a case when, but postgres is still giving me syntax error. CREATE OR REPLACE RULE instead_update AS ON UPDATE TO foo DO INSTEAD ( CASE SELECT exists(SELECT 1 FROM versioning.foo_version_1 WHERE OLD.oid = NEW.oid) as a WHEN

[GENERAL] ERROR: could not open relation with OID 59132

2009-12-09 Thread Postgre Novice
Hello , after google search i havent found any solution or clue for this specific case: Background: Postgresql: 8.3.0 select version(); version PostgreSQL

Re: [GENERAL] Rules and conditions

2009-12-09 Thread Guillaume Lelarge
Le mercredi 9 décembre 2009 à 12:38:33, George Silva a écrit : Hello guys, Still having some trouble with this. I'm trying to use a case when, but postgres is still giving me syntax error. CREATE OR REPLACE RULE instead_update AS ON UPDATE TO foo DO INSTEAD ( CASE SELECT

Re: [GENERAL] Implementing next 30 (or so) rows sliding window

2009-12-09 Thread Jaime Casanova
On Tue, Dec 8, 2009 at 3:51 PM, Scott Marlowe scott.marl...@gmail.com wrote: On Tue, Dec 8, 2009 at 12:12 PM, Allan Kamau kamaual...@gmail.com wrote: Hi, I did follow the basic advise and consulted the documentation for SELECT and came across [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS }

[GENERAL] [General] beginner!!!

2009-12-09 Thread Joana Camacho
Hi, I'm trying to set up a database with freeRADIUS server and I'm getting some doubts. I installed freeradius-postgresql package and nothing else. I've configured all the files like it explains in the SQL How To on FreeRADIUS wiki. So far so good, but at this part: *Setting up the RADIUS

Re: [GENERAL] [General] beginner!!!

2009-12-09 Thread Jean-Yves F. Barbier
Joana Camacho a écrit : ... su - postgres createuser radius --no-superuser --no-createdb --no-createrole -P ^^ createdb radius --owner=radius ^^ There's a slight contradiction... -- *** *** *

Re: [GENERAL] [General] beginner!!!

2009-12-09 Thread John R Pierce
Jean-Yves F. Barbier wrote: Joana Camacho a écrit : ... su - postgres createuser radius --no-superuser --no-createdb --no-createrole -P ^^ createdb radius --owner=radius ^^ There's a slight

Re: [GENERAL] [General] beginner!!!

2009-12-09 Thread Jean-Yves F. Barbier
John R Pierce a écrit : Jean-Yves F. Barbier wrote: Joana Camacho a écrit : ... su - postgres createuser radius --no-superuser --no-createdb --no-createrole -P ^^ createdb radius --owner=radius

[GENERAL] Unix ODBC on SPARC 64 bits

2009-12-09 Thread Guillaume Lelarge
Hi all, I'm searching for a Unix implementation of ODBC working on SPARC 64 bits? iodbc doesn't seem to work well. DataDirect is really good but not free. And UnixODBC doesn't seem to compile. Any ideas? -- Guillaume. http://www.postgresqlfr.org http://dalibo.com -- Sent via

[GENERAL] Rules, triggers and such

2009-12-09 Thread George Silva
Hello all again :) I have a question: is it possible to replicate the behavior of a rule INSTEAD of with a TRIGGER? For some specific reasons i need to use a trigger to update a secondary table, but i don't want the changes to happen in the primary table too. Is it possible to do it? If so,

Re: [GENERAL] Rules, triggers and such

2009-12-09 Thread Guillaume Lelarge
Le mercredi 9 décembre 2009 à 17:04:32, George Silva a écrit : Hello all again :) I have a question: is it possible to replicate the behavior of a rule INSTEAD of with a TRIGGER? For some specific reasons i need to use a trigger to update a secondary table, but i don't want the changes to

[GENERAL] Problem with SET CONSTRAINTS some_constraint_fkey DEFERRED

2009-12-09 Thread Sergey Levchenko
Why I get: update or delete on table people violates foreign key constraint transactions_person_id_fkey on table transactions But before that query I run: SET CONSTRAINTS transactions_person_id_fkey DEFERRED; before delete from people table Log: 2009-12-09 20:01:51 EET LOG: statement: BEGIN;

Re: [GENERAL] Problem with SET CONSTRAINTS some_constraint_fkey DEFERRED

2009-12-09 Thread Tom Lane
Sergey Levchenko sector...@gmail.com writes: Why I get: update or delete on table people violates foreign key constraint transactions_person_id_fkey on table transactions But before that query I run: SET CONSTRAINTS transactions_person_id_fkey DEFERRED; before delete from people table It

[GENERAL] pg_dump and ON DELETE CASCADE problem

2009-12-09 Thread CG
Hi all,   We're using PostgreSQL 8.4 ... We do our nightly database backups with pg_dump. I was doing a test restore and I encountered some data during the reload that was in a table against the conditions of a foreign key constraint. I run my restores with the -e option to halt on errors, so

[GENERAL] C functions, dll, server fall down

2009-12-09 Thread AlexeyChe
Hi there Need help, I just took the example from Postgres help, code: #include postgres.h #include fmgr.h #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif PG_FUNCTION_INFO_V1(add_one); __declspec (dllexport) Datum add_one(PG_FUNCTION_ARGS) { int32 arg = PG_GETARG_INT32(0);

[GENERAL] pgAdmin in 8.4 installation uses tools from 8.3 installation

2009-12-09 Thread Radcon Entec
Greetings! We just upgraded a customer's PostgreSQL installation from 8.3 to 8.4.1. I wanted to make a small change to the database. I wanted to take a backup before I did it, just in case. When I run pgAdmin from the PostgreSQL/8.4/bin folder and try to take a backup, the backup fails.

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Stephen Tyler
On Wed, Dec 9, 2009 at 12:57 PM, Greg Smith g...@2ndquadrant.com wrote: You should turn on log_checkpoint in the postgresql.conf and confirm the slowdowns are happening around the same time as the checkpoint report gets written to the log files. Thank you for your suggestions. I will turn

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Stephen Tyler
Some more information on fsync using the test_fsync tool in postgres/src/tools: System is Snow Leopard 10.6.2 (64 bit). Volumes are HFS+ formatted. PASS 1 - DATABASE VOLUME (SSD RAID 0) === $ sudo ./test_fsync -f /Volumes/SSD/fsync_test.out Simple write timing:

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Scott Marlowe
On Wed, Dec 9, 2009 at 5:11 AM, Stephen Tyler step...@stephen-tyler.com wrote: The times are apparently in milliseconds.  But that doesn't make any sense for the 7200rpm SATA HDD, given it has an 8.3ms rotation time.  And the numbers for the SSD are basically identical to the HDD, apart from

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Ron Mayer
Scott Marlowe wrote: Actually, it's usually the drives that lie about fsync, especially consumer grade (and some server grade) SATA / PATA drives are known for this. I'm still looking for any evidence of any drive that lies. Is there actually a drive which claims to support the IDE

Re: [GENERAL] [General] beginner!!!

2009-12-09 Thread Scott Bailey
My silly question is, do I needo to install a postgreSQL server or the freeradius-postgresql package already takes care of it?! My question it's because it doesn't recognize any user ids and the createuser command. Yeah, that's pretty much the way things work on unix-like systems. Instead

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Greg Smith
Stephen Tyler wrote: The times are apparently in milliseconds. But that doesn't make any sense for the 7200rpm SATA HDD, given it has an 8.3ms rotation time. And the numbers for the SSD are basically identical to the HDD, apart from the bare write timing. Do I conclude that the sync timings

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Greg Smith
Ron Mayer wrote: Scott Marlowe wrote: Actually, it's usually the drives that lie about fsync, especially consumer grade (and some server grade) SATA / PATA drives are known for this. I'm still looking for any evidence of any drive that lies. Is there actually a drive which claims to

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Scott Marlowe
On Wed, Dec 9, 2009 at 2:35 PM, Ron Mayer rm...@cheapcomplexdevices.com wrote: Scott Marlowe wrote: Actually, it's usually the drives that lie about fsync, especially consumer grade (and some server grade) SATA / PATA drives are known for this. I'm still looking for any evidence of any drive

Re: [GENERAL] pgAdmin in 8.4 installation uses tools from 8.3 installation

2009-12-09 Thread Andy Shellam (Mailing Lists)
We just upgraded a customer's PostgreSQL installation from 8.3 to 8.4.1. I wanted to make a small change to the database. I wanted to take a backup before I did it, just in case. When I run pgAdmin from the PostgreSQL/8.4/bin folder and try to take a backup, the backup fails. The

Re: [GENERAL] C functions, dll, server fall down

2009-12-09 Thread Merlin Moncure
On Wed, Dec 9, 2009 at 8:33 AM, AlexeyChe alexey.chernus...@gmail.com wrote: Hi there Need help, I just took the example from Postgres help, code: #include postgres.h #include fmgr.h #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif PG_FUNCTION_INFO_V1(add_one); __declspec (dllexport)

[GENERAL] Install compat-postgresql-libs-debuginfo on postgres 8.3.8 without using RPM

2009-12-09 Thread DM
All How to Install compat-postgresql-libs-debuginfo on postgres 8.3.8 by compiling the source code. The way i have installed postgres is by compiling the postgres files. Thanks Deepak

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Stephen Tyler
On Thu, Dec 10, 2009 at 8:38 AM, Greg Smith g...@2ndquadrant.com wrote: PostgreSQL on OS X uses a special fsync method by default named 'fsync_writethrough'. If you do this on your database you should be able to confirm it's using it: show wal_sync_method; This method includes a call to

Re: [GENERAL] pg_dump and ON DELETE CASCADE problem

2009-12-09 Thread Craig Ringer
On 10/12/2009 3:31 AM, CG wrote: Hi all, We're using PostgreSQL 8.4 ... We do our nightly database backups with pg_dump. I was doing a test restore and I encountered some data during the reload that was in a table against the conditions of a foreign key constraint. I run my restores with the -e

Re: [GENERAL] Excessive (and slow) fsync() within single transaction

2009-12-09 Thread Vick Khera
On Wed, Dec 9, 2009 at 6:24 AM, Stephen Tyler step...@stephen-tyler.com wrote: Thank you for your suggestions.  I will turn on log_checkpoint next time I get the chance to restart. You should be able to set this via a sighup to the server. No restart required. -- Sent via pgsql-general

Re: [GENERAL] Unix ODBC on SPARC 64 bits

2009-12-09 Thread Tom Lane
Guillaume Lelarge guilla...@lelarge.info writes: I'm searching for a Unix implementation of ODBC working on SPARC 64 bits? iodbc doesn't seem to work well. DataDirect is really good but not free. And UnixODBC doesn't seem to compile. What unixODBC version? If 2.2.14 doesn't work on Sparc

Re: [GENERAL] Install compat-postgresql-libs-debuginfo on postgres 8.3.8 without using RPM

2009-12-09 Thread Devrim GÜNDÜZ
On Wed, 2009-12-09 at 15:38 -0800, DM wrote: How to Install compat-postgresql-libs-debuginfo on postgres 8.3.8 by compiling the source code. The way i have installed postgres is by compiling the postgres files. You can still install it via RPM -- it doesn't matter whether you compiled

[GENERAL] Defining permissions for tables, schema etc..

2009-12-09 Thread dipti shah
Hi, We have started using PostGreSQL for more than 3 months and it looks awesome. Currently, we have been suing superuser by default as login account. Now, the users are getting increased and we want to go away with using superuser by default. We want to create the separate user account for every

Fw: [GENERAL] ERROR: could not open relation with OID 59132

2009-12-09 Thread Postgre Novice
Can someone please share some light on this - Forwarded Message From: Postgre Novice postgrenov...@yahoo.com To: pgsql-general@postgresql.org Sent: Wed, December 9, 2009 5:23:18 PM Subject: [GENERAL] ERROR: could not open relation with OID 59132 Hello , after google search i