[GENERAL] why does the toast table exist?

2011-02-16 Thread AI Rumman
I found in my Postgresql 9.0.1 DB as follows: select oid,relname,reltoastrelid,relpages,relfilenode,reltuples from pg_class where oid in ( 90662,90665); -[ RECORD 1 ]-+--- oid | 90662 relname | audit_trial reltoastrelid | 90665 relpages | 7713 relfilenode |

Re: [GENERAL] Multithreaded query onto 4 postgresql instances

2011-02-16 Thread Alessandro Candini
Il 15/02/2011 19:32, Alban Hertroys ha scritto: On 15 Feb 2011, at 9:32, Alessandro Candini wrote: Is that a single query on that one DB compared to 4 queries on 4 DB's? How does a single DB with 4 parallel queries perform? I'd expect that to win from 4 DB's, due to the overhead those extra

[GENERAL] pg_dump with select output

2011-02-16 Thread Adarsh Sharma
Dear all, I am using pg_dump in Postgresql database very often and read several parameters of it. But today i want to back up that part of table which satisfies satisfies certain condition ( select command ). In mysql , this is achieved as below : mysqldump -h192.168.1.106 -uroot -porkash

Re: [GENERAL] pg_dump with select output

2011-02-16 Thread Raymond O'Donnell
On 16/02/2011 09:54, Adarsh Sharma wrote: Dear all, I am using pg_dump in Postgresql database very often and read several parameters of it. But today i want to back up that part of table which satisfies satisfies certain condition ( select command ). In mysql , this is achieved as below :

Re: [GENERAL] pg_dump with select output

2011-02-16 Thread Sim Zacks
On 02/16/2011 11:54 AM, Adarsh Sharma wrote: Dear all, I am using pg_dump in Postgresql database very often and read several parameters of it. But today i want to back up that part of table which satisfies satisfies certain condition ( select command ). In mysql , this is achieved as

[GENERAL] server setup/testing performance

2011-02-16 Thread Aljoša Mohorović
i'm looking for tools, like ab/siege/jmeter for web servers, to test postgres performance. not looking to resolve specific performance problems just to tune configuration to get average/better performance for server than with default installation. i did use instructions from

[GENERAL] disable triggers using psql

2011-02-16 Thread Geoffrey Myers
So, we have a text dump that we used to clean up our data, now we need to reload it into the new database. Problem is, we have some data integrity issues that cause records to fail to load. Before we ran into the data conversion issue we were using 'pg_restore disable_triggers' to get around

Re: [GENERAL] disable triggers using psql

2011-02-16 Thread Andrew Sullivan
On Wed, Feb 16, 2011 at 09:50:39AM -0500, Geoffrey Myers wrote: Is there a way to resolve this issue with the psql loading approach? You can just disable or, depending on your version of Postgres, drop the triggers at the start of the load, load everything up, and then add them again. A --

Re: [GENERAL] disable triggers using psql

2011-02-16 Thread David Johnston
I may be off-track here but triggers do not enforce referential integrity - constraints do. If you need to disable triggers you can do so via the ALTER TABLE command. The reason I think pg_restore works for you is because when a table is built using pg_restore all the data is loaded into all

Re: [GENERAL] finding bogus UTF-8

2011-02-16 Thread Vick Khera
On Tue, Feb 15, 2011 at 5:06 PM, Geoffrey Myers li...@serioustechnology.com wrote: I toyed with tr for a bit, but could not get it to work.  The above did not work for me either.  Not exactly sure what it's doing, but here's a couple of diff lines: check your shell escaping. You may need \\

Re: [GENERAL] help understanding explain output

2011-02-16 Thread pasman pasmański
Naturally a boolean can only have two values, really? pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Raid Controller Write Cache setting for WAL and Data

2011-02-16 Thread Piotr Gasidło
Hello, Is it safe, to have RAID controller (not BBC) write cache _enabled_ for disks where data are stored and write cache _disabled_ for disks where WAL segments are stored? I _can_ afford of loosing some data in case of power failure. But I'm afraid of having database in unrecoverable state

Re: [GENERAL] disable triggers using psql

2011-02-16 Thread Andrew Sullivan
On Wed, Feb 16, 2011 at 10:08:53AM -0500, David Johnston wrote: I may be off-track here but triggers do not enforce referential integrity - constraints do. If you need to disable triggers you can do so via the ALTER TABLE command. Unless something very big changed when I wasn't looking, the

Re: [GENERAL] Raid Controller Write Cache setting for WAL and Data

2011-02-16 Thread Andrew Sullivan
On Wed, Feb 16, 2011 at 04:40:43PM +0100, Piotr Gasidło wrote: Is it safe, to have RAID controller (not BBC) write cache _enabled_ for disks where data are stored and write cache _disabled_ for disks where WAL segments are stored? No. I _can_ afford of loosing some data in case of power

Re: [GENERAL] Multithreaded query onto 4 postgresql instances

2011-02-16 Thread Alban Hertroys
On 16 Feb 2011, at 9:54, Alessandro Candini wrote: Try the above on a single DB using 4 threads. It will very probably perform better. To use your example: 5432 --- 150 million records 5432 --- 150 million records 5432 --- 150 million records 5432 --- 150 million records Excuse me

[GENERAL] Hide db name and user name in process list arguments

2011-02-16 Thread Gavrina, Irina
Hi, On Unix systems Postgres process list can be accessible through 'ps' utility: ps auxww | grep ^postgres $ ps auxww | grep ^postgres postgres 960 0.0 1.1 6104 1480 pts/1SN 13:17 0:00 postmaster -i postgres 963 0.0 1.1 7084 1472 pts/1SN 13:17 0:00 postgres: stats

[GENERAL] PGDay LA @ SCALE 9X : 1 week away

2011-02-16 Thread Richard Broersma
Here's the reminder that PGDay is just one week away. It scheduled for Friday February 25th, 2011 and is hosted by SCALE. For more information: http://sites.google.com/site/pgdayla/home To Register: https://www.socallinuxexpo.org/reg7/ Also, we're look for more volunteers to attend the

Re: [GENERAL] Postgresql - recovery.conf

2011-02-16 Thread Bruce Momjian
For@ll wrote: Hi, In file recovery.conf I can define recovery_target_time or recovery_target_xid. I have question where I cand found this information? Well, the time is wall clock time. It is hard to know the xid to use for recovery. -- Bruce Momjian br...@momjian.us

Re: [GENERAL] Recovery with WAL

2011-02-16 Thread Bruce Momjian
Albert wrote: Where can I find information about recovery_target_time or recovery_target_xid. I have two servers db1 and db2, WAL files are copied from db1 to db2. Database will colapse at 17:10 and i wan't to recove base from 17:05, so where can I find info about recovery_time. If

Re: [GENERAL] Hide db name and user name in process list arguments

2011-02-16 Thread Thomas Kellerer
Gavrina, Irina, 16.02.2011 15:50: Hi, On Unix systems Postgres process list can beaccessible through‘ps’ utility: ps auxww | grep ^postgres $ ps auxww | grep ^postgres postgres 9600.01.16104 1480 pts/1SN 13:17 0:00 postmaster -i postgres 963

Re: [GENERAL] Hide db name and user name in process list arguments

2011-02-16 Thread Tom Lane
Thomas Kellerer spam_ea...@gmx.net writes: Gavrina, Irina, 16.02.2011 15:50: Is there any way to hide dbname and user name in displayed arguments of client connections? I think that's what the configuration property update_process_title is for. No, that's just meant to suppress the overhead

[GENERAL] Query sought with windowing function to weed out dense points

2011-02-16 Thread Stefan Keller
Hi, Given a table 'peaks' with the fields id, name, elevation and geometry I'd like to get a query which returns only peaks which dont overlap - and from those which would do, I'd like to get the topmost one (given a certain 'density parameter'). This problem is motivated by a visualization task

Re: [GENERAL] Query sought with windowing function to weed out dense points

2011-02-16 Thread Gianni Ciolli
Hi, On Thu, Feb 17, 2011 at 12:14:28AM +0100, Stefan Keller wrote: SELECT ST_AsText(geometry), name as label FROM peaks t1 WHERE t1.id = ( SELECT id FROM ( SELECT ST_SnapToGrid(geometry, 5) as geometry, elevation, id FROM peaks ) t2 WHERE

Re: [GENERAL] why does the toast table exist?

2011-02-16 Thread Noah Misch
On Wed, Feb 16, 2011 at 02:36:03PM +0600, AI Rumman wrote: I have no idea why the TOAST table exists for audit_trial table. \d audit_trial Table public.audit_trial Column |Type | Modifiers +-+---

Re: [GENERAL] question regarding full_page_write

2011-02-16 Thread Greg Smith
AI Rumman wrote: I can't clearly understand what FULL_PAGE_WRITE parameter is stand for. Documentation suggest that If I make it OFF, then I have the chance for DB crash. Can anyone please tell me how it could be happened? The database writes to disk in 8K blocks. If you can be sure that

Re: [GENERAL] Raid Controller Write Cache setting for WAL and Data

2011-02-16 Thread Greg Smith
Piotr Gasidło wrote: I _can_ afford of loosing some data in case of power failure. But I'm afraid of having database in unrecoverable state after crash. Then turn off synchronous_commit. That's exactly the behavior you get when it's disabled: some data loss after a crash, no risk of

[GENERAL] pl/pgSQL variable substitution

2011-02-16 Thread Jeremy Palmer
Hi, I'm creating a pl/pgSQL function that returns a table that has a column name which is the same as a PostgreSQL reserved. In the below example a have returning table with a column called 'desc': CREATE OR REPLACE FUNCTION bad_func() RETURNS TABLE (bar INTEGER, desc VARCHAR(100)) AS $$

Re: [GENERAL] pl/pgSQL variable substitution

2011-02-16 Thread Pavel Stehule
Hello you cannot use a variable as column name or table name. It's not possible, because it can change execution plan and it isn't allowed. Use a dynamic SQL instead. RETURN QUERY EXECUTE 'SELECT foo.bar, foo.' || quote_ident(desc) || ' FROM foo ORDER BY foo.' || quote_ident(desc) || ' DESC'

Re: [GENERAL] pl/pgSQL variable substitution

2011-02-16 Thread Alban Hertroys
On 17 Feb 2011, at 5:33, Jeremy Palmer wrote: Hi, I'm creating a pl/pgSQL function that returns a table that has a column name which is the same as a PostgreSQL reserved. In the below example a have returning table with a column called 'desc': CREATE OR REPLACE FUNCTION bad_func()