[GENERAL] Re: Monitoring activities of PostgreSQL ("Everlasting" function execution)

2010-06-16 Thread Allan Kamau
On Tue, Jun 15, 2010 at 5:03 PM, Allan Kamau wrote: > I do have a PL/SQL function that gets executed called many times but > with different parameter values each of these times. For most > invocations of this function run in a couple of seconds however some > invocations of the same function run (

Re: [GENERAL] integer to little endian conversion

2010-06-16 Thread maarten
Hello again, I've found what I'm looking for. I overlooked the binary string functions which I stumbled upon just now. The set_byte() function for binary strings is just what I needed. The function for those interested now becomes: CREATE OR REPLACE FUNCTION utils.int_littleendian(v_number int

Re: [GENERAL] Re: Monitoring activities of PostgreSQL ("Everlasting" function execution)

2010-06-16 Thread Craig Ringer
On 16/06/10 16:56, Allan Kamau wrote: > The function I have mentioned above seems to "hang" indefinitely (now > 12hours and counting) while it took only 2secs for the many times it > was previously invoked from the client application (with slightly > different parameter value at each such time).

Re: [GENERAL] libpython - cannot open shared object file

2010-06-16 Thread Tom Wilcox
Interesting: This works: postg...@ubuntu64-bertha:~$ createlang -d cse plpythonu Password: postg...@ubuntu64-bertha:~$ But this doesn't: postg...@ubuntu64-bertha:~$ psql -c "CREATE LANGUAGE plpythonu" Password: ERROR: could not load library "/opt/PostgreSQL/8.4/lib/postgresql/plpython.so": lib

Re: [GENERAL] GSS Authentication

2010-06-16 Thread Stephen Frost
Greig, * greigw...@comcast.net (greigw...@comcast.net) wrote: > I finally got it working. Problem was that on the windows side on the service > account within the account options, we needed to check "Use DES encryption > types for this account". I had that changed on the AD side and that fixed t

Re: [GENERAL] Monitoring activities of PostgreSQL

2010-06-16 Thread Filip Rembiałkowski
2010/6/15 Allan Kamau > I do have a PL/SQL function that gets executed called many times but > with different parameter values each of these times. For most > invocations of this function run in a couple of seconds however some > invocations of the same function run (on the same dataset) for hour

Re: [GENERAL] consequent PQsendQueryPrepared() failed: another command is already in progress

2010-06-16 Thread Tom Lane
Anton Maksimenkov writes: > I'm using libpq C Library. I prepared some query and trying to call it > many times. > But it success only at first time, and then fail with error: > ... "another command is already in progress" > [ PQsendQuery followed by just one PQgetResult ] IIRC, you need to keep

[GENERAL] hi,i write a function in postgresql source code, how to register this function?

2010-06-16 Thread sunpeng
hi,i write a function in postgresql source code, how to register this function? it is not an aggregate function. i don't use 34.3"User-Defined Functions" described in http://www.postgresql.org/docs/8.4/interactive/xfunc.html, i just write it in postgresql sourcecode, how to register this function t

[GENERAL] Catalog table with cursor definition

2010-06-16 Thread Kelly Burkhart
Is there a catalog table or function to get the text of the query associated with a cursor? If I query pg_stat_activity all I see is 'fetch forward 1000 from XYZ'. -K -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresq

Re: [GENERAL] GSS Authentication

2010-06-16 Thread greigwise
Bryan, one thing I did have to do on the Linux side was to set dns_lookup_kdc = true in my krb5.conf file in the libdefaults section. Hope that helps. Greig - Original Message - From: greigw...@comcast.net To: "Bryan Montgomery" , sfr...@snowman.net Cc: "pgsql-general" Sent: Wedne

Re: [GENERAL] Monitoring activities of PostgreSQL

2010-06-16 Thread Dimitri Fontaine
Allan Kamau writes: > How can I monitor the actual DB activities during such times so I may > better understand what the situation truly is. I have seen some users > on this list posting some complex log/outputs, this are the kind of > outputs I would like to capture and view. Where are they? The

Re: [GENERAL] Problem with triggers

2010-06-16 Thread Tom Lane
Adrian von Bidder writes: > On Wednesday 16 June 2010 00.56:14 Adrian Klaver wrote: >> The database is beating you to the validation. > With triggers. A question to the experts: Couldn't this, in theory, be > implememnted within the rules system? No, it's pretty much the same problem. If you'

Re: [GENERAL] hi,i write a function in postgresql source code, how to register this function?

2010-06-16 Thread Raymond O'Donnell
On 16/06/2010 17:42, sunpeng wrote: > hi,i write a function in postgresql source code, how to register this > function? > it is not an aggregate function. > i don't use 34.3"User-Defined Functions" described in > http://www.postgresql.org/docs/8.4/interactive/xfunc.html, i just write > it in postgr

Re: [GENERAL] consequent PQsendQueryPrepared() failed: another command is already in progress

2010-06-16 Thread Yeb Havinga
Anton Maksimenkov wrote: I'm using libpq C Library. I prepared some query and trying to call it many times. But it success only at first time, and then fail with error: ... "another command is already in progress" You are using the asynchronous queries while the testbed example program does

Re: [GENERAL] GSS Authentication

2010-06-16 Thread greigwise
2008 - Original Message - From: "Stephen Frost" To: greigw...@comcast.net Cc: "Bryan Montgomery" , "pgsql-general" Sent: Wednesday, June 16, 2010 11:32:05 AM GMT -05:00 US/Canada Eastern Subject: Re: [GENERAL] GSS Authentication * greigw...@comcast.net (greigw...@comcast.net) wr

Re: [GENERAL] GSS Authentication

2010-06-16 Thread greigwise
One interesting thing I just came across. I had another user try to connect to my DB using the GSS authentication and it failed. I checked everything out on the client side and it seemed to be OK, so I was puzzled. So then I had another user try and it worked just fine for him. That's weird, rig

Re: [GENERAL] GSS Authentication

2010-06-16 Thread greigwise
OK. So, to get it to use a different encryption type, I'm thinking I'd have to specify that when I create the keytab (and then uncheck the Use DES option on the account setup in Windows). So, when I created my keytab, I used a command like this on the AD side: ktpass -princ POSTGRES/host.domai

Re: [GENERAL] GSS Authentication

2010-06-16 Thread Stephen Frost
* greigw...@comcast.net (greigw...@comcast.net) wrote: > So for the -crypto option, what would be your recommendation for what I > should use and would this require changes on the DB server side? What OS are you running on your AD..? 2003? 2008? Stephen signature.asc Description: Di

Re: [GENERAL] hi,i write a function in postgresql source code, how to register this function?

2010-06-16 Thread sunpeng
It's just in postgresql 8.4 source code,e.g in /backend/executor/functions.c, not in sql,not in pl/pgsql 2010/6/16 Raymond O'Donnell > On 16/06/2010 17:42, sunpeng wrote: > > hi,i write a function in postgresql source code, how to register this > > function? > > it is not an aggregate function.

Re: [GENERAL] GSS Authentication

2010-06-16 Thread greigwise
OMG!!! I finally got it working. Problem was that on the windows side on the service account within the account options, we needed to check "Use DES encryption types for this account". I had that changed on the AD side and that fixed the whole problem. Bryan, if you're still trying to get th

Re: [GENERAL] IMMUTABLE columns in tables?

2010-06-16 Thread Joshua Tolley
On Tue, Jun 15, 2010 at 11:54:47AM -0400, Chris Browne wrote: > I'd like that feature, and I don't think it takes too much arguing to > get to the point that a declarative "IMMUTABLE" control is rather less > opaque than someone saying "oh, you could just create a trigger > running PL/LOLCODE to do

Re: [GENERAL] GSS Authentication

2010-06-16 Thread Stephen Frost
* greigw...@comcast.net (greigw...@comcast.net) wrote: > 2008 I'd expect AES256-SHA1 to work then. Thanks, Stephen signature.asc Description: Digital signature

[GENERAL] Misunderstanding transactions and locks

2010-06-16 Thread Michael P. Soulier
Hi, I'm using Django with Postgres 8.3.9 on CentOS Linux. I'm trying to figure out why locking isn't working as I'm expecting. I have a an operation wrapped in a transaction where I explicitely grab an exclusive lock on my table. When another process concurrently runs to do the same, it should bl

[GENERAL] libpython - cannot open shared object file

2010-06-16 Thread Tom Wilcox
Hi, I have got PostgreSQL 8.4 up and running on my Ubuntu Server 64-bit OS, but I am having difficulty with the PL/Python functions from my database. In particular, I am running this: --- drop language plpythonu cascade; create language plpython

Re: [GENERAL] Misunderstanding transactions and locks

2010-06-16 Thread Scott Marlowe
On Wed, Jun 16, 2010 at 10:21 AM, Michael P. Soulier wrote: > Hi, > > I'm using Django with Postgres 8.3.9 on CentOS Linux. > > I'm trying to figure out why locking isn't working as I'm expecting. I have a > an operation wrapped in a transaction where I explicitely grab an exclusive > lock on my t

[GENERAL] Dynamic triggers

2010-06-16 Thread Rob Richardson
Sid posted a link to a Wiki example of a dynamic trigger: http://wiki.postgresql.org/wiki/PL/pgSQL_Dynamic_Triggers . The link shows a trigger, but it doesn't say anything about what its purpose is or what a dynamic trigger is supposed to

[GENERAL] Working with pages of data (LIMIT/OFFSET keyword)

2010-06-16 Thread Mike Christensen
I'm generating a query on the fly to return a set of data, however I only want to display 30 rows at a time to the user. For this reason, I use the LIMIT 30 OFFSET x clause on the select statement. However, I also want to know the total rows that match this query had there been no limit, that way

Re: [GENERAL] Working with pages of data (LIMIT/OFFSET keyword)

2010-06-16 Thread Szymon Guz
2010/6/16 Mike Christensen > I'm generating a query on the fly to return a set of data, however I > only want to display 30 rows at a time to the user. For this reason, > I use the LIMIT 30 OFFSET x clause on the select statement. However, > I also want to know the total rows that match this qu

Re: [GENERAL] hi,i write a function in postgresql source code, how to register this function?

2010-06-16 Thread Adrian von Bidder
Hi, On Wednesday 16 June 2010 18.42:25 sunpeng wrote: > hi,i write a function in postgresql source code, how to register this > function? > it is not an aggregate function. > i don't use 34.3"User-Defined Functions" described in > http://www.postgresql.org/docs/8.4/interactive/xfunc.html, i just w

Re: [GENERAL] Misunderstanding transactions and locks

2010-06-16 Thread Alvaro Herrera
Excerpts from Michael P. Soulier's message of mié jun 16 12:21:16 -0400 2010: > Hi, > > I'm using Django with Postgres 8.3.9 on CentOS Linux. > > I'm trying to figure out why locking isn't working as I'm expecting. I have a > an operation wrapped in a transaction where I explicitely grab an exclu

Re: [GENERAL] Misunderstanding transactions and locks

2010-06-16 Thread Tom Lane
Alvaro Herrera writes: > Excerpts from Michael P. Soulier's message of mié jun 16 12:21:16 -0400 2010: >> I'm trying to figure out why locking isn't working as I'm expecting. I have a >> an operation wrapped in a transaction where I explicitely grab an exclusive >> lock on my table. When another

Re: [GENERAL] consequent PQsendQueryPrepared() failed: another command is already in progress

2010-06-16 Thread Jeff Davis
On Wed, 2010-06-16 at 10:26 +0600, Anton Maksimenkov wrote: > if ((res = PQgetResult(conn)) == NULL) { > fprintf(stderr, "PQgetResult() res == NULL"); > PQfinish(conn); > return -1; > } > if (PQresultStatus(res) != PGRES_TUPLES_OK) { >

Re: [GENERAL] Dynamic triggers

2010-06-16 Thread Adrian Klaver
On Wednesday 16 June 2010 5:29:39 am Rob Richardson wrote: > Sid posted a link to a Wiki example of a dynamic trigger: > http://wiki.postgresql.org/wiki/PL/pgSQL_Dynamic_Triggers > . The link > shows a trigger, but it doesn't say anything

[GENERAL] postgres crash SOS

2010-06-16 Thread Felde Norbert
Hi all, I use 8.2 on a windows server 2008. Suddenly postgres crashed and I can not do anything. The message is Could not access status of transaction 3982736. DATAIL: Could not read from file "pg_clog/0003" at offset 204800: No error. The only one thing I found to correct this is to create a fil

Re: [GENERAL] postgres crash SOS

2010-06-16 Thread Scott Marlowe
On Wed, Jun 16, 2010 at 5:55 PM, Felde Norbert wrote: > Hi all, > > I use 8.2 on a windows server 2008. > Suddenly postgres crashed and I can not do anything. The message is > Could not access status of transaction 3982736. > DATAIL: Could not read from file "pg_clog/0003" at offset 204800: No err

Re: [GENERAL] GSS Authentication

2010-06-16 Thread Bryan Montgomery
Yeah, the interesting thing is we're supposed to move to AES, but on the current AD it isn't available :) Will be a bit ironic if it is all down to using DES! On Wed, Jun 16, 2010 at 11:05 AM, Stephen Frost wrote: > Greig, > > * greigw...@comcast.net (greigw...@comcast.net) wrote: > > I finally

[GENERAL] Question about indexes on tables with inherited children

2010-06-16 Thread Bryan Montgomery
Hello, A quick question (I think). If I have Table_A with id integer, val text - and no data. Table_B inherits from Table_A and has a bunch of data. Table_C inherits from Table_A and has some data. Table_X has id integer, someValue integer If I do select * from Table_A a, Table_X x where a.id = x.

Re: [GENERAL] postgres crash SOS

2010-06-16 Thread Merlin Moncure
On Wed, Jun 16, 2010 at 7:55 PM, Felde Norbert wrote: > Hi all, > > I use 8.2 on a windows server 2008. > Suddenly postgres crashed and I can not do anything. The message is > Could not access status of transaction 3982736. > DATAIL: Could not read from file "pg_clog/0003" at offset 204800: No err

[GENERAL] world meaningful date time input

2010-06-16 Thread Dennis Gearon
I've got an application brewing that gathers the following data: location (lat/lon) time (no time zone) date. (no time zone) The eventual goal is to be able to search chronologically using timestamps for the data anywhere in the world, from any location, using local time as a reference fo

[GENERAL] oid data types mapping in libpq functions

2010-06-16 Thread zhong ming wu
Dear List Where can I find this mapping of oid to pg data types mentioned in libpq documentation? Why is such information not mentioned in the documentation? A general knowledge? Thanks Mr Wi -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscri

Re: [GENERAL] world meaningful date time input

2010-06-16 Thread Scott Marlowe
On Wed, Jun 16, 2010 at 8:25 PM, Dennis Gearon wrote: > > I've got an application brewing that gathers the following data: >  location (lat/lon) >  time (no time zone) >  date. (no time zone) > > The eventual goal is to be able to search chronologically using timestamps > for the data anywhere in

Re: [GENERAL] GSS Authentication

2010-06-16 Thread Bryan Montgomery
I'm not in front of a linux machine, but does kinit -kt postgres.keytab -S POSTGRES/host.domain.com grant a ticket without asking for the password? On Tue, Jun 15, 2010 at 2:38 PM, wrote: > > As suggested below, I just tried this: > > kinit -S POSTGRES/host.domain.com user > > (where user is my

Re: [GENERAL] consequent PQsendQueryPrepared() failed: another command is already in progress

2010-06-16 Thread Anton Maksimenkov
2010/6/16 Tom Lane : >> But it success only at first time, and then fail with error: >> ... "another command is already in progress" >> [ PQsendQuery followed by just one PQgetResult ] > > IIRC, you need to keep calling PQgetResult until it returns NULL > before the connection is considered cleared

Re: [GENERAL] world meaningful date time input

2010-06-16 Thread Dennis Gearon
Thanks Scott That's basically what I'm planning on doing, and hopefully described. The server will only in 1-10 locations around the world, and I can't use the timezone of the servers anyway, nor the user's input device/browser/phone. The offset/timezone has to be the one for the geographical l

[GENERAL] Given N, finding the interval of N hours with max(sum(..))

2010-06-16 Thread stefano bonnin
Hi all, I'm trying to make a query that, given N and a date, gives me the interval of N hours with the max(sum(...)). In others words, given the following table: 2010-06-16 00:00:00 | 0 2010-06-16 01:00:00 | 2 2010-06-16 02:00:00 | 1 2010-06-16 03:00:00 | 5 2010-06-16 04:00:00 | 7 2010-06-16 05:00