[GENERAL] Trigger on transaction?

2007-04-13 Thread sixtus
Hello all, I've been enjoying programming postgres for a while, but I am stuck with a problem neither the excellent documentation nor the search on this mailing list provides with a solution. It's been asked before, I too would like to have a trigger on transaction! Use cases: - I want to ver

[GENERAL] indexing array columns

2007-04-13 Thread Rajarshi Guha
Hi, I have a table of about 10M rows. It has two columns A and B, where A is a text field and B is a real[12] field. Now when this table is queried it is usually of the form: select A from theTable where sim(B, C) > 0.8 Now C will be a 12-element array specified by the user and the value 0.8 can

Re: [GENERAL] question

2007-04-13 Thread Andrej Ricnik-Bay
On 4/13/07, Terry Martin <[EMAIL PROTECTED]> wrote: I would like to know if I there is a utility to take a UDP packet which has specific information in the payload and extract the information from the packet and place it in the Postgres data base? Which OS (in Linux ulogd and/or tcpdump spring t

Re: [GENERAL] Temporary table in pl/pgsql

2007-04-13 Thread Raymond O'Donnell
On 13/04/2007 21:55, Merlin Moncure wrote: in addition to the 'create table' stmt, all queries that touch the table must also be dynamic. postgresql 8.3 will have improved plan invalidation which will (aiui) remove this requirement. Thanks for that - just tried it and it worked. Ray. -

Re: [GENERAL] Temporary table in pl/pgsql

2007-04-13 Thread Listmail
OK, suppose in his function : - if it does not exist, he creates the temp table, with ON COMMIT DELETE ROWS - if it does exists, he truncates it just to be sure So the next execution of the function will find the temp table, it will have the same OID, all is well.

Re: [GENERAL] Temporary table in pl/pgsql

2007-04-13 Thread Merlin Moncure
On 4/13/07, Raymond O'Donnell <[EMAIL PROTECTED]> wrote: Hello again all, I'm using a temporary table in a pl/PgSQL function, and I've read the bit in the FAQ about using EXECUTE to force the table-creation query to be re-evaluated each time the function is called. However, it doesn't seem to w

Re: [GENERAL] meaning of Total runtime

2007-04-13 Thread Joshua D. Drake
jungmin shin wrote: Could you somebody explain to me what is the meaning of Total runtime which is generated by explain analyze command? It is the time it took the query to execute. Thanks, Jungmin -- Jungmin Shin -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Sup

[GENERAL] Temporary table in pl/pgsql

2007-04-13 Thread Raymond O'Donnell
Hello again all, I'm using a temporary table in a pl/PgSQL function, and I've read the bit in the FAQ about using EXECUTE to force the table-creation query to be re-evaluated each time the function is called. However, it doesn't seem to work for me. The first time I call the function, all is

[GENERAL] meaning of Total runtime

2007-04-13 Thread jungmin shin
Could you somebody explain to me what is the meaning of Total runtime which is generated by explain analyze command? Thanks, Jungmin -- Jungmin Shin

Re: [GENERAL] OT: schema-sketching software

2007-04-13 Thread Jon Sime
Kynn Jones wrote: > Hi. I'm looking for Pg- and OSX-friendly software for generating schema > diagrams. It its most basic level, I'm looking for the graphics > counterpart of pg_dump -s, although it would be nice if the program > could take as input the name of a file containing an arbitrary sche

Re: [GENERAL] Update a Value From TEdit

2007-04-13 Thread Arthur Hoogervorst
Hi: What's the point of declaring the TEdit locally? Use a string instead. Additionally, in Delphi [and any other OOP language) if you want to use objects, you instantiate them first, as in Edit1 := TEdit.Create(nil); Regards, Arthur On 4/13/07, Bob Pawley <[EMAIL PROTECTED]> wrote: I

Re: [GENERAL] Update a Value From TEdit

2007-04-13 Thread Raymond O'Donnell
On 13/04/2007 19:25, Raymond O'Donnell wrote: PSQLQuery1.SQL.Add ('Where P_ID.Loops.Loop_Name = :Loop_Name'); PSQLQuery1.ParamByName('LoopNumberEdit').Value := Edit1.Text; I meant to say also that the parameter name you're passing to the ParamByName() function isn't the same as the one you've

Re: [GENERAL] Update a Value From TEdit

2007-04-13 Thread Raymond O'Donnell
On 13/04/2007 19:05, Bob Pawley wrote: I am attempting to update a table using a value that is displayed on a TEdit component. I am getting an access violation error. Hi Bob, An access violation error means that some part of your code is trying to access memory that it shouldn't. It most like

[GENERAL] OT: schema-sketching software

2007-04-13 Thread Kynn Jones
Hi. I'm looking for Pg- and OSX-friendly software for generating schema diagrams. It its most basic level, I'm looking for the graphics counterpart of pg_dump -s, although it would be nice if the program could take as input the name of a file containing an arbitrary schema definition (i.e. not n

[GENERAL] Update a Value From TEdit

2007-04-13 Thread Bob Pawley
I am attempting to update a table using a value that is displayed on a TEdit component. I am getting an access violation error. Can someone tell me what I am doing wrong?? procedure TLoopBuilderForm.NewLoopButtonClick(Sender: TObject); var Edit1 : TEdit ; begin PSQLQuery1.Close;{

[GENERAL] Cursor Contents display in pgAdmin - Help.

2007-04-13 Thread steve shiflett
I wish to display the content of a cursor but haven't discovered the trick. Here's what I'm doing: -The function CREATE OR REPLACE FUNCTION tmp.sps(character varying, date) RETURNS refcursor AS $BODY$ DECLARE ref refcursor; BEGIN O

[GENERAL] error creating/setting sequence, pg_dump / pg_restore 8.1.5

2007-04-13 Thread Mason Hale
Hello - After running pg_dump to backup my database, and then running pg_restore to load the db (on a different server), I run into a problem with creating a sequence. After the pg_restore is completed, the sequence is created, but the value is not set correctly. As a result calls nextval for the

Re: [GENERAL] ERROR: XLogFlush: request

2007-04-13 Thread Nitin Verma
> An upgrade from 7.3.x to 7.3.18 is pretty close to painless http://www.postgresql.org/docs/7.3/static/release-7-3-13.html http://www.postgresql.org/docs/7.3/static/release-7-3-10.html Can't do it blindfolded but still it can be categorized as painless :) > 2: Do not upgrade to 8.1.0. It's be

Re: [GENERAL] ERROR: XLogFlush: request

2007-04-13 Thread Scott Marlowe
On Fri, 2007-04-13 at 10:10, Nitin Verma wrote: > Thanx Tom, anyway we are moving to 8.1.0 soon. > > Leaving that moving all our client to newer release will take sometime. I > hope you know how it works in a product. Till that time we need to release a > patch that recovers from this condition. >

Re: [GENERAL] ERROR: XLogFlush: request

2007-04-13 Thread Nitin Verma
> Please read http://www.postgresql.org/support/versioning Quoting part of the document: Upgrading to a minor release does not require a dump and restore; merely stop the database server, install the updated binaries, and restart the server. For some releases, manual changes may be required to co

Re: [GENERAL] ERROR: XLogFlush: request

2007-04-13 Thread Alvaro Herrera
Nitin Verma wrote: > Thanx Tom, anyway we are moving to 8.1.0 soon. > > Leaving that moving all our client to newer release will take sometime. I > hope you know how it works in a product. Till that time we need to release a > patch that recovers from this condition. > > Said that, do we have som

Re: [GENERAL] corr() in 8.1

2007-04-13 Thread Tom Lane
"SunWuKung" <[EMAIL PROTECTED]> writes: > Is there an easy way to have the corr() statistical function in 8.1? Nothing that's likely to be easier than updating to 8.2 ... and given the lack of multiple-input aggregates in 8.1, anything you did would be a serious kluge anyway.

Re: [GENERAL] ERROR: XLogFlush: request

2007-04-13 Thread Nitin Verma
Thanx Tom, anyway we are moving to 8.1.0 soon. Leaving that moving all our client to newer release will take sometime. I hope you know how it works in a product. Till that time we need to release a patch that recovers from this condition. Said that, do we have some advice or workarounds? I saw 8

Re: [GENERAL] Regard to PANIC: unexpected hash relation size

2007-04-13 Thread Tom Lane
Vlastimil Krejcir <[EMAIL PROTECTED]> writes: >I have PostgreSQL running for one and half year without any issues until > yesterday. I get this: >PANIC: unexpected hash relation size: 122, should be 4 > server closed the connection unexpectedly >I have PostgreSQL 8.1.5 on SunOS (5.1

Re: [GENERAL] Is there a shortage of postgresql skilled ops people

2007-04-13 Thread Martin Gainty
Oracle's suggested solution for 'mutating table error' is to create a global temporary table for the parent To avoid inconsistent behaviour with the parent table a AFTER ROW trigger checks new rows and commits rows only to the temporary table then the changes from the temp table are committed to

Re: [GENERAL] ERROR: XLogFlush: request

2007-04-13 Thread Tom Lane
"Nitin Verma" <[EMAIL PROTECTED]> writes: > xlog.c code from version we use (7.3.2) > ... > What all should be done when this happened? Any suggestions. Updating to something newer than 7.3.2 would seem to be a good idea. 7.3.18 is the current release in that branch. regar

Re: [GENERAL] role passwords and md5()

2007-04-13 Thread Ben Trewern
I thought I read this be for I sent it. :-( What I meant to say was: Does the password hash change (and how?) Or is the original username kept somewhere is the system tables? Regards, Ben "Ben Trewern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How does this work when you r

Re: [GENERAL] [ADMIN] Increasing the shared memory

2007-04-13 Thread Tom Lane
"Sorin N. Ciolofan" <[EMAIL PROTECTED]> writes: > I will simplify the things in order to describe when the error occurred: > The input of the application is some data which is read from files on disk, > processed and then inserted in the database in one transaction. This total > quantity of data r

Re: [GENERAL] Is there a shortage of postgresql skilled ops people

2007-04-13 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/09/07 10:50, Erik Jones wrote: > > On Apr 9, 2007, at 9:46 AM, Vivek Khera wrote: [snip] >> One thing that was really counter-intuitive to me from a guy who runs >> really large databases, was to get rid of some of the FK's and manage >> them in

Re: [GENERAL] Is there a shortage of postgresql skilled ops people

2007-04-13 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/09/07 14:05, Bill Moran wrote: > In response to Alexander Staubo <[EMAIL PROTECTED]>: > >> On Apr 9, 2007, at 18:10 , Gerard Seibert wrote: >> >>> On Mon, 9 Apr 2007 10:34:22 -0500 >>> Erik Jones <[EMAIL PROTECTED]> wrote: >>> Hmmm... I di

Re: [GENERAL] role passwords and md5()

2007-04-13 Thread Ben Trewern
How does this work when you rename a role? Does the is the password hash changed (and how?) or is the original username kept somewhere in the system tables? Regards, Ben "Andrew Kroeger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Lutz Broedel wrote: >> Dear list, >> >> I a

Re: [GENERAL] Evaluate only one CASE WHEN in a select

2007-04-13 Thread dcrespo
On Apr 12, 4:30 pm, [EMAIL PROTECTED] (Tom Lane) wrote: > "dcrespo" <[EMAIL PROTECTED]> writes: > > They are exactly the same, that's why I want to evaluate it only once > > and, depending on it, put the corresponding value into two different > > fields that must be returned, instead of evaluating

Re: [GENERAL] deadlock

2007-04-13 Thread Alexey Nalbat
Tom Lane wrote: > > Your example doesn't deadlock for me ... Scott Marlowe wrote: > > That's not a deadlock, transaction 3 is simply waiting for transaction 1 > to commit or rollback. > > If you run a commit or rollback on transaction 1 then transaction 3 will > then be ready to commit or rollb

[GENERAL] question

2007-04-13 Thread Terry Martin
I would like to know if I there is a utility to take a UDP packet which has specific information in the payload and extract the information from the packet and place it in the Postgres data base? Terry Martin Timedata Corporation VP of Network Operations Work: (212) 644-1600 X3 Cell:

Re: [GENERAL] Providing user based previleges to Postgres DB

2007-04-13 Thread Ben Trewern
Providing user based previleges to Postgres DBSee: http://www.postgresql.org/docs/8.2/interactive/user-manag.html Regards, Ben <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi All, Currently in one of the projects we want to restrict the unauthorized users to the Postgres D

Re: [GENERAL] DTrace and PostgreSQL

2007-04-13 Thread [EMAIL PROTECTED]
On Apr 12, 8:13 pm, "Karen Hill" <[EMAIL PROTECTED]> wrote: > I was wondering if DTrace could tell me how many inserts are being > done in a pl/pgsql function while in a loop for example. As you know > a pl/pgsql function executes in a single transaction so the DTrace > probe "transaction__commit(

Re: [GENERAL] COPY FROM file with zero-delimited fields

2007-04-13 Thread eugene . mindrov
On Apr 11, 7:42 pm, [EMAIL PROTECTED] ("Merlin Moncure") wrote: > On 11 Apr 2007 00:25:50 -0700, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > Hi all, > > I wonder if there's a way to use COPY FROM command when dealing with a > > data file containing records whose fields are delimited with z

Re: [GENERAL] role passwords and md5()

2007-04-13 Thread Ben Trewern
Looks like the password gets cleared when you rename a role. Regards, Ben "Ben Trewern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I thought I read this be for I sent it. :-( > > What I meant to say was: > Does the password hash change (and how?) Or is the original username kep

[GENERAL] corr() in 8.1

2007-04-13 Thread SunWuKung
Is there an easy way to have the corr() statistical function in 8.1? (I know very little about compiling things.) Or does somebody have a custom aggregate function for that? Thanks for the help. SWK ---(end of broadcast)--- TIP 2: Don't 'kill -9' t

[GENERAL] Regard to PANIC: unexpected hash relation size

2007-04-13 Thread Vlastimil Krejcir
Hi, I have the same error as described in the post I have found in the pgsql-general archive, see: http://archives.postgresql.org/pgsql-general/2007-03/msg01664.php I have PostgreSQL running for one and half year without any issues until yesterday. I get this: PANIC: unexpected

Re: [GENERAL] Import data from 8.2.3 into 8.0.8

2007-04-13 Thread Csaba Nagy
Sorry Jiří, that was a hasty answer from my part... > I haven't used Slony by now. Do you have some advices or articles they > may help? I have no ssh access at FreeBSD server box when PostgreSQL > 8.0 server runs - so I hope this is no problem... Slony is quite a heavy beast to install, I'm pret

Re: [GENERAL] deadlock

2007-04-13 Thread Tom Lane
Alexey Nalbat <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Your example doesn't deadlock for me ... > With default value "deadlock_timeout=1000" error raises in first transaction: Then there's a typo in your example --- please recheck it. regards, tom lane --

Re: [GENERAL] Import data from 8.2.3 into 8.0.8

2007-04-13 Thread Csaba Nagy
Jiří, I guess you should be able to do it via slony. Usually one wants to upgrade using slony, but it should work the other way around too :-) Cheers, Csaba. On Fri, 2007-04-13 at 15:09, Jiří Němec wrote: > Hello, > > I need to import PostgreSQL DB from 8.2.3 server 8.0.8 server. Is > there som

[GENERAL] Import data from 8.2.3 into 8.0.8

2007-04-13 Thread Jiří Němec
Hello, I need to import PostgreSQL DB from 8.2.3 server 8.0.8 server. Is there some "compatibility mode"? When I try to import this dump PostgreSQL 8.0.8 reports errors - probably due version incompatibility. Thank you for your advices. -- Jiri Nemec http://www.menea.cz/

Re: [GENERAL] Arrays with Rails?

2007-04-13 Thread Listmail
On Fri, 13 Apr 2007 12:15:30 +0200, Alexander Presber <[EMAIL PROTECTED]> wrote: Listmail schrieb: Then, other languages will make you feel the pain of having to quote all your arguments YOURSELF and provide all results as string. The most famous offender is PHP (this causes countless

Re: [GENERAL] Arrays with Rails?

2007-04-13 Thread Alexander Presber
Listmail schrieb: Then, other languages will make you feel the pain of having to quote all your arguments YOURSELF and provide all results as string. The most famous offender is PHP (this causes countless security holes). I partially did this for PHP. It's a lifesaver. No more addsl

[GENERAL] ERROR: XLogFlush: request

2007-04-13 Thread Nitin Verma
Hi All, xlog.c code from version we use (7.3.2) /* * If we still haven't flushed to the request point then we have a * problem; most likely, the requested flush point is past end of * XLOG. This has been seen to occur when a disk page has a corrupted *

Re: [GENERAL] Arrays with Rails?

2007-04-13 Thread Listmail
On Fri, 13 Apr 2007 10:30:29 +0200, Tino Wildenhain <[EMAIL PROTECTED]> wrote: Joshua D. Drake schrieb: Rick Schumeyer wrote: Has anyone here used a postgres array with Rails? If so, how? split()? Err... there is no type mapping? You know, some languages spoil us developers, so tha

Re: [GENERAL] Arrays with Rails?

2007-04-13 Thread Tino Wildenhain
Joshua D. Drake schrieb: Rick Schumeyer wrote: Has anyone here used a postgres array with Rails? If so, how? split()? Err... there is no type mapping? ---(end of broadcast)--- TIP 4: Have you searched our list archives? http:/

Re: [GENERAL] [ADMIN] Increasing the shared memory

2007-04-13 Thread Sorin N. Ciolofan
I will simplify the things in order to describe when the error occurred: The input of the application is some data which is read from files on disk, processed and then inserted in the database in one transaction. This total quantity of data represents an integer number of data files, n*q, where q