Re: [GENERAL] Question regarding Postgres + OpenSSL + FIPs

2009-01-16 Thread Magnus Hagander
Dhaval Shah wrote: I am setting up Postgres for OpenSSL + FIPs. I am compiling Postgres with OpenSSL FIPS library using the -with-openssl option. The question I have is, just doing that suffice? Or do I have to modify the postgres source code? Since I read through the OpenSSL FIPS

[GENERAL] Diff tool for two schema

2009-01-16 Thread Glyn Astill
Anyone know of a decent diff tool for comparing two schemas? I Had a go with http://apgdiff.sourceforge.net/ but it appears it doesn't quote it's sql properly. A shame, otherwise it'd be just what I need. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] Diff tool for two schema

2009-01-16 Thread Grzegorz Jaśkiewicz
dbwrench has this option, afair - called 'reverse synchronize'. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Diff tool for two schema

2009-01-16 Thread Bruno Lavoie
you can also look at: http://www.sqlmanager.net/en/products/postgresql/dbcomparer Not free but it's a nice product, with nice support give it a try. You can also check at other products from EMS, very nice! Especially the SQL Manager:

[GENERAL] Questions regarding indexes

2009-01-16 Thread Bruno Lavoie
Hello, are these statements true: * «You should always index fks. The only exception is when the matching unique or primary key is never updated or deleted» ? * «Small tables do not require indexes» ? * «Create an index if you frequently want to retrieve less than about ~15%

Re: [GENERAL] Question regarding new windowing functions in 8.4devel

2009-01-16 Thread David Fetter
On Thu, Jan 15, 2009 at 03:06:47PM +0100, A. Kretschmer wrote: Hi, first, many thanks to all for the great work, i'm waiting for 8.4. I have played with the new possibilities: test=# select typ, ts, rank() over (partition by typ order by ts desc ) from foo; typ | ts

Re: [HACKERS] Re: [GENERAL] Question regarding new windowing functions in 8.4devel

2009-01-16 Thread Jaime Casanova
On Fri, Jan 16, 2009 at 12:07 PM, David Fetter da...@fetter.org wrote: Now i want only 3 records for every typ: test=# select typ, ts, rank() over (partition by typ order by ts desc ) from foo where rank = 3; ERROR: column rank does not exist LINE 1: ...rtition by typ order by ts desc )

Re: [HACKERS] Re: [GENERAL] Question regarding new windowing functions in 8.4devel

2009-01-16 Thread David Fetter
On Fri, Jan 16, 2009 at 12:23:16PM -0500, Jaime Casanova wrote: On Fri, Jan 16, 2009 at 12:07 PM, David Fetter da...@fetter.org wrote: Now i want only 3 records for every typ: test=# select typ, ts, rank() over (partition by typ order by ts desc ) from foo where rank = 3; ERROR:

Re: [GENERAL] Question regarding new windowing functions in 8.4devel

2009-01-16 Thread Tom Lane
David Fetter da...@fetter.org writes: I tried this: SELECT typ, ts, rank() over w AS foo_rank FROM foo WINDOW w AS (partition by typ order by ts desc) WHERE foo_rank 4; ERROR: syntax error at or near WHERE LINE 8: WHERE ^ RTFM ... WINDOW goes

Re: [HACKERS] [GENERAL] Question regarding new windowing functions in 8.4devel

2009-01-16 Thread David Fetter
On Fri, Jan 16, 2009 at 12:34:34PM -0500, Tom Lane wrote: David Fetter da...@fetter.org writes: I tried this: SELECT typ, ts, rank() over w AS foo_rank FROM foo WINDOW w AS (partition by typ order by ts desc) WHERE foo_rank 4; ERROR: syntax

[GENERAL] Running queries to fetch a count of hits in DB on several things

2009-01-16 Thread Mohamed
Hi, this is basically what I would like to improve : 1) A user searches for a product on category and location. a) The query is run and the result (limit 30) are returned and shown. b) The same query is ran again but now I return the count on how many matches there was totally. (This has to be

Re: [HACKERS] [GENERAL] Question regarding new windowing functions in 8.4devel

2009-01-16 Thread Tom Lane
David Fetter da...@fetter.org writes: We don't appear to be able to use the actual thing in the target list either. Would you translate that into English? Or at least an example without trivial syntax errors? regards, tom lane -- Sent via pgsql-general mailing list

[GENERAL] Inheritance question

2009-01-16 Thread Glyn Astill
Hi chaps, I've got a question about inheritance here, and I think I may have gotten the wrong end of the stick as to how it works, or at least when to use it. What I intended to do was have a schema audit with an empty set of tables in it, then each quarter restore our audit data into schemas

Re: [HACKERS] [GENERAL] Question regarding new windowing functions in 8.4devel

2009-01-16 Thread David Fetter
On Fri, Jan 16, 2009 at 12:41:59PM -0500, Tom Lane wrote: David Fetter da...@fetter.org writes: We don't appear to be able to use the actual thing in the target list either. Would you translate that into English? Or at least an example without trivial syntax errors? This works: SELECT

Re: [HACKERS] [GENERAL] Question regarding new windowing functions in 8.4devel

2009-01-16 Thread Tom Lane
David Fetter da...@fetter.org writes: Basically, there is no way I've found so far to qualify any window function in the target list, which makes a giant POLA violation. The FM points out in at least two places that window functions logically execute on the output of the WHERE/GROUP BY/HAVING

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jeff Davis
On Fri, 2009-01-16 at 08:43 -0600, Jason Long wrote: The numbers in the table names are due to hibernate generating the query. Well, that's what auto-generated schemas and queries do, I guess. Now we are getting somewhere. Someone suggested tweaking the genetic algorithm parameters. Has

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Martin Gainty
good idea although tweaks to geqo_pool_size, geqo_generations, and geqo_selection_bias will affect all queries For larger and unwieldy queries you might want to look at breaking the queries down to smaller pieces e.g. Break each statement to 2 tables with 1 join (preferrably inner join with

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jason Long
Jeff Davis wrote: On Fri, 2009-01-16 at 08:43 -0600, Jason Long wrote: The numbers in the table names are due to hibernate generating the query. Well, that's what auto-generated schemas and queries do, I guess. The schema is not auto generated. It evolved as I created my

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jeff Davis
On Fri, 2009-01-16 at 12:35 -0600, Jason Long wrote: The schema is not auto generated. It evolved as I created my inventory system. It is relatively easy for humans to understand. Or at least for me since I wrote it. On second look, there aren't that many tables. There are just a lot of

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jeff Davis
On Fri, 2009-01-16 at 13:37 -0500, Martin Gainty wrote: good idea although tweaks to geqo_pool_size, geqo_generations, and geqo_selection_bias will affect all queries Only queries that invoke GEQO. Regards, Jeff Davis -- Sent via pgsql-general mailing list

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Scott Marlowe
On Thu, Jan 15, 2009 at 11:04 PM, Jeff Davis pg...@j-davis.com wrote: On Thu, 2009-01-15 at 19:37 -0600, Jason Long wrote: I have not looked into the detail of the explain, and I do see visually that very different plans are being chosen. It would help to share these plans with

Re: [GENERAL] Questions regarding indexes

2009-01-16 Thread Scott Marlowe
On Fri, Jan 16, 2009 at 8:47 AM, Bruno Lavoie bruno.lav...@gmail.com wrote: Hello, are these statements true: «You should always index fks. The only exception is when the matching unique or primary key is never updated or deleted» ? No. If the table that fks to another table has 10 rows

Re: [GENERAL] Questions regarding indexes

2009-01-16 Thread Scott Marlowe
On Fri, Jan 16, 2009 at 8:47 AM, Bruno Lavoie bruno.lav...@gmail.com wrote: Hello, are these statements true: Got interrupted by a coworker... The other two questions: «Create an index if you frequently want to retrieve less than about ~15% of the rows in a large table» PostgreSQL tends

Re: [GENERAL] Questions regarding indexes

2009-01-16 Thread Tom Lane
Scott Marlowe scott.marl...@gmail.com writes: The order doesn't matter. Analyze doesn't know anything about the indexes, it knows about the fields / tables. I.e. if you run analyze, then create the index, you get the same basic result as if you create the index then run analyze. There is an

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Scott Marlowe
Weird. I wonder if the attachment is too big and the mailing list server is chopping it off of the email. On Fri, Jan 16, 2009 at 1:19 PM, Jason Long mailing.l...@supernovasoftware.com wrote: Scott Marlowe wrote: On Thu, Jan 15, 2009 at 11:04 PM, Jeff Davis pg...@j-davis.com wrote: On Thu,

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jason Long
Scott Marlowe wrote: Weird. I wonder if the attachment is too big and the mailing list server is chopping it off of the email. I just tried it by sending text only instead of text and html. We will see if it goes through this time. Other than that do you see anything weird about my email?

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jason Long
Scott Marlowe wrote: On Thu, Jan 15, 2009 at 11:04 PM, Jeff Davis pg...@j-davis.com wrote: On Thu, 2009-01-15 at 19:37 -0600, Jason Long wrote: I have not looked into the detail of the explain, and I do see visually that very different plans are being chosen. It would help

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread David Wilson
On Fri, Jan 16, 2009 at 3:27 PM, Jason Long mailing.l...@supernovasoftware.com wrote: I just tried it by sending text only instead of text and html. We will see if it goes through this time. Other than that do you see anything weird about my email? Still nothing. Do you have webspace you

[GENERAL] Running queries to fetch a count of hits in DB on several things

2009-01-16 Thread Brendan Duddridge
You're not going to get anywhere using Postgres for this kind of task. Especially if you have millions of products like we do in our database. We switched to using Solr for our search indexing and querying. It's way faster than Postgres for obtaining counts like you need. We still fetch

Re: [GENERAL] Autovacuum daemon terminated by signal 11

2009-01-16 Thread Justin Pasher
Tom Lane wrote: I read it like this: #0 0x0827441d in MemoryContextAlloc () -- real #1 0x08274467 in MemoryContextStrdup ()-- real #2 0x0826501c in database_getflatfilename () -- real #3 0x0826504e in database_getflatfilename () -- must be write_database_file #4

[GENERAL] Slave server: FATAL: incorrect checksum in control file

2009-01-16 Thread Leif Jensen
Hi Guys, I'm trying to set up a warm standby server, but have problems with running it on the backup. I feel that I have done like the documentation says: The WAL is being copied to the slave using rsync. Doing SELECT pg_start_backup(); (in psql) Copying the data directory to the

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jason Long
David Wilson wrote: On Fri, Jan 16, 2009 at 3:27 PM, Jason Long mailing.l...@supernovasoftware.com wrote: I just tried it by sending text only instead of text and html. We will see if it goes through this time. Other than that do you see anything weird about my email? Still nothing.

Re: [GENERAL] Autovacuum daemon terminated by signal 11

2009-01-16 Thread Tom Lane
Justin Pasher just...@newmediagateway.com writes: I recompiled from the Debian source package and added --enable-cassert (--enable-debug was already there). I replaced the Debian standard packages with the recompiled versions and started up the cluster. Now it is hitting a failure on one of

Re: [GENERAL] Slave server: FATAL: incorrect checksum in control file

2009-01-16 Thread Tom Lane
Leif Jensen l...@crysberg.dk writes: So far I don't get any errors, but when I start postgres on the slave (I'm using pg_ctl), I get the error 'FATAL: incorrect checksum in control file'. Both servers are running PostgreSQL-8.3.5, configured with exactly the same options (just prefix

Re: [GENERAL] Autovacuum daemon terminated by signal 11

2009-01-16 Thread Justin Pasher
Tom Lane wrote: Justin Pasher just...@newmediagateway.com writes: I recompiled from the Debian source package and added --enable-cassert (--enable-debug was already there). I replaced the Debian standard packages with the recompiled versions and started up the cluster. Now it is hitting a

Re: [GENERAL] Autovacuum daemon terminated by signal 11

2009-01-16 Thread Alvaro Herrera
Justin Pasher wrote: Dang it. I wonder why the --enable-debug option doesn't seem to actually be enabling debug. :( For reference, here is the configure command that the package uses according to the config.log (in case you spot anything wrong). Maybe the executable is getting

Re: [GENERAL] Autovacuum daemon terminated by signal 11

2009-01-16 Thread Justin Pasher
Tom Lane wrote: #1 0xb7c37811 in raise () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7c38fb9 in abort () from /lib/tls/i686/cmov/libc.so.6 #3 0x0828cdf3 in ExceptionalCondition () #4 0x082a8cd2 in MemoryContextAlloc () #5 0x082a8d67 in MemoryContextStrdup () #6 0x0829749c in

Re: [GENERAL] Autovacuum daemon terminated by signal 11

2009-01-16 Thread Tom Lane
I wrote: ... and you've seemingly not managed to install the debug symbols where gdb can find them. But never mind that --- it turns out to be trivial to reproduce the crash. Just create a database, set its datfrozenxid and datvacuumxid far in the past (via a manual update of pg_database),

Re: [GENERAL] Inheritance question

2009-01-16 Thread Erik Jones
On Jan 16, 2009, at 9:49 AM, Glyn Astill wrote: Hi chaps, I've got a question about inheritance here, and I think I may have gotten the wrong end of the stick as to how it works, or at least when to use it. What I intended to do was have a schema audit with an empty set of tables in

[GENERAL] Usenet gateway not working

2009-01-16 Thread Rainer Bauer
Hello, seems like the usenet gateway is down again (my last successful contact to news.postgresql.org dates back 10 days). Is this a known problem? Rainer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] Trigger to clone across databases?

2009-01-16 Thread Darren Govoni
Hi, I'm looking for a trigger (any language) that can clone the inserted row and insert it in another postgres server elsewhere. Is this possible? Practical? Thoughts? I know there are some replication systems out there, but I'm hoping a simple trigger will suffice since I only need to clone

Re: [GENERAL] Slave server: FATAL: incorrect checksum in control file

2009-01-16 Thread Leif Jensen
You are perfectly right, master is 32bit and slave is 64bit. I didn't even consider that that would matter when just copying the data. First I was using different versions on the two boxes, but ended up installing 8.3.5 on both of them. How do I install a 32bit PostgreSql on my 64bit

Re: [GENERAL] Slave server: FATAL: incorrect checksum in control file

2009-01-16 Thread Christopher Browne
On Fri, Jan 16, 2009 at 9:18 PM, Leif Jensen l...@crysberg.dk wrote: You are perfectly right, master is 32bit and slave is 64bit. I didn't even consider that that would matter when just copying the data. First I was using different versions on the two boxes, but ended up installing 8.3.5 on

Re: [GENERAL] Slave server: FATAL: incorrect checksum in control file

2009-01-16 Thread Leif Jensen
That is almost too simple ;-) Thanks for the suggestion, Leif - Christopher Browne cbbro...@gmail.com wrote: On Fri, Jan 16, 2009 at 9:18 PM, Leif Jensen l...@crysberg.dk wrote: You are perfectly right, master is 32bit and slave is 64bit. I didn't even consider that that

Re: [GENERAL] Autovacuum daemon terminated by signal 11

2009-01-16 Thread Alvaro Herrera
Tom Lane wrote: What is happening is that autovacuum_do_vac_analyze contains old_cxt = MemoryContextSwitchTo(AutovacMemCxt); ... vacuum(vacstmt, relids); ... MemoryContextSwitchTo(old_cxt); and at the time it is called by process_whole_db,

[GENERAL] accessing user table structures from SQL

2009-01-16 Thread Vincent Predoehl
Does postgresql have a system table that has the table structure of user tables, like systables and sysobjects in MS SQL Server? -- Vincent

[GENERAL] executing a sql script

2009-01-16 Thread johnf
I'm using python and can execute standard select,update,delete,functions. What I'd like to do is execute a sql script (a text file). But I don't know how? Some thing like: import psycopg2 import psycopg2.extensions conn = psycopg2.connect(host=%s dbname=%s user =%s password =%s

[GENERAL] array_agg for 8.3

2009-01-16 Thread Faheem Mitha
Hi, Can anyone comment on the practicality of using the code for array_agg from the dev repos, file src/backend/utils/adt/array_userfuncs.c in 8.3 as a user defined function? It looks like this code was recently added, Nov 13th/14th. There are two functions, array_agg_transfn and

Re: [GENERAL] accessing user table structures from SQL

2009-01-16 Thread Scott Marlowe
On Fri, Jan 16, 2009 at 9:32 PM, Vincent Predoehl vpredo...@phoenixwebgroup.com wrote: Does postgresql have a system table that has the table structure of user tables, like systables and sysobjects in MS SQL Server? There's the pg_* views and tables that have all of that, and to see how they