Re: [GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread Volkan YAZICI
On Jul 31 10:40, Parthan SR wrote: > On 7/31/06, Richard Huxton wrote: > Traceback (most recent call last): File > "/usr/lib/cgi-bin/ConfSachem/page2.py", line 75, in ? main(num_days) File > "/usr/lib/cgi-bin/ConfSachem/page2.py", line 68, in main query = > cursor.execute('INSERT INTO ConfMain (Co

Re: [GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread Parthan SR
Hii,With regards to the previous mail and replaies, I tried with this code. Although it doesn't give any error when i run it as a script,  but the return value is NONE for 'q', which is assigned to return value of cursor.execute(), and the data are not inserted into the database. [code] name =

Re: [GENERAL] pg_xlog not cleaned up

2006-07-31 Thread Christian Kastner
Simon Riggs wrote: > On Mon, 2006-07-31 at 22:18 +0200, Christian Kastner wrote: >> Bruce Momjian wrote: >>> What PostgreSQL version are you using? I know the *.backup file removal >>> was added in 8.1: >>> >>> * Remove old "*.backup" files when we do pg_stop_backup() (Bruce) >>>T

Re: [GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread John D. Burger
never, never, never try quoting on your own! You can only fail. The only choice is to fail now or later. Nonetheless, in case it's useful, here's a barebones wrapper I call on everything: def sqlValue (value): if value is None: return "NULL" elif type(value) == types.StringType:

Re: [GENERAL] pg_xlog not cleaned up

2006-07-31 Thread Simon Riggs
On Mon, 2006-07-31 at 22:18 +0200, Christian Kastner wrote: > Bruce Momjian wrote: > > What PostgreSQL version are you using? I know the *.backup file removal > > was added in 8.1: > > > > * Remove old "*.backup" files when we do pg_stop_backup() (Bruce) > >This prevents a large

Re: [GENERAL] pg_xlog not cleaned up

2006-07-31 Thread Wayne Conrad
On Mon, Jul 31, 2006 at 10:18:31PM +0200, Christian Kastner wrote: > After the online backup script runs, all subsequent attempts to run > archive_command fail because the first thing it tries to archive away is > the still-existing *.backup file. This fails because a copy already > exists in the

Re: [GENERAL] Corrupted DB? could not open file pg_clog/####

2006-07-31 Thread Francisco Reyes
Martijn van Oosterhout writes: That's when you've reached the end of the table. The point is that before then you'll have found the value of N that produces the error. Will be a while.. my little python script is doing under 10 selects/sec... and there are nearly 67 million records. :-( Ho

Re: [GENERAL] pg_xlog not cleaned up

2006-07-31 Thread Wayne Conrad
On Mon, Jul 31, 2006 at 10:18:31PM +0200, Christian Kastner wrote: > After the online backup script runs, all subsequent attempts to run > archive_command fail because the first thing it tries to archive away is > the still-existing *.backup file. This fails because a copy already > exists in the

[GENERAL] Intel commercial compiler

2006-07-31 Thread Philippe Lang
Hi, http://www.enterprisedb.com mentions they compile postgresql with the Intel commercial compiler, for optimal performances: http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284132.htm Has anyone done comparison tests with a normal gcc compilation? --- Philippe Lan

Re: [GENERAL] pg_xlog not cleaned up

2006-07-31 Thread Bruce Momjian
Christian Kastner wrote: > Bruce Momjian wrote: > > What PostgreSQL version are you using? I know the *.backup file removal > > was added in 8.1: > > > > * Remove old "*.backup" files when we do pg_stop_backup() (Bruce) > >This prevents a large number of "*.backup" files from exi

[GENERAL] Dynamic pgplsql triggers

2006-07-31 Thread Worky Workerson
I'm trying to trigger a whole bunch of partitions at once (initial DB setup) using the same plpgsql trigger. The trigger is basically the merge trigger in the docs (i.e. UPDATE IF NOT FOUND RETURN NEW ...). I need to use the TG_RELNAME variable within the "UPDATE" in the trigger so that I can us

Re: [GENERAL] Corrupted DB? could not open file pg_clog/####

2006-07-31 Thread Martijn van Oosterhout
On Sun, Jul 30, 2006 at 04:58:34PM -0400, Francisco Reyes wrote: > Martijn van Oosterhout writes: > > >It's still a reasonable suggestion. The maximum offset is the number of > >rows in the table. You'll notice when the output is empty. > > Once I find the point where the output is empty then wha

Re: [GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread Harald Armin Massa
Parthan,never, never, never try quoting on your own! You can only fail. The only choice is to fail now or later.The only recommended way with Python and DBAPI2.0 is:lala="huibuh"cs.execute ("select bla from foo where schupp=%s", (lala,))or bettercs.execute ("select bla from foo where schupp=%(lala

Re: [GENERAL] pg_xlog not cleaned up

2006-07-31 Thread Christian Kastner
Bruce Momjian wrote: > What PostgreSQL version are you using? I know the *.backup file removal > was added in 8.1: > >* Remove old "*.backup" files when we do pg_stop_backup() (Bruce) >This prevents a large number of "*.backup" files from existing in > "/pg_xlog". > > b

Re: [GENERAL] pg_xlog not cleaned up

2006-07-31 Thread Bruce Momjian
What PostgreSQL version are you using? I know the *.backup file removal was added in 8.1: * Remove old "*.backup" files when we do pg_stop_backup() (Bruce) This prevents a large number of "*.backup" files from existing in "/pg_xlog". but the existance of the files sh

Re: [GENERAL] VACUUM FULL versus CLUSTER ON

2006-07-31 Thread Francisco Reyes
Sven Willenberger writes: I do plan on migrating the whole mess to a new server which will run 8.1 (I had looked at inheritance for partitioning, I am glad to see that 8.1 took the concept and ran with it further Coming late to the thread.. If you do consider inheritance be aware that some rep

Re: [GENERAL] Postgres on 64bit Windows Server with WOW64

2006-07-31 Thread Merlin Moncure
On 7/31/06, Stefan Kaltenbrunner <[EMAIL PROTECTED]> wrote: Joshua D. Drake wrote: > Mont Rothstein wrote: >> I wouldn't know that one way or the other :-) >> >> I was referring to Windows on Windows >> 64 >> . >> >> Enables 32bit apps to run on 64bit Windows O

Re: [GENERAL] Postgres on 64bit Windows Server with WOW64

2006-07-31 Thread Stefan Kaltenbrunner
Joshua D. Drake wrote: > Mont Rothstein wrote: >> I wouldn't know that one way or the other :-) >> >> I was referring to Windows on Windows >> 64 >> . >> >> Enables 32bit apps to run on 64bit Windows OSs, in case anyone wasn't >> familiar with it (I wasn't until

Re: [GENERAL] Postgres on 64bit Windows Server with WOW64

2006-07-31 Thread Mont Rothstein
Previous threads indicate that it isn't currently possible:http://archives.postgresql.org/pgsql-general/2006-04/msg00628.php http://archives.postgresql.org/pgsql-general/2006-04/msg01264.php-MontOn 7/31/06, Joshua D. Drake < [EMAIL PROTECTED]> wrote:Mont Rothstein wrote:> I wouldn't know that one w

Re: [GENERAL] Postgres on 64bit Windows Server with WOW64

2006-07-31 Thread Joshua D. Drake
Mont Rothstein wrote: I wouldn't know that one way or the other :-) I was referring to Windows on Windows 64 . Enables 32bit apps to run on 64bit Windows OSs, in case anyone wasn't familiar with it (I wasn't until today). In theory you should be able to c

Re: [GENERAL] Postgres on 64bit Windows Server with WOW64

2006-07-31 Thread Shoaib Mir
Yes, the 32bit release should work on a 64bit Windows. Please let me know in case you find any compatibility problems which I dont think so will be any.- Shoaib MirEnterpriseDB ( www.enterprisedb.com)On 7/31/06, Mont Rothstein <[EMAIL PROTECTED]> wrote: I wouldn't know that one way or the other :-)

Re: [GENERAL] Postgres on 64bit Windows Server with WOW64

2006-07-31 Thread Mont Rothstein
I wouldn't know that one way or the other :-)I was referring to Windows on Windows 64.Enables 32bit apps to run on 64bit Windows OSs, in case anyone wasn't familiar with it (I wasn't until today). -MontOn 7/31/06, Joshua D. Drake <[EMAIL PROTECTED]> wrote: Mont Rothstein wrote:> Does anyone have ex

Re: [GENERAL] Postgres on 64bit Windows Server with WOW64

2006-07-31 Thread Joshua D. Drake
Mont Rothstein wrote: Does anyone have experience with running Postgres on Windows Server 2003 64bit using WOW64? There is a 64bit version of World of Warcraft? In theory it *should* work, but it is always nice to hear from someone that has already taken the plunge :-) Thanks, -Mont --

Re: [GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread Douglas Horst
Parthan wrote: Hello, Am not sure whether i can post such a question over here, still the error is in my postgresql query syntax, hence i post it in this mailing list. sorry if am wrong. I am getting a 'type error' with the following query. [Code] Line68: query = cursor.execute("""INSERT I

Re: [GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread Joshua D. Drake
Line68: query = cursor.execute("""INSERT INTO ConfMain (ConfName, ConfHost, ConfStart, ConfEnd, ConfDays, ConfStartTime, ConfEndTime, ConfSize) VALUES (\'%s\', \'%s\', \'%%\', \'%%\', %i, \'%%\', \'%%\', %i);""" % (conf_name, host_name, start_day, end_day, int(num_days), start_time, end_time, au

[GENERAL] Postgres on 64bit Windows Server with WOW64

2006-07-31 Thread Mont Rothstein
Does anyone have experience with running Postgres on Windows Server 2003 64bit using WOW64?In theory it *should* work, but it is always nice to hear from someone that has already taken the plunge :-)Thanks, -Mont

Re: [GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread Parthan SR
On 7/31/06, Richard Huxton wrote: > Line68:> query = cursor.execute("""INSERT INTO ConfMain (ConfName, ConfHost,> ConfStart, ConfEnd, ConfDays, ConfStartTime, ConfEndTime, ConfSize)> VALUES (\'%s\', \'%s\', \'%%\', \'%%\', %i, \'%%\', \'%%\', %i);""" % > (conf_name, host_name, st

Re: [GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread Richard Huxton
Parthan wrote: Hello, Am not sure whether i can post such a question over here, still the error is in my postgresql query syntax, hence i post it in this mailing list. sorry if am wrong. I am getting a 'type error' with the following query. [Code] Line68: query = cursor.execute("""INSERT I

Re: Antw: Re: [GENERAL] Query questions

2006-07-31 Thread Richard Huxton
A. Kretschmer wrote: am 31.07.2006, um 15:55:39 +0100 mailte Richard Huxton folgendes: Christian Rengstl wrote: My version is 8.1.4. Here is the plan for the query, it's performed on a Total runtime: 1903.894 ms And yes i have indexes on both pid (varchar(15)

Re: [GENERAL] Triggers in Postgres

2006-07-31 Thread Richard Huxton
Jasbinder Bali wrote: Actually Postgres manual of triggers says that in postgres, you can't write a trigger in conventional sql. You have to write it in a procedural language like C. So wanted some more insight on it. See chapters 35 - 39 of the manual for details. In particular a discussion

[GENERAL] pg_xlog not cleaned up

2006-07-31 Thread Christian Kastner
Hello, I don't know why, but the .backup file created by pg_stop_backup() in my pg_xlog never gets deleted, even though it was successfully archived (a good copy is stored in the archive area, no errors are raised). The directory pg_xlog/archive_status contains a matching .backup.d

[GENERAL] Error in PostgreSQL query with psycopg

2006-07-31 Thread Parthan
Hello, Am not sure whether i can post such a question over here, still the error is in my postgresql query syntax, hence i post it in this mailing list. sorry if am wrong. I am getting a 'type error' with the following query. [Code] Line68: query = cursor.execute("""INSERT INTO ConfMain (Co

Re: [GENERAL] Triggers in Postgres

2006-07-31 Thread Jasbinder Bali
Actually Postgres manual of triggers says that in postgres, you can't write a trigger in conventional sql. You have to write it in a procedural language like C. So wanted some more insight on it. ~Jas  On 7/31/06, Tino Wildenhain <[EMAIL PROTECTED]> wrote: Jasbinder Bali wrote:> Hi,> Was wondering

Antw: Re: Antw: Re: [GENERAL] Query questions

2006-07-31 Thread Christian Rengstl
I meant that i have an index on pid and one on crit. >>> "A. Kretschmer" <[EMAIL PROTECTED]> 31.07.06 17.16 Uhr >>> am 31.07.2006, um 15:55:39 +0100 mailte Richard Huxton folgendes: > Christian Rengstl wrote: > >My version is 8.1.4. Here is the plan for the query, it's performed on a > >

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread DANTE Alexandra
Hello Tom, Martijn and List, Thank you for yours answers ! This point is now closed for me and I can go further in the mecanisms of VACUUM. Regards, Alexandra Tom Lane wrote: DANTE Alexandra <[EMAIL PROTECTED]> writes: - during a SELECT query on a tuple just updated and commited, doe

Re: Antw: Re: [GENERAL] Query questions

2006-07-31 Thread A. Kretschmer
am 31.07.2006, um 15:55:39 +0100 mailte Richard Huxton folgendes: > Christian Rengstl wrote: > >My version is 8.1.4. Here is the plan for the query, it's performed on a > >Total runtime: 1903.894 ms > >And yes i have indexes on both pid (varchar(15)) and crit(va

Re: Antw: Re: [GENERAL] Query questions

2006-07-31 Thread Richard Huxton
Christian Rengstl wrote: My version is 8.1.4. Here is the plan for the query, it's performed on a smaller table, though because i can't access the biggest table at the moment: QUERY PLAN

Re: Practical maximums (was Re: [GENERAL] PostgreSQL theoretical

2006-07-31 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter Eisentraut wrote: > Ron Johnson wrote: >> I think I've read that there are multi-hundred GB PostgreSQL >> databases. >> >> Since pg_dump is single-threaded, how long does it take to back up >> such a database? > > The evasive answer is that you

Antw: Re: [GENERAL] Query questions

2006-07-31 Thread Christian Rengstl
My version is 8.1.4. Here is the plan for the query, it's performed on a smaller table, though because i can't access the biggest table at the moment: QUERY PLAN -

Re: [GENERAL] Query questions

2006-07-31 Thread A. Kretschmer
am 31.07.2006, um 15:32:19 +0200 mailte Christian Rengstl folgendes: > Hi list, > > i have a problem with creating a query and i hope somebody can give me > some hints. I have the following table > pid(varchar), crit(varchar), val1(varchar), val2(varchar), > iDate(timestamp) > where there are up

[GENERAL] Query questions

2006-07-31 Thread Christian Rengstl
Hi list, i have a problem with creating a query and i hope somebody can give me some hints. I have the following table pid(varchar), crit(varchar), val1(varchar), val2(varchar), iDate(timestamp) where there are up to 63 million lines with 1500 distinct pids and around 42000 distinct crits: pid c

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Tom Lane
DANTE Alexandra <[EMAIL PROTECTED]> writes: > - during a SELECT query on a tuple just updated and commited, does > the executor first detect the old tuple and then via the c_tid link go > to the new version of the tuple ? or go directly to the new version ? Neither. SELECT doesn't care abou

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > I don't get it. EPQ would need to reevaluate the plan of the _select_ > belonging to the _cursor_, not the plan of the _update_, to prevent > the effect outlined above. Are you suggesting to use EPQ for that? Yes, I don't think you have much choice

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Florian G. Pflug
Tom Lane wrote: "Florian G. Pflug" <[EMAIL PROTECTED]> writes: I can see how the EPQ machinery can be used to chain forward to the correct row to be updated, even if I originally found an older version (e.g. by searching for a specific ctid). But for non-"for update"-cursors, the newest version

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread DANTE Alexandra
Hello Martijn, hello List, Last question on this subject, what's happened during a SELECT query on a tuple just updated and commited ? I followed in the source code the links between these methods : CreateQueryDesc, ExecutorStart, ExecutorRun, ExecutePlan, ExecSelect but I still have a questio

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Tom Lane
Martijn van Oosterhout writes: > On Mon, Jul 31, 2006 at 11:04:58AM +0200, DANTE Alexandra wrote: >> I've just seen that I've done a mistake in my example. My question was : >> is it correct to think that the ctid of the old version of the tuple is >> a link to newer version ? > Well, in your cas

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Tom Lane
Martijn van Oosterhout writes: > Looks like a good plan, but I think you've overlooked something: if > you've locked the tuple FOR UPDATE then by definition there cannot be a > newer version, right? Nope --- think self-update. regards, tom lane --

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > I can see how the EPQ machinery can be used to chain forward to the > correct row to be updated, even if I originally found an older version > (e.g. by searching for a specific ctid). But for non-"for > update"-cursors, the newest version of the ro

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Florian G. Pflug
Martijn van Oosterhout wrote: On Mon, Jul 31, 2006 at 01:47:41AM +0200, Florian G. Pflug wrote: I agree, at least for "for-update"-cursors. If the cursor was not declared "for update", then it is not even cleaer to me what the correct behaviour would be. Imagine that you declared a cursor, and f

Re: [GENERAL] access method "gin" does not exist

2006-07-31 Thread Teodor Sigaev
Run initdb after patching Kevin Murphy wrote: I'm trying to test the 8.1 backport of the 8.2 GIN index and tsearch2 functionality. The patch is applied successfully (to 8.1.4, on OS X 10.4.7 w/ xcode 2.3), the build and install goes well, stop & start of postmaster is done, but initializing

Re: [GENERAL] number of distinct values in tsearch2 gist index

2006-07-31 Thread Teodor Sigaev
vacuum; Kevin Murphy wrote: In the output of gist_stat() in the gevel contrib module, is the number of tuples the number of distinct values stored in the index? Is the number (6M) so large because the positions are part of the values? I'm guessing I can't determine the number of distinct lex

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Martijn van Oosterhout
On Mon, Jul 31, 2006 at 11:04:58AM +0200, DANTE Alexandra wrote: > I've just seen that I've done a mistake in my example. My question was : > is it correct to think that the ctid of the old version of the tuple is > a link to newer version ? In my example, is it correct to think that the > tuple

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread DANTE Alexandra
Hello Martijn, hello List, Thank you very much. I still have some questions, further to your answers : Martijn van Oosterhout wrote: On Fri, Jul 28, 2006 at 12:00:19PM +0200, DANTE Alexandra wrote: Hello List, I try to understand perfectly the mecanisms used to update / delete a tuple (a

Re: [GENERAL] automatic and randomally population

2006-07-31 Thread Richard Huxton
gustavo halperin wrote: There are a bunch of sample databases of various sizes below. Sounds like it's useful for you. http://pgfoundry.org/projects/dbsamples/ Are you sure that is the right place, I found there just port languages to PostgreSQL and one little MySQL example ? The "dellst

Re: [GENERAL] Triggers in Postgres

2006-07-31 Thread Tino Wildenhain
Jasbinder Bali wrote: > Hi, > Was wondering if one can write triggers with SQL statements as we have > in other RDBMS like SQL Server and oracle. What would such a trigger "in SQL statements" look like? SQL Server has Triggers in Transact-SQL, which is just something like a pl/language. > Can the

Re: [GENERAL] Questions about update, delete, ctid...

2006-07-31 Thread Martijn van Oosterhout
On Mon, Jul 31, 2006 at 01:47:41AM +0200, Florian G. Pflug wrote: > I agree, at least for "for-update"-cursors. If the cursor was not > declared "for update", then it is not even cleaer to me what the > correct behaviour would be. Imagine that you declared a cursor, and fetched > a row. After fetch

Re: [GENERAL] PostgreSQL and Windows 2003 DFS Replication

2006-07-31 Thread Csaba Nagy
On Fri, 2006-07-28 at 22:30, Merlin Moncure wrote: > On 7/28/06, Arnaud Lesauvage <[EMAIL PROTECTED]> wrote: > > Csaba Nagy wrote: > > > I found that PITR using WAL shipping is not protecting against all > > > failure scenarios... it sure will help if the primary machine's hardware > > > fails, but

[GENERAL] Triggers in Postgres

2006-07-31 Thread Jasbinder Bali
Hi,Was wondering if one can write triggers with SQL statements as we have in other RDBMS like SQL Server and oracle. Can these be written in procedural languages only?Please put some insight on what needs to be known before working with triggers in postgres. I've already read the postgres manual in

Re: [GENERAL] use of index

2006-07-31 Thread Chris
To explain. With any 'programming exercise' I do, I 'start small' and try to see program behavior on small scale (both datasets and number of involved modules) before I roll out any larger setup for testing. In this case, tha DB will be used with 'TABLE ludzie' popolated with close to a milion