Re: [GENERAL] Need some advice on appropriate PL strategy...

2004-10-11 Thread Greg Stark
"Eric D. Nielsen" <[EMAIL PROTECTED]> writes: > I'm in the process of implementing a "monitor this" type feature on a > web-application. When something changes on the monitored item an email to the > subscriber is generated. I'd like to do this via triggers instead of > application logic. As fa

Re: [GENERAL] 'NOW' in UTC with no timezone

2004-10-11 Thread Tom Lane
Stuart Bishop <[EMAIL PROTECTED]> writes: > I'm trying to determine the best way of saying 'The current time in UTC > with no time zone information'. Isn't that a contradiction in terms? I *think* maybe what you want is to SET TIMEZONE = 'UTC' and then stop worrying about it. But anyone who is w

[GENERAL] Need some advice on appropriate PL strategy...

2004-10-11 Thread Eric D. Nielsen
I'm in the process of implementing a "monitor this" type feature on a web-application. When something changes on the monitored item an email to the subscriber is generated. I'd like to do this via triggers instead of application logic. As far as I can tell pl/pgsql does not include any metho

[GENERAL] 'NOW' in UTC with no timezone

2004-10-11 Thread Stuart Bishop
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I'm trying to determine the best way of saying 'The current time in UTC with no time zone information'. I'm currently using CURRENT_TIMESTAMP AT TIME ZONE 'UTC' and inserting into columns defined as TIMESTAMP WITHOUT TIME ZONE which appears to work.

Re: [GENERAL] Reiniciar secuencias

2004-10-11 Thread Michael Fuhr
On Mon, Oct 11, 2004 at 08:55:27PM -0500, William Diaz Pabón wrote: > > Como puedo hacer para reiniciar una secuencia? > > Tengo un campo como serial (autnomunerico) pero cuando elimino registro me > quedan espacios, y quiero reiniciar la secuencia. I think you're looking for ALTER SEQUENCE or s

Re: [GENERAL] Very slow delete.

2004-10-11 Thread Tom Lane
Brock Henry <[EMAIL PROTECTED]> writes: > delete from people where id < '2000' > Index Scan using people_pkey on people (cost=0.00..71.68 rows=2792 > width=6) (actual time=1.361..5.657 rows=2000 loops=1) > Index Cond: (id < 3000) > Total runtime: 13.006 ms > 3 row(s) > Total runtime: 63,869.322

[GENERAL] Very slow delete.

2004-10-11 Thread Brock Henry
Hello, I have a table with 29268 odd records. Deleting records is VERY slow, and I don't know why. I explained analysed the following query: delete from people where id < '2000' Index Scan using people_pkey on people (cost=0.00..71.68 rows=2792 width=6) (actual time=1.361..5.657 rows=2000 loop

[GENERAL] Reiniciar secuencias

2004-10-11 Thread William Diaz Pabón
Hola a todos. Como puedo hacer para reiniciar una secuencia? Tengo un campo como serial (autnomunerico) pero cuando elimino registro me quedan espacios, y quiero reiniciar la secuencia. Espero me puedan colaborar. gracias Cordialmente. William Diaz Pabón Modelamiento Plataforma Siglo XXI Uni

[GENERAL] Changes to CVS requires Fresh Checkout

2004-10-11 Thread Marc G. Fournier
In order to correct some problems apparent inside of cvsweb, this past weekend we have remerged the various components of the root CVS repository. In the past, the checkout module 'pgsql' was an alias that merged both pgsql-server and contrib/earthdistance. The change has eliminated the alias

Re: [GENERAL] created databases as other users...

2004-10-11 Thread Jonathan Villa
For some reason, I never tried $psql --username=testcon testdb I'm trying to use phpPGAdmin at the same time...I guess I was having a tough time using both... thanks Tom for the reply. On Mon, 2004-10-11 at 16:01, Tom Lane wrote: > Jonathan Villa <[EMAIL PROTECTED]> writes: > > $ createdb --ow

Re: [GENERAL] created databases as other users...

2004-10-11 Thread Tom Lane
Jonathan Villa <[EMAIL PROTECTED]> writes: > $ createdb --owner=testcon testdb > but the owner ends up being postgres I don't think so. $ createuser testcon Shall the new user be allowed to create databases? (y/n) n Shall the new user be allowed to create more new users? (y/n) n CREATE USER $ cre

[GENERAL] created databases as other users...

2004-10-11 Thread Jonathan Villa
Is it possible to create a database to be owned by a user that only exists to postgresql or do they have to be shell accounts as well. $ createdb --owner=testcon testdb but the owner ends up being postgres I'm planning to create a different database for each different project I have. I want the

Re: [GENERAL] Activestate Perl and DBD-Pg?

2004-10-11 Thread David Siebert
Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anyone using Activestate Perl and DBD-Pg? I am using perl 5.8.3 ppm does not seem to work. I downloaded the DBD-Pg .zip file I found through google but ppm could not seem to install that. Any suggestions? There has been

Re: [GENERAL] Reusable pl/pgsql samples ?

2004-10-11 Thread John DeSoi
On Oct 11, 2004, at 5:05 AM, Armen Rizal wrote: Is there anybody know where I can find reusable pl/pgsql samples or function library ? I'm not aware of any kind of generic reusable library, but if you are interested in an extensive pl/pgsql example, you can check this location in the source dist

Re: [GENERAL] CVS broken?

2004-10-11 Thread Michael Fuhr
On Mon, Oct 11, 2004 at 05:22:29PM +0300, Devrim GUNDUZ wrote: > > I think you should use pgsql instead of pgsql-server as the module name, > per http://archives.postgresql.org/pgsql-hackers/2004-10/msg00355.php . Thanks -- I'm not subscribed to pgsql-hackers but I probably should be. -- Micha

Re: [GENERAL] CVS broken?

2004-10-11 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > Since last evening (Sun 10 Oct), running "cvs update" has produced > numerous errors like the following: > cvs update: Updating config > cvs update: cannot open directory /projects/cvsroot/pgsql-server/config: No such > file or directory You'll need to m

Re: [GENERAL] Get Postgre Status and Information

2004-10-11 Thread Thomas F . O'Connell
There's also pg_config. http://www.postgresql.org/docs/7.4/static/app-pgconfig.html -tfo On Oct 11, 2004, at 3:04 AM, m.b. wrote: Hello everybody, is there a possibility to get some useful information about my postgresql installation, its configuration, the locales and information about the databas

Re: [GENERAL] CVS broken?

2004-10-11 Thread Devrim GUNDUZ
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, On Mon, 11 Oct 2004, Michael Fuhr wrote: Since last evening (Sun 10 Oct), running "cvs update" has produced numerous errors like the following: cvs update: Updating config cvs update: cannot open directory /projects/cvsroot/pgsql-server/config: No s

[GENERAL] CVS broken?

2004-10-11 Thread Michael Fuhr
Since last evening (Sun 10 Oct), running "cvs update" has produced numerous errors like the following: cvs update: Updating config cvs update: cannot open directory /projects/cvsroot/pgsql-server/config: No such file or directory cvs update: skipping directory config cvs update: Updating contrib

Re: [GENERAL] Single-file databases -- how do they do it?

2004-10-11 Thread Sim Zacks
I'm not an expert on the backend, but here's my best guess. The database is stored internally as a binary file, not a text file. Binary files are accessed randomly, not sequentially, so the database engine opens the file and skips the the portion of the file holding that table. It then has to hash

Re: [GENERAL] Random not so random

2004-10-11 Thread Marco Colombo
On Mon, 4 Oct 2004, Bruno Wolff III wrote: On Mon, Oct 04, 2004 at 18:58:41 +0200, Marco Colombo <[EMAIL PROTECTED]> wrote: Actually, that should be done each time the random() function is evaluated. (I have no familiarity with the code, so please That may be overkill, since I don't think that ran

[GENERAL] Single-file databases -- how do they do it?

2004-10-11 Thread Gene Kahn
Hello, How do single-file databases do it? If a database has, say, 10 tables, does that mean that the single-file is just a trick to hold ten separate 'boxes' inside, one for each table, or someone has found a way to store all the tables of a database in one big single table? Can someone un-curious

Re: [GENERAL] update sequence conversion script

2004-10-11 Thread Peter Eisentraut
Terry Lee Tucker wrote: > When one moves from version 7.x to 8.x, will my old pgplsql functions > continue to work with the single quotes Of course. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 2: you

Re: [GENERAL] update sequence conversion script

2004-10-11 Thread Terry Lee Tucker
Question: When one moves from version 7.x to 8.x, will my old pgplsql functions continue to work with the single quotes or will everything have to be changed to the "dollar quoting" functionality? Thanks... On Monday 11 October 2004 05:28 am, Richard Huxton saith: > > For those that are puzzle

Re: [GENERAL] update sequence conversion script

2004-10-11 Thread Richard Huxton
Sim Zacks wrote: I am in the process of converting an existing database to PostGreSQL and wrote a generic script to update all of the sequences as they default at 1. I thought it would be useful to other people who are converting their databases. Very nice. create or replace function UpdateSequence

[GENERAL] Reusable pl/pgsql samples ?

2004-10-11 Thread Armen Rizal
Hello all,   Is there anybody know where I can find reusable pl/pgsql samples or function library ?     Thanks,   Armen

[GENERAL] update sequence conversion script

2004-10-11 Thread Sim Zacks
I am in the process of converting an existing database to PostGreSQL and wrote a generic script to update all of the sequences as they default at 1. I thought it would be useful to other people who are converting their databases. If anyone can write this script in using plpythonu, I would love to

Re: [GENERAL] Get Postgre Status and Information

2004-10-11 Thread Dominic Mitchell
On Mon, Oct 11, 2004 at 10:04:09AM +0200, m.b. wrote: > is there a possibility to get some useful information about > my postgresql installation, its configuration, the locales > and information about the databases which run on the system ? > so i would be able to compare 3 different systems and se

Re: [GENERAL] SELECT from a set of values really slow?

2004-10-11 Thread Pierre-Frédéric Caillaud
test=> insert into bench (id,data) select id, 'text_item_'||id::text from dummy where id<=10 order by id; INSERT 0 11 test=> CREATE INDEX bench_data_index ON bench (data); CREATE INDEX test=> explain select * from bench where data = 'test_item_1'; Index Scan using bench_data_index on ben

[GENERAL] Get Postgre Status and Information

2004-10-11 Thread m.b.
Hello everybody, is there a possibility to get some useful information about my postgresql installation, its configuration, the locales and information about the databases which run on the system ? so i would be able to compare 3 different systems and see the difference between them from postgres's