Re: [GENERAL] Are there plans to add data compression feature to postgresql?

2008-10-27 Thread Ron Mayer
You might want to try using a file system (ZFS, NTFS) that does compression, depending on what you're trying to compress. -- 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] [PLPGSQL] PERFORM into an EXECUTE allowed ?

2008-10-27 Thread Bruno Baguette
Le 27/10/08 05:16, Tom Lane a écrit : Bruno Baguette <[EMAIL PROTECTED]> writes: EXECUTE 'PERFORM COUNT(*)' || ' FROM ' || quote_ident(TG_RELNAME) || ' GROUP BY ' || quote_ident(column_name_to_check) || ' HAVING COUNT(*) > 1'; PERFORM is a plpgsql keyword, not a SQL keyword,

[GENERAL] psql screen size

2008-10-27 Thread wstrzalka
I'm using psql mainly in putty window. I have a problem while resizing the window. When changing the window size (and those chars per row) psql output becomes mess, the only rescue is to exit and run the psql again. It looks like it's initializing the output params at startup and don't refresh it

Re: [GENERAL] partitioning a table containing millions of records

2008-10-27 Thread Andreas Jochem
Thanks for your reply, I gonna try your suggestion. Andi Nikolas Everett wrote: There is no fast way to split an existing table into partitions. Create a new parent table, create partitions, create the insert trigger, and then INSERT INTO newparent SELECT * FROM unpartitioned. You may wan

Re: [GENERAL] a LEFT JOIN problem

2008-10-27 Thread Thomas
Unfortunately, I cannot use >= in the ON clause when making a search on a date range. -- 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] Are there plans to add data compression feature to postgresql?

2008-10-27 Thread Chris . Ellis
Note that most data stored in the TOAST table is compressed. IE a Text type with length greater than around 2K will be stored in the TOAST table. By default data in the TOAST table is compressed, this can be overriden. However I expect that compression will reduce the performance of certain

Re: [GENERAL] psql screen size

2008-10-27 Thread Peter Eisentraut
wstrzalka wrote: I'm using psql mainly in putty window. I have a problem while resizing the window. When changing the window size (and those chars per row) psql output becomes mess, the only rescue is to exit and run the psql again. It looks like it's initializing the output params at startup an

[GENERAL] nearest neighbor search from xyz coordinates

2008-10-27 Thread Andreas Jochem
Hello, I have a table containing x y z coordinates. But I have no geometry column? Is it possible to find the k nearest neighbors of any point. Is there something like a kd-tree Index in postgres??? I know, if i had a geometry column I could make use of the distance function to find the k nea

[GENERAL] Replication with slony-I

2008-10-27 Thread Abdul Rahman
May any one support step by step procedure for the replication with slony-I in windows xp.

Re: [GENERAL] nearest neighbor search from xyz coordinates

2008-10-27 Thread Serge Fonville
What exactly do you want to measure, since values can be compared easily by a where clauseIf you would want for example all rows within a spherical distance you will either have to write a stored procedure (which takes 4 parameters x,y,z,distance) Or manually compare each corodinate to the distance

Re: [GENERAL] [PLPGSQL] PERFORM into an EXECUTE allowed ?

2008-10-27 Thread Tom Lane
Bruno Baguette <[EMAIL PROTECTED]> writes: > Le 27/10/08 05:16, Tom Lane a écrit : >> Bruno Baguette <[EMAIL PROTECTED]> writes: >>> EXECUTE 'PERFORM COUNT(*)' >>> || ' FROM ' || quote_ident(TG_RELNAME) >>> || ' GROUP BY ' || quote_ident(column_name_to_check) >>> || ' HAVING COUNT(*) > 1'; >> >> P

Re: [GENERAL] psql screen size

2008-10-27 Thread Sam Mason
On Mon, Oct 27, 2008 at 01:59:42AM -0700, wstrzalka wrote: > I'm using psql mainly in putty window. it's pretty much always just worked with me. I'm using a very old version of putty, but it all hangs together as well as anything else does > When changing the window size (and those chars per row

Re: [GENERAL] a LEFT JOIN problem

2008-10-27 Thread Sam Mason
On Mon, Oct 27, 2008 at 10:47:13AM +0100, Thomas wrote: > Unfortunately, I cannot use >= in the ON clause when making a search > on a date range. The right-hand-side of an ON clause is a general expression; you can include (and I regularly do) arbitrary functions and operators. I'm probably missi

Re: [GENERAL] Replication with slony-I

2008-10-27 Thread postgres Emanuel CALVO FRANCO
http://slony.blogspot.com/ sorry is in spanish, but is an exelent resource, i hope it will be useful reggards 2008/10/27 Abdul Rahman <[EMAIL PROTECTED]>: > May any one support step by step procedure for the replication with slony-I > in windows xp. > > -- Emanuel Calvo Franco Sysc

Re: [GENERAL] syncing with a MySQL DB

2008-10-27 Thread Linos
Brandon Metcalf escribió: m == [EMAIL PROTECTED] writes: m> On Tue, Oct 21, 2008 at 9:54 AM, Brandon Metcalf <[EMAIL PROTECTED]> wrote: m> > m == [EMAIL PROTECTED] writes: m> > m> > m> On Tue, Oct 21, 2008 at 9:07 AM, Brandon Metcalf <[EMAIL PROTECTED]> wrote: m> > m> > I have a need to

[GENERAL] 8.3.x log maintenance

2008-10-27 Thread Steve Clark
Hi, I have postgres logging into data/pg_log/ which works great. My question is there and option that tells postgres to only keep the last "n" log files? Or does someone have a script that be run daily to remove the older log files so that I only end up with "n" log files? Thanks, Steve log_

Re: [GENERAL] Replication with slony-I

2008-10-27 Thread Raymond O'Donnell
On 27/10/2008 11:17, Abdul Rahman wrote: > May any one support step by step procedure for the replication with > slony-I in windows xp. There's a pretty good step-by-step guide in the Slony documentation - I haven't it to hand, but it's entitled "Replicating your first database" or something like

Re: [GENERAL] 8.3.x log maintenance

2008-10-27 Thread Raymond O'Donnell
On 27/10/2008 13:19, Steve Clark wrote: > I have postgres logging into data/pg_log/ which works great. My > question is there and option that tells postgres to only keep the > last "n" log files? Or does someone have a script that be run daily > to remove the older log files so that I only end up

Re: [GENERAL] 8.3.x log maintenance

2008-10-27 Thread Tom Lane
Steve Clark <[EMAIL PROTECTED]> writes: > I have postgres logging into data/pg_log/ which works great. My question is > there > and option that tells postgres to only keep the last "n" log files? The usual solution is to choose a filename pattern that will repeat after an appropriate interval, eg

Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-27 Thread Robert Treat
On Monday 20 October 2008 05:25:29 Simon Riggs wrote: > I'm looking to implement the following functions for Hot Standby, to > allow those with administrative tools or management applications to have > more control during recovery. Please let me know if other functions are > required. > > What else

Re: [GENERAL] 8.3.x log maintenance

2008-10-27 Thread Steve Clark
Tom Lane wrote: Steve Clark <[EMAIL PROTECTED]> writes: I have postgres logging into data/pg_log/ which works great. My question is there and option that tells postgres to only keep the last "n" log files? The usual solution is to choose a filename pattern that will repeat after an appropri

Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-27 Thread Simon Riggs
On Mon, 2008-10-27 at 11:42 -0400, Robert Treat wrote: > On Monday 20 October 2008 05:25:29 Simon Riggs wrote: > > I'm looking to implement the following functions for Hot Standby, to > > allow those with administrative tools or management applications to have > > more control during recovery. Pl

[GENERAL] EXECUTE in trigger functions.

2008-10-27 Thread David Brain
Hi, Is there a way of using EXECUTE in trigger functions to to do something like: CREATE OR REPLACE FUNCTION insert_trigger() RETURNS trigger AS $BODY$ BEGIN EXECUTE('INSERT INTO public_partitions.table_' || date_part('year',NEW.eventdate)::VarChar || lpad(date_part(

[GENERAL] PostgreSQL 8.3.3 chooses wrong query plan when LIMIT 1 added?

2008-10-27 Thread Mark Cave-Ayland
Hi everyone, I'm experiencing a strange issue with PostgreSQL 8.3.3 whereby adding "LIMIT 1" to the query increases the query time from several 10s of ms to over 5s, and was wondering if anyone with more planner-fu can shed some light on this. The database in question is being used to store

[GENERAL] empty table explain...

2008-10-27 Thread Luca Ferrari
Hi all, I'm curious to know why, if a table is empty, it seems that an ANALYZE of the table does not insert any stats in the pg_stats table, since maybe this could be useful to solve joins including this table. Second, if I execute an EXPLAIN on an empty table, even after an ANALYZE of the table

Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-27 Thread Emmanuel Cecchet
Simon Riggs wrote: On Mon, 2008-10-27 at 11:42 -0400, Robert Treat wrote: On Monday 20 October 2008 05:25:29 Simon Riggs wrote: I'm looking to implement the following functions for Hot Standby, to allow those with administrative tools or management applications to have more control dur

Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-27 Thread Robert Treat
On Monday 27 October 2008 12:12:18 Simon Riggs wrote: > On Mon, 2008-10-27 at 11:42 -0400, Robert Treat wrote: > > On Monday 20 October 2008 05:25:29 Simon Riggs wrote: > > > I'm looking to implement the following functions for Hot Standby, to > > > allow those with administrative tools or manageme

Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-27 Thread Simon Riggs
On Mon, 2008-10-27 at 13:08 -0400, Robert Treat wrote: > Was thinking that admin tools that show hot standby information might > also want to show the corresponding slave information (from the point > of view of the master). Well, the standby might be persuaded to know something about the maste

[GENERAL] Execute Shell script after insert

2008-10-27 Thread Anderson dos Santos Donda
Is there a way to execute a simple shell script in server after execute INSERT INTO ? Example? INSERT INTO clients (name) VALUES ('Donda'); after it, execute shell : mkdir $1 Thanks!!!

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Hannes Dorbath
Anderson dos Santos Donda wrote: > Is there a way to execute a simple shell script in server after execute > INSERT INTO ? > > Example? > > INSERT INTO clients (name) VALUES ('Donda'); > > after it, execute shell : mkdir $1 You might find the following project useful: http://plsh.projects.post

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Scott Marlowe
On Mon, Oct 27, 2008 at 12:21 PM, Hannes Dorbath <[EMAIL PROTECTED]> wrote: > Anderson dos Santos Donda wrote: >> Is there a way to execute a simple shell script in server after execute >> INSERT INTO ? >> >> Example? >> >> INSERT INTO clients (name) VALUES ('Donda'); >> >> after it, execute shell

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Andreas Jochem
You can write the insert into command in a shellscript by using #!/bin/bash psql -c "INSERT INTO " -U mkdir $1 Anderson dos Santos Donda wrote: Is there a way to execute a simple shell script in server after execute INSERT INTO ? Example? INSERT INTO clients (name) VALUES (

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Sam Mason
On Mon, Oct 27, 2008 at 03:09:31PM -0300, Anderson dos Santos Donda wrote: > Is there a way to execute a simple shell script in server after execute > INSERT INTO ? Yes; as other people have said most of the procedural languages allow you to run code outside PG. You'd just need to hook this proce

Re: [GENERAL] EXECUTE in trigger functions.

2008-10-27 Thread Hannes Dorbath
David Brain wrote: > Is there a way of using EXECUTE in trigger functions to to do something > like: > > CREATE OR REPLACE FUNCTION insert_trigger() > RETURNS trigger AS > $BODY$ > BEGIN > EXECUTE('INSERT INTO public_partitions.table_' > || date_part('year',NEW.eventdate)::VarChar >

Re: [GENERAL] empty table explain...

2008-10-27 Thread Sam Mason
On Mon, Oct 27, 2008 at 05:43:08PM +0100, Luca Ferrari wrote: > I'm curious to know why, if a table is empty, it seems that an > ANALYZE of the table does not insert any stats in the pg_stats table, > since maybe this could be useful to solve joins including this table. I think it's tryi

Re: [GENERAL] PostgreSQL 8.3.3 chooses wrong query plan when LIMIT 1 added?

2008-10-27 Thread Simon Riggs
On Mon, 2008-10-27 at 16:39 +, Mark Cave-Ayland wrote: > I'm experiencing a strange issue with PostgreSQL 8.3.3 whereby adding > "LIMIT 1" to the query increases the query time from several 10s of ms > to over 5s, and was wondering if anyone with more planner-fu can shed > some light on thi

Re: [GENERAL] nearest neighbor search from xyz coordinates

2008-10-27 Thread Angel Alvarez
El Lunes 27 Octubre 2008 Andreas Jochem escribió: > Hello, > > I have a table containing x y z coordinates. But I have no geometry column? > Is it possible to find the k nearest neighbors of any point. Is there > something like a kd-tree Index in postgres??? > > I know, if i had a geometry colum

Re: [GENERAL] PostgreSQL 8.3.3 chooses wrong query plan when LIMIT 1 added?

2008-10-27 Thread Tom Lane
Mark Cave-Ayland <[EMAIL PROTECTED]> writes: > I'm experiencing a strange issue with PostgreSQL 8.3.3 whereby adding > "LIMIT 1" to the query increases the query time from several 10s of ms > to over 5s, and was wondering if anyone with more planner-fu can shed > some light on this. It's hoping

Re: [GENERAL] empty table explain...

2008-10-27 Thread Tom Lane
Luca Ferrari <[EMAIL PROTECTED]> writes: > I'm curious to know why, if a table is empty, it seems that an ANALYZE > of the table does not insert any stats in the pg_stats table, Uh ... because there are no stats to insert. The only available information is that the table is empty, which is someth

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Tom Lane
Sam Mason <[EMAIL PROTECTED]> writes: > On Mon, Oct 27, 2008 at 03:09:31PM -0300, Anderson dos Santos Donda wrote: >> Is there a way to execute a simple shell script in server after execute >> INSERT INTO ? > Yes; as other people have said most of the procedural languages allow > you to run code o

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread David Fetter
On Mon, Oct 27, 2008 at 03:09:31PM -0300, Anderson dos Santos Donda wrote: > Is there a way to execute a simple shell script in server after execute > INSERT INTO ? > > Example? > > INSERT INTO clients (name) VALUES ('Donda'); > > after it, execute shell : mkdir $1 This will scale better if you

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Chris Browne
[EMAIL PROTECTED] ("Anderson dos Santos Donda") writes: > Is there a way to execute a simple shell script in server after execute > INSERT INTO ? > Example? > INSERT INTO clients (name) VALUES ('Donda'); > after it, execute shell : mkdir $1 You could do this, directly, via stored procedure langua

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-27 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: - I created two schemas, NOVAC and VAC, each with a table T as described above. - Before loading data, I ran VACUUM ANALYZE on VAC.T. - I then started loading data. The workload is a mixture of INSERT, SELECT and UPDATE. For SELE

[GENERAL] How Do I Find the Date When A Table Was Last Changed?

2008-10-27 Thread Bill Thoen
Is there a way to find when data in a postgresql table was last changed? -- 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] PostgreSQL 8.3.3 chooses wrong query plan when LIMIT 1 added?

2008-10-27 Thread Mark Cave-Ayland
Tom Lane wrote: It's hoping that the backwards scan will hit a row with the requested file_id quickly; which might be true on average but isn't true for this particular file_id (nor, presumably, any file_id that hasn't been updated recently). Right. In the case of this schema, that is not true

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-27 Thread Tom Lane
Jack Orenstein <[EMAIL PROTECTED]> writes: > EXPLAIN says that the correct index is being used -- it didn't used > to. However, pg_stat* says otherwise. In my test, I have exactly one > dh value. Running EXPLAIN with this value produces a plan using idx_dh > (the correct index), but pg_stats says t

Re: [GENERAL] PostgreSQL 8.3.3 chooses wrong query plan when LIMIT 1 added?

2008-10-27 Thread Tom Lane
Mark Cave-Ayland <[EMAIL PROTECTED]> writes: > svnlog=# SELECT revision_id FROM revision_files WHERE file_id=(SELECT > file_id > FROM files WHERE filepath='/trunk/app/widgets/gimptoolbox-dnd.c' LIMIT 1) > ORDER BY revision_id DESC LIMIT 1; > revision_id > - > 15011 > (1 row)

Re: [GENERAL] How Do I Find the Date When A Table Was Last Changed?

2008-10-27 Thread Scott Marlowe
On Mon, Oct 27, 2008 at 4:02 PM, Bill Thoen <[EMAIL PROTECTED]> wrote: > Is there a way to find when data in a postgresql table was last changed? what do you mean by changed? Data updated? schema changed? PostgreSQL provides neither by default really. You could set up an update trigger to handl

Re: [GENERAL] [PLPGSQL] PERFORM into an EXECUTE allowed ?

2008-10-27 Thread Bruno Baguette
Le 27/10/08 13:12, Tom Lane a écrit : In that case you just do EXECUTE 'SELECT ... regards, tom lane Hem... I feel quite stupid, but you're (again) right. It now run perfectly. By the way, I said previously that EXECUTE does not allow to put the results into a target.

Re: [GENERAL] Replication with slony-I

2008-10-27 Thread Abdul Rahman
Thanks a lot  Ray! I have found the document and going to follow this. If I face any difficulty then will prompt to archive. Regards, Abdul. --- On Mon, 10/27/08, Raymond O'Donnell <[EMAIL PROTECTED]> wrote: From: Raymond O'Donnell <[EMAIL PROTECTED]> Subject: Re: [GENERAL] Replication with

[GENERAL] How to know the password for the user 'postgres'

2008-10-27 Thread Shashank Sahni
Hello people, I was trying to install dspace on my computer and it required postgresql as a prerequisite. Since I am using Ubuntu so i just downloaded and installed it using synaptic package manager. For the installation of dspace i was supposed to exeucte the following comman

Re: [GENERAL] How to know the password for the user 'postgres'

2008-10-27 Thread Scott Marlowe
On Mon, Oct 27, 2008 at 10:38 PM, Shashank Sahni <[EMAIL PROTECTED]> wrote: > Hello people, > I was trying to install dspace on my computer and it > required postgresql as a prerequisite. Since I am using Ubuntu so i just > downloaded and installed it using synaptic package ma

Re: [GENERAL] How to know the password for the user 'postgres'

2008-10-27 Thread Shashank Sahni
createuser: could not connect to database postgres: FATAL: password > authentication failed for user "postgres" > > Odd I would have expected it to say something about identd > authentication failing. > > Have you tried: > > sudo su - postgres > createuser -d -A -P dpsace > > ? > Oh... I am so

Re: [GENERAL] How to know the password for the user 'postgres'

2008-10-27 Thread Scott Marlowe
On Mon, Oct 27, 2008 at 10:55 PM, Shashank Sahni <[EMAIL PROTECTED]> wrote: > > >> createuser: could not connect to database postgres: FATAL: password >> authentication failed for user "postgres" >> >> Odd I would have expected it to say something about identd >> authentication failing. >> >> H

Re: [GENERAL] How to know the password for the user 'postgres'

2008-10-27 Thread Shashank Sahni
On Tue, Oct 28, 2008 at 10:52 AM, Tony Caduto < [EMAIL PROTECTED]> wrote: > > Edit the pg_hba.conf file and add a entry for the PC you are doing your > admin from and set it to Trust. > When set to trust you won't need a password, then use the admin tool of > your choice to change the postgres pas

Re: [GENERAL] How to know the password for the user 'postgres'

2008-10-27 Thread Scott Marlowe
On Mon, Oct 27, 2008 at 11:34 PM, Shashank Sahni <[EMAIL PROTECTED]> wrote: > > On Tue, Oct 28, 2008 at 10:52 AM, Tony Caduto > <[EMAIL PROTECTED]> wrote: >> >> Edit the pg_hba.conf file and add a entry for the PC you are doing your >> admin from and set it to Trust. >> When set to trust you won't