Re: [GENERAL] background triggers?

2006-05-24 Thread Rafal Pietrak
I'd like to propose a 'syntax/semantics' of such trigger: Triggers normally execute inside of a transaction. A COMMIT within a trigger could mean: "do a fork: fork-1) return to the main and schedule COMMIT there, fork-2) continue in bacground". >From the perspective of my earlier applications,

Re: [GENERAL] background triggers?

2006-05-24 Thread Thomas Hallgren
Sim Zacks wrote: If the database supported background triggers, it might be implemented by a daemon or by the Listen/Notify framework, but I really couldn't care less. It is part of the database. > Assume the backend would handle this, what would the transaction semantics look like? You can't

Re: [GENERAL] 8.1 on gentoo

2006-05-24 Thread Richard Broersma Jr
I wouldn't expect a version marked stable will be out any time soon. http://packages.gentoo.org/search/?sstring=postgresql I haven't ckeck whether this version is avaliable as a masked ebuild. Regards, Richard Broersma Jr. --- Sim Zacks <[EMAIL PROTECTED]> wrote: > Does anybody know when postg

[GENERAL] 8.1 on gentoo

2006-05-24 Thread Sim Zacks
Does anybody know when postgresql 8.1 will be considered stable on gentoo for x86? Another question would be does anybody know of any instability of postgresql 8.1 unstable for gentoo x86? Does anybody have it working in a production environment? ---(end of broadcast)---

Re: [GENERAL] background triggers?

2006-05-24 Thread Sim Zacks
The question is not how it is implemented, the question is what does the end user have to do to accomplish his requirements. If I have to write my own daemon, then I have to debug it and maintain it, write a script so it automatically turns on when the machine is rebooted. If I have multiple en

Re: [GENERAL] I dont get it,

2006-05-24 Thread Michael Ben-Nes
Tom Lane wrote: Michael Ben-Nes <[EMAIL PROTECTED]> writes: pg_dump -Fc sourcedb > sourcedb-Fc.dump pg_dump -a sourcedb > sourcedb.dump createdb test pg_restore -c -s -d test sourcedb-Fc.dump psql test < sourcedb.dump Is there a particularly good reason for doing it that way? Yep,

Re: [GENERAL] New DBs from existing schemas

2006-05-24 Thread Chris
Nishad Prakash wrote: I want to create a new database with the exact schema of an existing one, but a different name. After some reading, it seems pg_dump -s old_db > old_schema That will dump all schemas from that db. If you only want a particular schema, use '-n'. createdb -t old_schema

Re: [GENERAL] How to estimate disk space

2006-05-24 Thread Chris Velevitch
On 5/24/06, Richard Huxton wrote: http://www.postgresql.org/docs/8.1/static/storage.html Sorry, I forgot to mention, it's for 7.4. There doesn't seem to be the equivalent page or subject in the 7.4 documentation. In addition, the explaination is a high level description of table or index page

Re: [GENERAL] 8.1.4: Who says "PHP deprecated addslashes since 4.0"?

2006-05-24 Thread Tom Lane
ljb <[EMAIL PROTECTED]> writes: > | addslashes() or magic_quotes. We note that these tools have been deprecated > | by the PHP group since version 4.0. > Can anyone provide a source for the statement? I'm not going to put words in Josh's mouth about where he got that from, but anyone who reads

Re: [GENERAL] recompliing c-language functions with new releases of postgres

2006-05-24 Thread Tom Lane
"TJ O'Donnell" <[EMAIL PROTECTED]> writes: > I understand and appreciate bug fixes, but isn't one of the purposes of > major releases to provide some stability (say of API) within > the major release? Our traditional definition of API stability within a release series has considered only the SQL l

Re: [GENERAL] recompliing c-language functions with new releases of postgres

2006-05-24 Thread TJ O'Donnell
"TJ O'Donnell" <[EMAIL PROTECTED]> writes: Presumably, the only reason I would HAVE TO recompile is when some header file changes. Is there any guarantee that header files DO NOT change, for example from 7.4.5 to 7.4.8 or even 7.4.12? Can I assume that header file changes only occur between

[GENERAL] 8.1.4: Who says "PHP deprecated addslashes since 4.0"?

2006-05-24 Thread ljb
The PostgreSQL-8.1.4 release documentation says we should be using PostgreSQL-supplied string escaping routines, not "homebrew" methods. No argument from me on this. But in the "User Guide to the 8.1.4 Security Update", it says: | An example of an application at risk is a PHP program that uses |

RES: [GENERAL] PK with an expression in field list

2006-05-24 Thread Alejandro Michelin Salomon \( Adinet \)
Hi : I will create a unique index, and make this fiels not null. Thanks for the reply. Alejandro Michelin Salomon -->-Mensagem original- -->De: Tom Lane [mailto:[EMAIL PROTECTED] -->Enviada em: quarta-feira, 24 de maio de 2006 16:45 -->Para: Alejandro Michelin Salomon ( Adinet ) -->Cc:

Re: [GENERAL] compiling source code!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2006-05-24 Thread Dann Corbit
Using MINGW  (All operations assume that you are using the bash shell and have your environment set up for GCC, make, etc): Go to the PostgreSQL source root directory (wherever you put it) via cd Execute : ./configure Execute : make Execute : make install You are

[GENERAL] New DBs from existing schemas

2006-05-24 Thread Nishad Prakash
I want to create a new database with the exact schema of an existing one, but a different name. After some reading, it seems pg_dump -s old_db > old_schema createdb -t old_schema new_db should work. Will it? Note that old_db has lots of stored functions and user-defined operators in addition

Re: [GENERAL] recompliing c-language functions with new releases of postgres

2006-05-24 Thread Tom Lane
"TJ O'Donnell" <[EMAIL PROTECTED]> writes: > Presumably, the only reason I would HAVE TO recompile > is when some header file changes. Is there any guarantee > that header files DO NOT change, for example from > 7.4.5 to 7.4.8 or even 7.4.12? Can I assume that header > file changes only occur bet

[GENERAL] recompliing c-language functions with new releases of postgres

2006-05-24 Thread TJ O'Donnell
I have several c-language extensions to postgres that I distribute. I generally have to recompile my code with a new release of postgres, although sometimes it appears that it functions properly (passes my tests at least) without a recompile. Since my users are all on various releases of postgre

Re: [GENERAL] column order

2006-05-24 Thread Michael Glaesemann
On May 24, 2006, at 22:36 , Florian G. Pflug wrote: Michael Glaesemann wrote: On May 24, 2006, at 11:54 , nuno wrote: does postgresql guarantee you that the columns in the result set would be ordered as specified in the query (i.e. id, firstname, lastname, dob) ? No. If you want a specific o

Re: [GENERAL] JDBC issue

2006-05-24 Thread Joel Alejandro Espinosa Carra
Kris Jurka wrote: On Tue, 23 May 2006, Joel Alejandro Espinosa Carra wrote: I searched at google and did not find any answer. I have an older JDCB driver in my java web application, if I update the driver to the 7.4 build 216 version some of the querys like the next show no results in the

[GENERAL] psql \echo strangeness with :variables

2006-05-24 Thread Jerry Sievers
ample below; [EMAIL PROTECTED] = \set date `date '+%Y%m%d'` [EMAIL PROTECTED] = \echo :date 20060524 [EMAIL PROTECTED] = \echo foo_:date foo_:date <-- Was expecting this to expand... see below [EMAIL PROTECTED] = create table foo_:date(); CREATE TABLE [EMAIL PROTECTED] = \dt

Re: [GENERAL] I dont get it, dump / restore failures to the same cluster.

2006-05-24 Thread Tom Lane
Michael Ben-Nes <[EMAIL PROTECTED]> writes: > pg_dump -Fc sourcedb > sourcedb-Fc.dump > pg_dump -a sourcedb > sourcedb.dump > createdb test > pg_restore -c -s -d test sourcedb-Fc.dump > psql test < sourcedb.dump Is there a particularly good reason for doing it that way? > I got few errors ( here

Re: [GENERAL] Incomplete dump?

2006-05-24 Thread Tom Lane
=?ISO-8859-1?Q?Benno_P=FCtz?= <[EMAIL PROTECTED]> writes: > When trying to dump a database for upgrading to the current PSQL version > using pg_dump I observed the following: Which version of pg_dump were you using, exactly? > The process seems to have finished without problems, but the resultin

Re: [GENERAL] Error I don't understand, losing synch with server

2006-05-24 Thread Scott Ribe
>> Every once in a while I log this error executing a query: >> message contents do not agree with length in message type "D" >> lost synchronization with server: got message type "O", length 1398030676 > > This means either that libpq got a corrupt message from the server, or > that libpq itself

[GENERAL] Binary Packages

2006-05-24 Thread Leonel Nunez
Hello : the PostgreSQL binary packages for redhat on http://www.postgresql.org/ftp/binary/v8.1.4/linux/rpms/redhat has the jdbc python perl modules are those divers safe from the sql injection ? according tohttp://www.postgresql.org/docs/techdocs.49 says : " In addition to Post

[GENERAL] I dont get it, dump / restore failures to the same cluster.

2006-05-24 Thread Michael Ben-Nes
Hello I did on the same server / cluster ( 8.0.1 / ISO-8859-8 ) pg_dump -Fc sourcedb > sourcedb-Fc.dump pg_dump -a sourcedb > sourcedb.dump createdb test pg_restore -c -s -d test sourcedb-Fc.dump psql test < sourcedb.dump I got few errors ( here are some of them ): ERROR: insert or

Re: [GENERAL] PK with an expression in field list

2006-05-24 Thread Tom Lane
"Alejandro Michelin Salomon \( Adinet \)" <[EMAIL PROTECTED]> writes: > I need create a PK for a table. > This PK has 3 fields. > PK is : CONSTRAINT ff_navios PRIMARY KEY ( idempresa, idarmador, UPPER( nome > ) ) > But seems not work. You can't define a primary key on an expression. The SQL stand

Re: [GENERAL] meaning of PQresultStatus types

2006-05-24 Thread Tom Lane
[EMAIL PROTECTED] writes: > My question is, what constitutes a PGRES_FATAL_ERROR or a > PGRES_BAD_RESPONSE? FATAL is probably a bad choice of words here; it basically means any error condition reported by the server that caused execution of your query to be abandoned. NONFATAL_ERROR actually mean

Re: [GENERAL] Clearing out old idle connections

2006-05-24 Thread Scott Marlowe
On Wed, 2006-05-24 at 14:00, Tom Lane wrote: > "Florian G. Pflug" <[EMAIL PROTECTED]> writes: > > You can (at least on linux, I assume it's the same for BSD) set the > > "keepalive" flag of a connection. This results in empty packets being > > sent every 30 seconds or so, and the connection is rep

Re: [GENERAL] Clearing out old idle connections

2006-05-24 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > You can (at least on linux, I assume it's the same for BSD) set the > "keepalive" flag of a connection. This results in empty packets being > sent every 30 seconds or so, and the connection is reported to be dead > if no ACK is received within a tim

Re: [GENERAL] challenging constraint situation - how do I make it

2006-05-24 Thread Tom Lane
Alban Hertroys <[EMAIL PROTECTED]> writes: > Are you refering to a 'timespan' data type that can be determined to be > unique? > I can see some problems there, as both value and range matter; it'd be > similar to determining the uniqueness of an area in a rectangle (though > 1 dimensional only,

Re: [GENERAL] [SQL] (Ab)Using schemas and inheritance

2006-05-24 Thread Jorge Godoy
Em Quarta 24 Maio 2006 14:48, Richard Broersma Jr escreveu: > > From what I've read I am not sure that an Index created on the base/parent > table will help when preforming select queries on data across all of the > children. If I interpret the "Caveats" correctly I would assume that the > index w

Re: [GENERAL] [SQL] (Ab)Using schemas and inheritance

2006-05-24 Thread Richard Broersma Jr
> If I SELECT from the schema it will only retrieve data from the schema. If I > select from the parent table then I'll have all data available -- and for the > parent table I might need some date index. >From what I've read I am not sure that an Index created on the base/parent >table will he

Re: [GENERAL] PK with an expression in field list

2006-05-24 Thread Tino Wildenhain
Alejandro Michelin Salomon ( Adinet ) wrote: > Hi: > > I need create a PK for a table. > This PK has 3 fields. > PK is : CONSTRAINT ff_navios PRIMARY KEY ( idempresa, idarmador, UPPER( > nome ) ) > But seems not work. This is a useless error report ;) You need to provide the error message you ge

Re: [GENERAL] [SQL] (Ab)Using schemas and inheritance

2006-05-24 Thread Jorge Godoy
Em Quarta 24 Maio 2006 13:06, Alban Hertroys escreveu: > Jorge Godoy wrote: > > > > But this could be easily done with two commands (besides creating indices > > again): > > > > ALTER TABLE x RENAME TO x_year; > > CREATE TABLE x () INHERITS FROM base.x; > > > > No need to change the rest... > > CRE

Re: [GENERAL] background triggers?

2006-05-24 Thread Rafal Pietrak
On Wed, 2006-05-24 at 09:46 -0400, Christopher Browne wrote: > The world rejoiced as [EMAIL PROTECTED] (Rafal Pietrak) wrote: > > My impression was, that I get the next prompt after the procedure > > finishes, so it wouldn't be a solution. But if (2) applies, that is > > really it Frankly, it w

Re: [GENERAL] [SQL] (Ab)Using schemas and inheritance

2006-05-24 Thread Alban Hertroys
Jorge Godoy wrote: Em Quarta 24 Maio 2006 11:48, Alban Hertroys escreveu: Jorge Godoy wrote: Some things are really important here: - performance for operations on an individual company --- it has to be as fast as possible because this might be used by my client's clients.

Re: [GENERAL] Best practice to grant all privileges on all bjects in database?

2006-05-24 Thread Bruno Wolff III
On Mon, May 22, 2006 at 12:59:06 +0300, Joe Kramer <[EMAIL PROTECTED]> wrote: > On a related note, which objects need to be GRANTed specifically? > There is a saying that following objects can have permissions GRANTed: > 1. TABLE > 2. DATABASE > 3. FUNCTION > 4. LANGUAGE > 5. SCHEMA > 6. TABLESPA

Re: [GENERAL] [SQL] (Ab)Using schemas and inheritance

2006-05-24 Thread Jorge Godoy
Em Quarta 24 Maio 2006 11:48, Alban Hertroys escreveu: > Jorge Godoy wrote: > > Some things are really important here: > > > > - performance for operations on an individual company --- it has to be > > as fast as possible because this might be used by my client's clients. > > I suppose in

Re: [GENERAL] challenging constraint situation - how do I make it

2006-05-24 Thread Alban Hertroys
Kenneth Downs wrote: Alban Hertroys wrote: The approach I tried was to have a "range" or "interval" type. You place a column into a table named "resv_date" or whatever and it would expand the definition into two columns, you'd get resv_date_beg and resv_date_end. If you declared the "resv_da

Re: [GENERAL] background triggers?

2006-05-24 Thread Rafal Pietrak
On Wed, 2006-05-24 at 08:38 -0400, Kenneth Downs wrote: > > > What web server and OS are you using? In linux/apache you can fork > off a process that runs the SP and then detach from it. Actually it is linux/apache. Yes, I could do it that way, but eventually I've sattled for a cron job that

[GENERAL] PK with an expression in field list

2006-05-24 Thread Alejandro Michelin Salomon \( Adinet \)
Title: Mensagem Hi:   I need create a PK for a table. This PK has 3 fields. PK is : CONSTRAINT ff_navios PRIMARY KEY ( idempresa, idarmador, UPPER( nome ) ) But seems not work.   I have and other way to do this ?   If this fields are not null and i create a unique index in place off pk,

Re: [GENERAL] challenging constraint situation - how do I make it

2006-05-24 Thread Alban Hertroys
Florian G. Pflug wrote: You could define a new datatype containing two timestamps. From 8.1 onwards you can use such a composite type as a field, I believe (but I haven't checked it). You can use pgsql functions to define operators for your type - but you'll have to use the default input/outp

Re: [GENERAL] [SQL] (Ab)Using schemas and inheritance

2006-05-24 Thread Alban Hertroys
Jorge Godoy wrote: Em Quarta 24 Maio 2006 06:09, Alban Hertroys escreveu: What about using updatable views instead of inheritence? You'd need your company_id back, but adding new companies or modifying table definitions could be a lot easier (as long as you don't need to update all of your view

Re: [GENERAL] background triggers?

2006-05-24 Thread Chris Browne
Sim Zacks <[EMAIL PROTECTED]> writes: > The reason why the client application would have to wait is because > the front-end is written in MSAccess. While Windows supports multi > threading, Access does not support multi threading. > (Multi threading allows background processing, IYDK) Well, you *c

Re: [GENERAL] background triggers?

2006-05-24 Thread Sim Zacks
The problem with Listen/Notify is that you have to create another client application that is not managed in the central database as a daemon to call a function. If the server supported background triggers, then you wouldn't need an extra client application to use the listen/notify framework, yo

Re: [GENERAL] background triggers?

2006-05-24 Thread Christopher Browne
The world rejoiced as [EMAIL PROTECTED] (Rafal Pietrak) wrote: > On Wed, 2006-05-24 at 07:41 -0400, Kenneth Downs wrote: >> > >> Why not have the INSERT go to an "inbox" table, a table whose only job >> is to receive the data for future processing. > > Actually, it 'sort of' works that way. > >> Y

[GENERAL] Incomplete dump?

2006-05-24 Thread Benno Pütz
When trying to dump a database for upgrading to the current PSQL version using pg_dump I observed the following: The process seems to have finished without problems, but the resulting dump file does not end in -- -- PostgreSQL database dump complete -- but rather with a command line (complet

Re: [GENERAL] background triggers?

2006-05-24 Thread Sim Zacks
The reason why the client application would have to wait is because the front-end is written in MSAccess. While Windows supports multi threading, Access does not support multi threading. (Multi threading allows background processing, IYDK) Kenneth Downs wrote: Sim Zacks wrote: The problem wit

Re: [GENERAL] challenging constraint situation - how do I make it

2006-05-24 Thread Florian G. Pflug
Kenneth Downs wrote: Alban Hertroys wrote: Kenneth Downs wrote: Alban Hertroys wrote: When encountering this problem I usually wonder why there isn't a data type that can store a timestamp and can be used to create a UNIQUE INDEX over it's values. That'd be wonderful. Well, maybe one day

Re: [GENERAL] background triggers?

2006-05-24 Thread Kenneth Downs
Sim Zacks wrote: The problem with client code processing a function is that unless you are using threads (my client application is not in a multi-threaded environment), the client has to wait for the server to return from the end of the function. I don't want the client to wait and the result

Re: [GENERAL] Clearing out old idle connections

2006-05-24 Thread Florian G. Pflug
Richard Huxton wrote: Gavin Hamill wrote: Hullo :) We have pg 8.1.3 and for whatever reason (network blips, poor pooling on behalf of the client, etc.) we sometimes see a large number (dozens) of old connections in the idle state which never get reused. They should expire based on your TCP

Re: [GENERAL] column order

2006-05-24 Thread Florian G. Pflug
Michael Glaesemann wrote: On May 24, 2006, at 11:54 , nuno wrote: does postgresql guarantee you that the columns in the result set would be ordered as specified in the query (i.e. id, firstname, lastname, dob) ? No. If you want a specific order, use the ORDER BY clause. I think the OP was t

Re: [GENERAL] column order

2006-05-24 Thread A. Kretschmer
am 24.05.2006, um 21:54:25 +0900 mailte Michael Glaesemann folgendes: > > On May 24, 2006, at 11:54 , nuno wrote: > > >does postgresql guarantee you that > >the columns in the result set would be ordered > >as specified in the query (i.e. id, firstname, lastname, dob) ? > > No. If you want a sp

Re: [GENERAL] challenging constraint situation - how do I make it real in SQL?

2006-05-24 Thread John D. Burger
I have a business rule which gives me rahter big challenges to "melt in SQL": At one "point in time" only one version may be active. I have no specific solution, but I highly recommend Richard Snodgrass's book, Developing Time-Oriented Database Applications in SQL, which discusses this kind

Re: [GENERAL] [SQL] (Ab)Using schemas and inheritance

2006-05-24 Thread Jorge Godoy
Em Quarta 24 Maio 2006 06:09, Alban Hertroys escreveu: > > What about using updatable views instead of inheritence? You'd need your > company_id back, but adding new companies or modifying table definitions > could be a lot easier (as long as you don't need to update all of your > views...). Hi Al

Re: [GENERAL] meaning of PQresultStatus types

2006-05-24 Thread Volkan YAZICI
On May 23 11:30, [EMAIL PROTECTED] wrote: > I'm currently trying to understand how to deal with the return values > of PGresultStatus in terms of error handling in my application. The > postgres manual describes the return codes of PGresultStatus as: > > PGRES_EMPTY_QUERY: The string sent to the

Re: [GENERAL] background triggers?

2006-05-24 Thread Sim Zacks
The problem with client code processing a function is that unless you are using threads (my client application is not in a multi-threaded environment), the client has to wait for the server to return from the end of the function. I don't want the client to wait and the result doesn't affect the

Re: [GENERAL] column order

2006-05-24 Thread Michael Glaesemann
On May 24, 2006, at 11:54 , nuno wrote: does postgresql guarantee you that the columns in the result set would be ordered as specified in the query (i.e. id, firstname, lastname, dob) ? No. If you want a specific order, use the ORDER BY clause. Michael Glaesemann grzm seespotcode net ---

Re: [GENERAL] Quering by Regular Expressions stored in table

2006-05-24 Thread Allen Fair
Oops, I apoligize for the noise, this does seem to be working. I had an invalid regular expression in the column. Allen Allen Fair wrote: Hi! I have a table with a character column (called match_regex) containing a POSIX regular expression, hoping to have Postgres use it while evaluating the

Re: [GENERAL] meaning of PQresultStatus types

2006-05-24 Thread jois . de . vivre
[EMAIL PROTECTED] wrote: > I'm currently trying to understand how to deal with the return values > of PGresultStatus in terms of error handling in my application. The > postgres manual describes the return codes of PGresultStatus as: > > PGRES_EMPTY_QUERY: The string sent to the server was empty

[GENERAL] Survey on Firebird

2006-05-24 Thread nitin . groups
Dear Friends, Please take a few minutes to complete our online Survey on Firebird, which explores trends in the usage of Firebird. Your opinions will make a significant contribution to our research. To thank you for participating, we will give you the survey results free of charge and in advance

[GENERAL] meaning of PQresultStatus types

2006-05-24 Thread jois . de . vivre
I'm currently trying to understand how to deal with the return values of PGresultStatus in terms of error handling in my application. The postgres manual describes the return codes of PGresultStatus as: PGRES_EMPTY_QUERY: The string sent to the server was empty. PGRES_COMMAND_OK: Successful co

[GENERAL] column order

2006-05-24 Thread nuno
hi, all. i have a couple of questions regarding the order of table columns. say, you have a following query; SELECT id, firstname, lastname, dob FROM student; does postgresql guarantee you that the columns in the result set would be ordered as specified in the query (i.e. id, firstname, lastname

Re: [GENERAL] background triggers?

2006-05-24 Thread Kenneth Downs
Rafal Pietrak wrote: On Wed, 2006-05-24 at 07:41 -0400, Kenneth Downs wrote: Why not have the INSERT go to an "inbox" table, a table whose only job is to receive the data for future processing. Actually, it 'sort of' works that way. Your client code should ma

Re: [GENERAL] challenging constraint situation - how do I make it

2006-05-24 Thread Kenneth Downs
Alban Hertroys wrote: Kenneth Downs wrote: Alban Hertroys wrote: When encountering this problem I usually wonder why there isn't a data type that can store a timestamp and can be used to create a UNIQUE INDEX over it's values. That'd be wonderful. Well, maybe one day I'll actually have tim

Re: [GENERAL] compiling source code!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2006-05-24 Thread Richard Huxton
sibel karaasma wrote: Hi I'm a new postgresql user. I wrote ACO (ant colony optimazition) and want to replace it with GEQO in postres/src/backend/optimizer but I don't know how to compile and run the source code :( I installed postgresql-8.1.3 and cygwin but I can not use them to compile

Re: [GENERAL] background triggers?

2006-05-24 Thread Rafal Pietrak
On Wed, 2006-05-24 at 07:41 -0400, Kenneth Downs wrote: > > > Why not have the INSERT go to an "inbox" table, a table whose only job > is to receive the data for future processing. Actually, it 'sort of' works that way. > Your client code should mark all rows with a batch number as they go > in

Re: [GENERAL] background triggers?

2006-05-24 Thread Sim Zacks
I agree with you that it would be better to have a background trigger run by the database server. That was exactly what I asked. The answer was that there is no current way to do a background trigger and to accomplish what I want to do I need to write a daemon that calls Listen and then on the

Re: [GENERAL] Clearing out old idle connections

2006-05-24 Thread Richard Huxton
Gavin Hamill wrote: Hullo :) We have pg 8.1.3 and for whatever reason (network blips, poor pooling on behalf of the client, etc.) we sometimes see a large number (dozens) of old connections in the idle state which never get reused. They should expire based on your TCP/IP settings. It's a TC

Re: [GENERAL] challenging constraint situation - how do I make it

2006-05-24 Thread Alban Hertroys
Kenneth Downs wrote: Alban Hertroys wrote: When encountering this problem I usually wonder why there isn't a data type that can store a timestamp and can be used to create a UNIQUE INDEX over it's values. That'd be wonderful. Well, maybe one day I'll actually have time to create one... I tri

Re: [GENERAL] background triggers?

2006-05-24 Thread Kenneth Downs
Rafal Pietrak wrote: A plain INSERT of batch takes 5-10minutes on desktop postgresql (800MHz machine, ATA disks). When I attach trigger (*Very* simple funciton) to update the accounts, the INSERT take hours (2-4). But when I make just one single update of all accounts at the end of the batch ins

Re: [GENERAL] background triggers?

2006-05-24 Thread Rafal Pietrak
On Wed, 2006-05-24 at 13:36 +0200, Sim Zacks wrote: > My understanding of Listen/Notify is that it is a completely > disconnected process running on the database server. Yes. But In my particular case (and I presume, the intention of 'bacground triggers' is that) a programmer (like myself) is not

Re: [GENERAL] Clearing out old idle connections

2006-05-24 Thread Ivan Zolotukhin
Hello, We have pg 8.1.3 and for whatever reason (network blips, poor pooling on behalf of the client, etc.) we sometimes see a large number (dozens) of old connections in the idle state which never get reused. It seems that I have more or less the same problem. Sometimes I see in `ps aux` lots

Re: [GENERAL] challenging constraint situation - how do I make it

2006-05-24 Thread Kenneth Downs
Alban Hertroys wrote: When encountering this problem I usually wonder why there isn't a data type that can store a timestamp and can be used to create a UNIQUE INDEX over it's values. That'd be wonderful. Well, maybe one day I'll actually have time to create one... I tried this at trigger l

Re: [GENERAL] background triggers?

2006-05-24 Thread Sim Zacks
My understanding of Listen/Notify is that it is a completely disconnected process running on the database server. It should be run as a dameon (or service in Windows) application. The trigger on the table calls the notify SQL command and then the trigger, and thereby the statement, ends. The not

Re: [GENERAL] allow LIMIT in UPDATE and DELETE

2006-05-24 Thread Csaba Nagy
On Wed, 2006-05-24 at 00:15, Bruce Momjian wrote: > Jim C. Nasby wrote: > > On Tue, May 23, 2006 at 10:19:25AM +0200, Csaba Nagy wrote: > > > On Mon, 2006-05-22 at 23:55, Jim C. Nasby wrote: > > > > BTW, there's a bug/issue with CLUSTER that makes it not entirely > > > > transaction safe. > > > >

Re: [GENERAL] allow LIMIT in UPDATE and DELETE

2006-05-24 Thread Csaba Nagy
> > would be nice to have an "exclude-table" option on it. I actually > > started working on a patch to allow that, I will make it just good > > enough for my purpose (very poor C skills here). Would that be > > interesting for others ? > > Well, being able to have finer control over what you're d

Re: [GENERAL] [SQL] (Ab)Using schemas and inheritance

2006-05-24 Thread Alban Hertroys
Jim C. Nasby wrote: Moving to -general, where it's more likely that others will have input. Perhaps the biggest issue is: what happens when you need to do DDL? If you have 1000 schemas that should be identical, you'll need to perform any DDL 1000 times. What about using updatable views instead

Re: [GENERAL] challenging constraint situation - how do I make it

2006-05-24 Thread Alban Hertroys
Harald Armin Massa wrote: I have a business rule which gives me rahter big challenges to "melt in SQL": But it is not really fitting; and manual editing of the table can disturb it. So, ist there some constraint creatable to make sure that "in each point of time" each id only exists once? Yo

[GENERAL] compiling source code!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2006-05-24 Thread sibel karaasma
Hi I'm a new postgresql user. I wrote ACO (ant colony optimazition) and want to replace it with GEQO in postres/src/backend/optimizer but I don't know how to compile and run the source code :(     I installed postgresql-8.1.3 and cygwin but I can not use them to compile the source code. I want to c

[GENERAL] How to estimate disk space

2006-05-24 Thread Chris Velevitch
Is there a reference on how to estimate the disk space requirements of a database? Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group www.flashdev.org.au ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] Clearing out old idle connections

2006-05-24 Thread Gavin Hamill
Hullo :) We have pg 8.1.3 and for whatever reason (network blips, poor pooling on behalf of the client, etc.) we sometimes see a large number (dozens) of old connections in the idle state which never get reused. Is there a function in postgres similar to MySQL's 'wait_timeout' which automat

[GENERAL] challenging constraint situation - how do I make it real in SQL?

2006-05-24 Thread Harald Armin Massa
I have a business rule which gives me rahter big challenges to "melt in SQL": At one "point in time" only one version may be active. Simplified: CREATE TABLE sample ( id_field int4, value text, validfrom timestamp, validto timestamp ) within one timespan, every id_field has to be unique. s

Re: [GENERAL] More confirmation: pgadmin3 freezeup fixed by wxgtk

2006-05-24 Thread Dave Page
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Florian G. Pflug > Sent: 23 May 2006 23:09 > To: Kenneth Downs > Cc: pgsql general > Subject: Re: [GENERAL] More confirmation: pgadmin3 freezeup > fixed by wxgtk > > Kenneth Downs wrote: > > I'v

Re: [GENERAL] background triggers?

2006-05-24 Thread Rafal Pietrak
On Tue, 2006-05-23 at 13:01 -0400, Kenneth Downs wrote: > Rafal Pietrak wrote: > >some other INSERT, return imediately if so, but turn into background for > >a long-lasting job if not". > > > > > > > Rafal, I'm wondering why you want to do this. You may be "fighting the > framework". Yes, most