[GENERAL] How identify a long running transaction

2009-11-23 Thread Bill Todd
Using 8.4.1. How can I 1) Get the transaction id of the oldest serializable transaction and the next transaction? 2) A list of all active transactions I have searched the docs and tried Google but I must not be using the right terminology. Also, am I correct in assuming that vacuuming i

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Craig Ringer
On 23/11/2009 11:35 PM, Tom Lane wrote: > Andrew Gierth writes: >> "Tom" == Tom Lane writes: >> Tom> Well, that's pretty much exactly the question --- are there? It >> Tom> would certainly make it easier for someone to exploit any other >> Tom> security weakness they might find. > >> Loops i

Re: [GENERAL] Multicolumn index including tsvector.

2009-11-23 Thread Kris Gale
> > > explain analyze select body from example where user_id=1 and vectors @@ > > to_tsquery('simple', 'when') limit 10; > > Try coercing the '1' to a bigint. I don't believe the btree_gist > opclasses have any support for cross-type operators. > Perfect! Thanks, Tom. The query plan now shows i

Re: [GENERAL] Multicolumn index including tsvector.

2009-11-23 Thread Tom Lane
Kris Gale writes: > So what I'm expecting here is that it'll be able to use one of those > composite indexes to satisfy both the user_id and the vectors constraints. > That doesn't seem to be the case, based on this query plan: > explain analyze select body from example where user_id=1 and vector

[GENERAL] Multicolumn index including tsvector.

2009-11-23 Thread Kris Gale
Hi everyone, In the documentation and past messages to this list, it sounds like the btree_gist and btree_gin modules included in contrib/ in 8.4 should give me the functionality I'm looking for, but I don't seem to be getting the behavior I want. I've made an example table representing something

Re: [GENERAL] I need help creating a composite type with some sort of constraints.

2009-11-23 Thread Scott Bailey
John Oyler wrote: I can create one or more domains, and use those to create the composite type from. But each domain can only be constrained in its own value, I can't constrain element #1's value based on what element #2's value is. If I create a domain from a composite, it will complain with a

Re: [GENERAL] get a log of queries that take up a lot of CPU or take a very long time.

2009-11-23 Thread Alan Hodgson
On Monday 23 November 2009, Tim Uckun wrote: > Is there a way I can get a list of the top 10 longest running queries > for the day/week/month or the top 10 queries that took the most CPU? > > select * from pg_stat_activity only shows the current status. You can enable query logging, store the log

[GENERAL] get a log of queries that take up a lot of CPU or take a very long time.

2009-11-23 Thread Tim Uckun
Is there a way I can get a list of the top 10 longest running queries for the day/week/month or the top 10 queries that took the most CPU? select * from pg_stat_activity only shows the current status. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your s

Re: [GENERAL] C++ and Postgis

2009-11-23 Thread Martin Gainty
anytime you see a codebase filled with a plethora of function pointers, LockObject and miles of code to achieve simple keyword scope (public/protected/private) then you know the product is ready to be rewritten to OO Language My suggestion would be Java (so we could use maven for version specif

Re: [GENERAL] C++ and Postgis

2009-11-23 Thread John R Pierce
Pedro Doria Meunier wrote: Hi All, First off sorry for cross-posting. I'm hoping for a bigger audience... :] As for my question: How does one deal with Postgis geom fields in C++ ? Google hasn't offered much help so far. I know I can make a "SELECT astext(my_geom) FROM my_table" and after pa

[GENERAL] I need help creating a composite type with some sort of constraints.

2009-11-23 Thread John Oyler
I can create one or more domains, and use those to create the composite type from. But each domain can only be constrained in its own value, I can't constrain element #1's value based on what element #2's value is. If I create a domain from a composite, it will complain with a "ERROR: cdt.instant_

Re: [GENERAL] Strange performance degradation

2009-11-23 Thread Tom Lane
Bill Moran writes: > In response to Lorenzo Allegrucci : >> Tom Lane wrote: >>> Are you killing off any long-running transactions when you restart? >> Anyway, how can I get rid those "idle in transaction" processes? >> Can I just kill -15 them or is there a less drastic way to do it? > Connectio

[GENERAL] C++ and Postgis

2009-11-23 Thread Pedro Doria Meunier
Hi All, First off sorry for cross-posting. I'm hoping for a bigger audience... :] As for my question: How does one deal with Postgis geom fields in C++ ? Google hasn't offered much help so far. I know I can make a "SELECT astext(my_geom) FROM my_table" and after parsing the resulting text. T

Re: [GENERAL] obtaining ARRAY position for a given match

2009-11-23 Thread Pedro Doria Meunier
Regarding this thread... I've been away for a while... But thank you to all who replied! :) BR, Pedro On 11/19/2009 07:03 PM, Sam Mason wrote: On Thu, Nov 19, 2009 at 10:47:02AM -0800, Scott Bailey wrote: Sam Mason wrote: Is "idx" really the best name for this? Well I used

Re: [GENERAL] Strange performance degradation

2009-11-23 Thread Bill Moran
In response to Lorenzo Allegrucci : > Tom Lane wrote: > > Lorenzo Allegrucci writes: > >> So, my main question is.. how can just a plain simple restart of postgres > >> restore the original performance (3% cpu time)? > > > > Are you killing off any long-running transactions when you restart? >

Re: [GENERAL] Strange performance degradation

2009-11-23 Thread Lorenzo Allegrucci
Tom Lane wrote: Lorenzo Allegrucci writes: So, my main question is.. how can just a plain simple restart of postgres restore the original performance (3% cpu time)? Are you killing off any long-running transactions when you restart? After three days of patient waiting it looks like the comm

Re: [GENERAL] PG_STANDBY ISSUE

2009-11-23 Thread Greg Smith
akp geek wrote: One small doubt I have is , do we have to keep the backup_label on the standby, I deleted it before I start the restore process , it still worked .. Just curious The backup label is strictly for you to read, to help make sure you got all of the archived segments necessary for t

Re: [GENERAL] PG_STANDBY ISSUE

2009-11-23 Thread akp geek
Thanks a lot Richard. The culprit in my case is the restore command , I modified it as follows per your instructions , it is fine now restore_command = 'pg_standby -d -s 5 -t /tmp/pg_standby.trigger.5432 /opt/postgres/archive %f %p %r 2>>/tmp/standby.log' One small doubt I have is , do we have

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> Loops in plain SQL are no problem: see generate_series. The last >> time we discussed this I demonstrated reasonably straightforward >> SQL examples of how to do things like password-cracking (and that >> was long before we had CTEs, so it would be even easi

Re: [GENERAL] PG_STANDBY ISSUE

2009-11-23 Thread Richard Huxton
akp geek wrote: > Hi experts - > > I am running into issue with pg_standby. May be my > understanding is not correct. Please help. here is what I did . > > >1. I made changes in the postgresql.conf ( archive_mode = on >,archive_command = 'cp -i %p /opt/postgres/archi

Re: [GENERAL] Error in Loading DLL using Postgres function

2009-11-23 Thread Merlin Moncure
On Mon, Nov 23, 2009 at 9:10 AM, wrote: > Hi All, > I am trying to load a dll using the Postgres function but whenever I am > calling it is giving me the below error message. I am using Win32 machine > and compiled and created the dll using MSVC2005. > > ERROR:  could not load library "C:/Program

Re: [GENERAL] Comprehensive operator list

2009-11-23 Thread Thom Brown
2009/11/23 Merlin Moncure > On Mon, Nov 23, 2009 at 11:06 AM, Thom Brown wrote: > > Hi all, > > > > Does anyone know if there's a full list of operators and their usage > > anywhere? What I'm after is a combination of what is provided in > separate > > sections in the documentation and what the

Re: [GENERAL] Comprehensive operator list

2009-11-23 Thread Merlin Moncure
On Mon, Nov 23, 2009 at 11:06 AM, Thom Brown wrote: > Hi all, > > Does anyone know if there's a full list of operators and their usage > anywhere?  What I'm after is a combination of what is provided in separate > sections in the documentation and what the pg_operator catalog lists.  Or > even a g

[GENERAL] Fwd: PG_STANDBY ISSUE

2009-11-23 Thread akp geek
Hi All - Can you please help me with the issue when you get some time regards -- Forwarded message -- From: akp geek Date: Fri, Nov 20, 2009 at 3:38 PM Subject: PG_STANDBY ISSUE To: pgsql-general@postgresql.org Hi experts - I am running into issue with pg_sta

[GENERAL] Comprehensive operator list

2009-11-23 Thread Thom Brown
Hi all, Does anyone know if there's a full list of operators and their usage anywhere? What I'm after is a combination of what is provided in separate sections in the documentation and what the pg_operator catalog lists. Or even a generic operator list. For example: @> generally means left is c

Re: [GENERAL] How is the right query for this condition ?

2009-11-23 Thread Harald Fuchs
In article <5a9699850911222009j272071fbi1dd0c40dfdf62...@mail.gmail.com>, Brian Modra writes: > 2009/11/23 Bino Oetomo : >> Dear All >> >> Suppose I created a database with single table like this : >> --start-- >> CREATE DATABASE bino; >> CREATE TABLE myrecords(record text); >> -

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> Well, that's pretty much exactly the question --- are there? It > Tom> would certainly make it easier for someone to exploit any other > Tom> security weakness they might find. > Loops in plain SQL are no problem: see generate_series.

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Andrew Dunstan
Tom Lane wrote: Thom Brown writes: As for having plpgsql installed by default, are there any security implications? Well, that's pretty much exactly the question --- are there? It would certainly make it easier for someone to exploit any other security weakness they might find. I

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Andrew Gierth
> "Tom" == Tom Lane writes: > Thom Brown writes: >> As for having plpgsql installed by default, are there any security >> implications? Tom> Well, that's pretty much exactly the question --- are there? It Tom> would certainly make it easier for someone to exploit any other Tom> secur

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Thom Brown
2009/11/23 Tom Lane > Thom Brown writes: > > As for having plpgsql installed by default, are there any security > > implications? > > Well, that's pretty much exactly the question --- are there? It would > certainly make it easier for someone to exploit any other security > weakness they might

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Tom Lane
Thom Brown writes: > As for having plpgsql installed by default, are there any security > implications? Well, that's pretty much exactly the question --- are there? It would certainly make it easier for someone to exploit any other security weakness they might find. I believe plain SQL plus SQL

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Robert Haas
On Sun, Nov 22, 2009 at 11:38 PM, Tom Lane wrote: > Robert Haas writes: >> On Sun, Nov 22, 2009 at 6:51 PM, Tom Lane wrote: >>> CREATE IF NOT EXISTS has been proposed and rejected before, more than >>> once.  Please see the archives. > >> Search for CINE to find the discussions.  This is a good

[GENERAL] Error in Loading DLL using Postgres function

2009-11-23 Thread A.Bhattacharya
Hi All, I am trying to load a dll using the Postgres function but whenever I am calling it is giving me the below error message. I am using Win32 machine and compiled and created the dll using MSVC2005. ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/watchlist.dll": This

Re: [GENERAL] Backup Postgre server

2009-11-23 Thread AnthonyV
On 23 nov, 13:20, plk.zu...@gmail.com (Filip Rembiałkowski) wrote: > 2009/11/23 AnthonyV : > > > Hello, > > > I have a pg8.3 server (an 8.4 upgrade is scheduled) on Windows. > > I would like an other pg server in backup in case of hardware problem > > on my first server. > > > I use read/write quer

Re: [GENERAL] Backup Postgre server

2009-11-23 Thread Filip Rembiałkowski
2009/11/23 AnthonyV : > Hello, > > I have a pg8.3 server (an 8.4 upgrade is scheduled) on Windows. > I would like an other pg server in backup in case of hardware problem > on my first server. > > I use read/write queries and I would like the second pg become master > without any human intervention

Re: [GENERAL] Backup Postgre server

2009-11-23 Thread David Fetter
On Mon, Nov 23, 2009 at 03:19:17AM -0800, AnthonyV wrote: > Hello, > > I have a pg8.3 server (an 8.4 upgrade is scheduled) on Windows. I > would like an other pg server in backup in case of hardware problem > on my first server. > > I use read/write queries and I would like the second pg become

[GENERAL] Backup Postgre server

2009-11-23 Thread AnthonyV
Hello, I have a pg8.3 server (an 8.4 upgrade is scheduled) on Windows. I would like an other pg server in backup in case of hardware problem on my first server. I use read/write queries and I would like the second pg become master without any human intervention. I saw Slony, but it seems that th

Re: [GENERAL] DBD::Pg 2.15.1 compilation failed

2009-11-23 Thread Alexandra Roy
Hi all, I am still trying to build DBD::Pg but I have another question. Is it possible to do a 64-build of DBD::Pg ? I ask this because PostgreSQL 8.3.8 has been compiled in 64 bits mode and if DBD::Pg expects to find 32 bits library, this can explain my problem... Any idea ? Thanks, Regard

Re: [HACKERS] [GENERAL] Updating column on row update

2009-11-23 Thread Thom Brown
2009/11/23 Tom Lane > CREATE OR REPLACE has got far safer semantics from the viewpoint of a > script that wants to bull through without having any actual error > handling (which is more or less the scenario we are arguing here, no?) > After successful execution of the command you know exactly wha

Re: [GENERAL] ora2pg and DBD::Pg

2009-11-23 Thread Alexandra Roy
Hi all, And what about "on the fly" please ? As I encounter compilation problem on AIX 5.3, I am wondering if DBD::Pg is necessary to use ora2pg... Thank you for your help, Regards, Alexandra Stephen Frost a écrit : * Alexandra Roy (alexandra@bull.net) wrote: Does someone can explain

Re: [GENERAL] Returning bigint from C extension

2009-11-23 Thread Martijn van Oosterhout
On Mon, Nov 23, 2009 at 09:58:21AM +0200, Jason Armstrong wrote: > How can I return a bigint value from a C extension function? > > I have a table with a bytea column: > > CREATE TABLE mydata(data bytea); > > I would like to select and index based on a subset of the data: > > CREATE FUNCTION ge

Re: [GENERAL] DBD::Pg 2.15.1 compilation failed

2009-11-23 Thread Alexandra Roy
Hi Greg, hi all, Sorry for the mail sent in "HTML only"... I work with AIX 5.3 TL9 and I have installed PostgreSQL 8.3.8 from the source "postgresql-8.3.8.tar.gz". libpq seems to have been installed during the build. I check the README of DBD::Pg and : 1. pg_config is available and returns :