Re: [GENERAL] How to find how much postgresql use the memory?

2009-01-20 Thread Albe Laurenz
> I wonder how to find how much postgresql memory consumption > is (real, not allocated) ? You could install the pg_buffercache contrib and SELECT pg_size_pretty( CAST(current_setting('block_size') AS integer) * max(bufferid) ) FROM pg_buffercache WHERE relfilenode IS NOT NULL;

Re: [GENERAL] pg_restore: [archiver] entry ID -825110830 out of range -- perhaps a corrupt TOC

2009-01-20 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, maybe I did not understand - but what exactly happens when you do something like pg_restore -d databasename -L backup.toc backup.bak (bak -> or what ever custom format you use) Is the version you did the backup with the same like the postgres v

[GENERAL] Can I separate my Databases as in FireBird? Working with DataBases...

2009-01-20 Thread Durumdara
Hi! I came from SQLite, FireBird and DBISAM world. These database systems have a speciality that they stores one database in one file, or in one directory. Each of databases have separated file (or dir with files), and when I want to copy a database, I have MORE possibility to do this. First solu

Re: [GENERAL] accessing user table structures from SQL

2009-01-20 Thread Albe Laurenz
Vincent Predoehl wrote: > Sent: Saturday, January 17, 2009 5:33 AM > Does postgresql have a system table that has the table > structure of user tables, like systables and sysobjects in MS > SQL Server? All the details about database objects are in the system catalogs: http://www.postgresql.org/

Re: [GENERAL] Can I separate my Databases as in FireBird? Working with DataBases...

2009-01-20 Thread Scott Marlowe
On Tue, Jan 20, 2009 at 1:29 AM, Durumdara wrote: > Hi! > > I came from SQLite, FireBird and DBISAM world. > These database systems have a speciality that they stores one database in > one file, or in one directory. > > Each of databases have separated file (or dir with files), and when I want > t

Re: [GENERAL] Can I separate my Databases as in FireBird? Working with DataBases...

2009-01-20 Thread Grzegorz Jaśkiewicz
http://www.postgresql.org/docs/8.3/interactive/sql-createtablespace.html you probably look for that. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Recovering from database corruption using WAL-logs

2009-01-20 Thread Kristian Klette via RT
Hi! Last autumn we discovered a case of database corruption in our databases (missing rows with foreign keys pointed at them). At the time we ran version PostgreSQL 8.3.1. We upgraded our postgres to 8.3.4, but somehow the restoration from backups got forgotten. Early this year things where remem

[GENERAL] Recovering from database corruption using WAL-logs

2009-01-20 Thread Kristian Klette via RT
Hi! Last autumn we discovered a case of database corruption in our databases (missing rows with foreign keys pointed at them). At the time we ran version PostgreSQL 8.3.1. We upgraded our postgres to 8.3.4, but somehow the restoration from backups got forgotten. Early this year things where remem

[GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi everybody, I have an automated mechanism to restore a demo database each night with an SQL dump. What I do inbetween a shell script is the following: 1. all database access is canceled 2. dropdb 3. createdb 4. import SQL dump: psql -o /dev/null $

Re: [GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread hubert depesz lubaczewski
On Tue, Jan 20, 2009 at 11:15:08AM +0100, Andreas Wenk wrote: > Where can I prevent bulding the language again? My idea was to do that while > creating the > dump or while importing the dump. But as far as I understand, that's not > possible. instead of "createdb" use: createdb -D template0 Bes

Re: [GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi depesz, thanks a lot for the reply. I think that will not work, because this is (still) a 8.1 and tsearch2 is integreated. That means I have to use template1 otherwise tsearch2 would not be there ... Am I right? P.S.: upgrade to 8.3 is planned

Re: [GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread Grzegorz Jaśkiewicz
try creating whole db from scratch, do the dump with option -c (will recreate all objects automagically). you can also issue 'drop language plpgsql [cascade]' before. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.

[GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Igor Katson
Is there a way to get i.e. table creation sql script from an existing table in psql (not postgresql, but psql client), like it is in pgAdmin? I.e. i point it to existing table 'foo', and it writes: CREATE TABLE foo ( bar int ); -- Sent via pgsql-general mailing list (pgsql-general@postgresql.

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Grzegorz Jaśkiewicz
pg_dump -t foo database -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Igor Katson
Grzegorz Jaśkiewicz wrote: pg_dump -t foo database Thanks, but pg_dump is not psql client (i meant the */bin/psql interactive shell), and there is only an option for table objects, and no one for i.e. indices. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make ch

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Grzegorz Jaśkiewicz
pg_dump -t ANYOBJECT database afaik., try it - play with it. -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Igor Katson
Grzegorz Jaśkiewicz wrote: pg_dump -t ANYOBJECT database afaik., try it - play with it. that does not work for indices. But the index creation is shown when placing it's parent table into -t. Thanks for the help, Grzegorz, the issue is solved. -- Sent via pgsql-general mailing list (pgsq

Re: [GENERAL] How can I look at a recursive table dependency tree?

2009-01-20 Thread Igor Katson
Richard Huxton wrote: Igor Katson wrote: I want to DROP CASCADE a table, but I am afraid that amoung numerous recursive dependencies there will be smth, that I don't want to drop. Is there a way to watch all dependencies recursively without doing a drop? BEGIN; DROP CASCADE... -- chec

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Grzegorz Jaśkiewicz
try exhausting possibilities there. Many ppl don't know that you can have multiple -t objects , and than use -T for stuff you don't want as well. It does the job pretty often I have to say. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread A. Kretschmer
In response to Igor Katson : > Is there a way to get i.e. table creation sql script from an existing > table in psql (not postgresql, but psql client), like it is in pgAdmin? > > I.e. i point it to existing table 'foo', and it writes: > CREATE TABLE foo ( > bar int > ); wait for 8.4: http://de

Re: [GENERAL] Autovacuum daemon terminated by signal 11

2009-01-20 Thread Alvaro Herrera
Tom Lane wrote: > Anyway, it happens consistently on my HP box. I find that your proposed > patch fixes it, but makes the "normal" path crash :-( --- the loop in > do_autovacuum has to be executed in AutovacMemCxt, because it creates an > Oid List that gets passed to vacuum() and had better not b

Re: [GENERAL] conexiones ssl

2009-01-20 Thread Alvaro Herrera
Henry Interiano wrote: > > Hola a todos > > necesito ayuda como configurar mi base de datos como aceptar > conexiones ssl desde cualquier ip, mi base de datos esta instalada en > Windows: Hola Henry, La lista pgsql-general es en inglés. Por favor usa pgsql-es-ayuda para hacer preguntas (y obt

Re: [GENERAL] Can I separate my Databases as in FireBird? Working with DataBases...

2009-01-20 Thread Albe Laurenz
Durumdara wrote: > I came from SQLite, FireBird and DBISAM world. > These database systems have a speciality that they stores one > database in one file, or in one directory. > > Each of databases have separated file (or dir with files), > and when I want to copy a database, I have MORE possibil

Re: [GENERAL] CREATE parametric partial INDEX within a function body

2009-01-20 Thread Reg Me Please
On Monday 19 January 2009 23:28:08 Reg Me Please wrote: > On Monday 19 January 2009 22:49:17 Gerhard Heift wrote: > > On Mon, Jan 19, 2009 at 08:19:06PM +0100, Reg Me Please wrote: > > > Hi all. > > > > > > I have a maintenance PL/pgSQL function that needs to recreate a partial > > > index (not a R

[GENERAL] Database schema & data synchronizer software for PostgreSQL?

2009-01-20 Thread Csaba Együd
Hi, I'd like to ask your suggestions about a reliable admin software which is able to compare two dabases and generate a schema synchrinizer script. It would be nice to be able to generate data synchronization script for only the selected tables, and other features. Thank you, -- Best Regards,

Re: [GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread Adrian Klaver
On Tuesday 20 January 2009 2:15:08 am Andreas Wenk wrote: > Hi everybody, > > I have an automated mechanism to restore a demo database each night with an > SQL dump. What I do inbetween a shell script is the following: > > 1. all database access is canceled > 2. dropdb > 3. createdb > 4. import SQL

Re: [GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adrian Klaver schrieb: > On Tuesday 20 January 2009 2:15:08 am Andreas Wenk wrote: >> Hi everybody, >> >> I have an automated mechanism to restore a demo database each night with an >> SQL dump. What I do inbetween a shell script is the following: >> >

Re: [GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread Adrian Klaver
On Tuesday 20 January 2009 7:05:23 am Andreas Wenk wrote: > Adrian, > > no lack of coffee but my fault. You are totally right - that was a copy and > paste error. For sure the dump is *.sql. > > Until now there is no onboard solution for this issue. Means, the import of > the dump is working corre

Re: [GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-20 Thread Grzegorz Jaśkiewicz
the only difference here is, that the trigger will memcmp (compare) all data. Say, if we have two columns, int and bytea, and just want to compare fist one - it will use a lot of cpu in vain. I have to say, it is a shame sometimes - that trigger isn't aware of what fields we do update exactly --

Re: [GENERAL] Database schema & data synchronizer software for PostgreSQL?

2009-01-20 Thread David Fetter
On Tue, Jan 20, 2009 at 03:03:33PM +0100, Csaba Együd wrote: > Hi, > I'd like to ask your suggestions about a reliable admin software > which is able to compare two dabases and generate a schema > synchrinizer script. There is no such thing, and there is no prospect of there ever being such a thin

Re: [GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adrian Klaver schrieb: > On Tuesday 20 January 2009 7:05:23 am Andreas Wenk wrote: > >> Adrian, >> >> no lack of coffee but my fault. You are totally right - that was a copy and >> paste error. For sure the dump is *.sql. >> >> Until now there is no o

Re: [GENERAL] import sql dump with psql - language creation throws error

2009-01-20 Thread Adrian Klaver
On Tuesday 20 January 2009 7:50:58 am Andreas Wenk wrote: > > > > > Just to point you to Grzegorz's suggestion of using the -c switch in the > > pg_dump command. To quote the manual: > > > > -c > > "Output commands to clean (drop) database objects prior to (the commands > > for) creating them. > >

Re: [GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-20 Thread Dimitri Fontaine
Hi, Le lundi 19 janvier 2009, Tom Lane a écrit : > But having said that: 8.4 will provide a standard trigger that > short-circuits vacuous updates, which you can apply to tables in which > you think vacuous updates are likely. It's your responsibility to place > the trigger so that it doesn't int

Re: [GENERAL] pg_restore: [archiver] entry ID -825110830 out of range -- perhaps a corrupt TOC

2009-01-20 Thread Dennis C
Greetings; And thanks for your reply! I tried the following: less xaa | grep "^;" "xaa" may be a binary file. See it anyway? y Binary file (standard input) matches And so am not sure which version I did the following from: pg_dump -c -F c -Z 9 [databasename] But I installed it about a yea

Re: [GENERAL] pg_restore: [archiver] entry ID -825110830 out of range -- perhaps a corrupt TOC

2009-01-20 Thread Scott Marlowe
On Tue, Jan 20, 2009 at 11:15 AM, Dennis C wrote: > Greetings; > And thanks for your reply! I tried the following: > less xaa | grep "^;" > "xaa" may be a binary file. See it anyway? y > Binary file (standard input) matches > > And so am not sure which version I did the following from: > pg_dump

Re: [GENERAL] pg_restore: [archiver] entry ID -825110830 out of range -- perhaps a corrupt TOC

2009-01-20 Thread Dennis C
OK that was it! Wow, thank you so very much! Nice to know it was just plpython tracking such an obsolete version of postgresql much to my dismay now (especially even going backwards, which didn't even occur to me), as opposed to postgresql itself being less reliable than I've come to expect over

[GENERAL] Custom type, operators and operator class not sorting/indexing correctly

2009-01-20 Thread Roger Leigh
Dear all, I've created a new domain (debversion) derived from TEXT, which includes its own operators (< <= = >= > and <>), and also its own operator class for BTREE indices. The operators function correctly when I test them by themselves, e.g. SELECT x < y; However, if I create a table with a col

Re: [GENERAL] How to find how much postgresql use the memory?

2009-01-20 Thread Luki Rustianto
Ok I see. So what's the best way to find optimum value for various memory-related setting of postgresql ? On Tue, Jan 20, 2009 at 3:27 PM, Albe Laurenz wrote: > > I wonder how to find how much postgresql memory consumption > > is (real, not allocated) ? > > You could install the pg_buffercache co

Re: [GENERAL] Database schema & data synchronizer software for PostgreSQL?

2009-01-20 Thread Robert Treat
On Tuesday 20 January 2009 10:44:06 David Fetter wrote: > On Tue, Jan 20, 2009 at 03:03:33PM +0100, Csaba Együd wrote: > > Hi, > > I'd like to ask your suggestions about a reliable admin software > > which is able to compare two dabases and generate a schema > > synchrinizer script. > > There is no

Re: [GENERAL] Is this on the to-do list?

2009-01-20 Thread Robert Treat
On Monday 19 January 2009 18:13:51 Bruce Momjian wrote: > Thomas Kellerer wrote: > > A B wrote on 18.01.2009 22:43: > > > From the docs: > > > http://www.postgresql.org/docs/8.3/interactive/sql-update.html > > > > > > "According to the standard, the column-list syntax should allow a list > > > of

Re: [GENERAL] Database schema & data synchronizer software for PostgreSQL?

2009-01-20 Thread David Fetter
On Tue, Jan 20, 2009 at 09:51:25PM -0500, Robert Treat wrote: > On Tuesday 20 January 2009 10:44:06 David Fetter wrote: > > On Tue, Jan 20, 2009 at 03:03:33PM +0100, Csaba Együd wrote: > > > Hi, > > > I'd like to ask your suggestions about a reliable admin software > > > which is able to compare tw

Re: [GENERAL] Database schema & data synchronizer software for PostgreSQL?

2009-01-20 Thread Együd Csaba
>-Original Message- >From: David Fetter [mailto:da...@fetter.org] >Sent: Tuesday, January 20, 2009 4:44 PM >To: Csaba Együd >Cc: pgsql-general@postgresql.org >Subject: Re: [GENERAL] Database schema & data synchronizer software for >PostgreSQL? > >On Tue, Jan 20, 2009 at 03:03:33PM +0100, Cs

Re: [GENERAL] Database schema & data synchronizer software for PostgreSQL?

2009-01-20 Thread Együd Csaba
>-Original Message- >From: Robert Treat [mailto:xzi...@users.sourceforge.net] >Sent: Wednesday, January 21, 2009 3:51 AM >To: pgsql-general@postgresql.org >Cc: David Fetter; Csaba Együd >Subject: Re: [GENERAL] Database schema & data synchronizer software for >PostgreSQL? > >On Tuesday 20 Ja

Re: [GENERAL] Database schema & data synchronizer software for PostgreSQL?

2009-01-20 Thread ries van Twisk
On Jan 20, 2009, at 11:27 PM, Együd Csaba wrote: -Original Message- From: Robert Treat [mailto:xzi...@users.sourceforge.net] Sent: Wednesday, January 21, 2009 3:51 AM To: pgsql-general@postgresql.org Cc: David Fetter; Csaba Együd Subject: Re: [GENERAL] Database schema & data synchronize

Re: [GENERAL] Database schema & data synchronizer software for PostgreSQL?

2009-01-20 Thread Együd Csaba
>dbsolo does a decent job. >I think they main thing here is to check for inconsistencies and see >what they are, rather >then a tool that takes over the administrative task. > >We all understand David's point of view, but it can't hurt to have a >tool in place that can verify the consistency of bot

Re: [GENERAL] Custom type, operators and operator class not sorting/indexing correctly

2009-01-20 Thread Tom Lane
Roger Leigh writes: > I've created a new domain (debversion) derived from TEXT, which > includes its own operators (< <= = >= > and <>), and also its > own operator class for BTREE indices. You can't realistically attach such things to a domain; try making a separate type, perhaps with an implici