Re: [GENERAL] Virtual table with pl/perl?

2010-04-20 Thread Rene Schickbauer
Alvaro Herrera wrote: Rene Schickbauer escribió: Hi! I'm looking into implementing an updateable "virtual" table using pl/perl. What i basically want to do is read out/update some external resources. For programs using the SQL interface, this should look just like a regular table except that i

Re: [GENERAL] Tuple storage overhead

2010-04-20 Thread Peter Bex
On Fri, Apr 16, 2010 at 12:40:21PM +0200, Szymon Guz wrote: > I thought that the default fillfactor was much smaller (and haven't checked > that now)... sorry for messing that up. > But let's think of it from the other side: what do you want to do with that > data? Maybe PostgreSQL with it's MVCC'

Re: [GENERAL] Tuple storage overhead

2010-04-20 Thread Peter Bex
On Fri, Apr 16, 2010 at 11:28:36AM -0400, Merlin Moncure wrote: > If you are storing big data and want to keep the overhead low, the > first thing you need to examine is organizing your data into arrays. > This involves tradeoffs of course and may not work but it's worth a > shot! That does sound

Re: [GENERAL] Ltree - how to sort nodes on parent node

2010-04-20 Thread Alban Hertroys
On 19 Apr 2010, at 20:26, cojack wrote: >> Alban Hertroys wrote: >> >> It would help if you'd show us what result you expect from ordering the >> above. >> >> Most people would order this by path I think. However that doesn't match >> your sort column and I can't think of any method that would g

[GENERAL] Culturally aware initcap

2010-04-20 Thread Peter Geoghegan
Hello, I've devised the following function, that performs the same task as initcap, but in a "culturally aware fashion", for English. It solves a common problem I was having with initcap, where the string "ROSEMARY'S baby DOESN'T LIVE HERE anymore" became "Rosemary'S Baby doesn'T Live Here Anymore

[GENERAL] Recognize the creating of duplicate row from trigger

2010-04-20 Thread dipti shah
Hi, I have created a trigger which updates the correspondign LogTable for PrimaryTable. If the insert to LogTable would create a duplicate row then the trigger should take no action and should return. Could you tell me how could I achieve this? I have all columns as a primary key in LogTable. It i

Re: [GENERAL] Culturally aware initcap

2010-04-20 Thread Peter Geoghegan
Here's the entry to the wiki: http://wiki.postgresql.org/wiki/Culturally_aware_initcap I've added "you've handling" Regards, Peter Geoghegan -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-gene

Re: [GENERAL] Help with tracking!

2010-04-20 Thread Scott Marlowe
2010/4/18 Craig Ringer : > Đỗ Ngọc Trí Cường wrote: >> Dear all, >> >> I've a problem but I search all the help file and can't find the solution. >> >> I want to track all action of a specify role on all or one schema in >> database. >> >> Can you help me? > > You can use statement-level logging, t

Re: [GENERAL] Help with tracking!

2010-04-20 Thread Devrim GÜNDÜZ
On Tue, 2010-04-20 at 06:03 -0600, Scott Marlowe wrote: > Wouldn't this work: > > alter user smarlowe set log_statement = 'all'; IIRC it only works inside the given session (so it needs to be run each time a query will be executed) -- Devrim GÜNDÜZ PostgreSQL Danışmanı/Consultant, Red Hat Certi

Re: [GENERAL] Ltree - how to sort nodes on parent node

2010-04-20 Thread cojack
> Alban Hertroys wrote: > > > Aha, looks like you want to sort each tree level by some user-specified > order. > > You should realise that ltree was contributed before Postgres supported > (recursive) CTE's. If you're using ltree in combination with recursive > CTE's you're doing twice the work

Re: [GENERAL] Int64GetDatum

2010-04-20 Thread Tom Lane
John R Pierce writes: > Bruce Momjian wrote: >> Ah, good idea. Is pg_config.h the only file that varies from 32 to >> 64-bit? > it *appears* to be here, but I don't have the 64 bit file set to compare > with. there are definately a couple other files that get generated by > ./configure, inclu

Re: [GENERAL] tar error, in pg_start_backup()

2010-04-20 Thread Bruce Momjian
Magnus Hagander wrote: > . > > On Fri, Apr 16, 2010 at 11:55 AM, raghavendra t > wrote: > > Hi All, > > > > For?some setups reason, i started taking Hot backup. In this course I have > > first issued pg_start_backup('backup') and went to the data directory for > > backing up in OS format using

[GENERAL] Specific Database Vars

2010-04-20 Thread Glus Xof
Hi guys, I'm a newbie using PostgreSQL. I know that can use one-row tables but, I'd like to know if it's possible to define variables attached to one specific database, & saveables when the database tables are dumped. Glus -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] Help with tracking!

2010-04-20 Thread Scott Marlowe
On Tue, Apr 20, 2010 at 6:11 AM, Devrim GÜNDÜZ wrote: > On Tue, 2010-04-20 at 06:03 -0600, Scott Marlowe wrote: >> Wouldn't this work: >> >> alter user smarlowe set log_statement = 'all'; > > IIRC it only works inside the given session (so it needs to be run each > time a query will be executed)

Re: [GENERAL] Help with tracking!

2010-04-20 Thread Scott Marlowe
On Tue, Apr 20, 2010 at 8:31 AM, Scott Marlowe wrote: > On Tue, Apr 20, 2010 at 6:11 AM, Devrim GÜNDÜZ wrote: >> On Tue, 2010-04-20 at 06:03 -0600, Scott Marlowe wrote: >>> Wouldn't this work: >>> >>> alter user smarlowe set log_statement = 'all'; >> >> IIRC it only works inside the given session

Re: [GENERAL] How to insert Ecoded values into postrgresql

2010-04-20 Thread Bruce Momjian
Tom Lane wrote: > Merlin Moncure writes: > > *) csv is supposed to be CRLF *always*. We do not do this. We do > > however read different types of newlines. So we are a 4180 reader but > > not an emitter. Not so sure if I think changing this is a good idea > > though without exposing a knob. >

Re: [GENERAL] How to insert Ecoded values into postrgresql

2010-04-20 Thread Tom Lane
Bruce Momjian writes: > Tom Lane wrote: >> Given the lack of field complaints, I think changing this would be a >> pretty terrible idea; much more likely to break things than fix them. >> It's not like that RFC has huge recognition as The Standard. > Should we document we support the standard? I

[GENERAL] Anyone use Python/ceODBC/PostgreSQL?

2010-04-20 Thread Ozz Nixon
I am trying to get that combination to work, without success. I am running Mac Snow Leopard on my development machine and cannot find anyone who has gotten ceOBDC and libiodbc to work - so I want to ask you guys. Thanks, O. -- Thank you, G.E. Ozz Nixon CEO/Sr. Software Architect 3F, LLC 125

[GENERAL] how to debug the codes in the PostgresMain() from the begining of this function to the "for (;;)" loop that handles the connection?

2010-04-20 Thread sunpeng
how to debug the codes in the PostgresMain() from the begining of this function to the "for (;;)" loop that handles the connection? if i use eclipse cdt to attach the postgres process forked by postmaster, this part of codes from the begining of this PostgresMain() to the "for (;;)" loop could not

Re: [GENERAL] Ltree - how to sort nodes on parent node

2010-04-20 Thread Harald Fuchs
In article <59670b22-30cb-4e6e-83c8-c1d1036c9...@solfertje.student.utwente.nl>, Alban Hertroys writes: > 2). Drop the ltree column and go with a truly recursive approach, something > like this: > CREATE TABLE node ( > categorytextNOT NULL PRIMARY KEY, > sort_order i

[GENERAL] Specific database vars, again...

2010-04-20 Thread Glus Xof
Hi again, Maybe, I didn't explain my question enough. I need to record properties that belongs to an specific database (and so, they work at database level... not at global scope: * Could I use the \set statements ? but... the vars defined are not in a database scope but a global, aren't they ?.

Re: [GENERAL] Ltree - how to sort nodes on parent node

2010-04-20 Thread Alban Hertroys
On 20 Apr 2010, at 18:05, Harald Fuchs wrote: > Here's a working version: > > WITH RECURSIVE tree (path, category, sort_order, parent) AS ( >SELECT category, category, sort_order::text, parent >FROM node >WHERE parent IS NULL > UNION ALL >SELECT t.path || '.' || n.category, >

Re: [GENERAL] Ltree - how to sort nodes on parent node

2010-04-20 Thread Alban Hertroys
On 20 Apr 2010, at 11:59, cojack wrote: >> 1). The way you're doing this in your new examples should work, although >> I'd probably make the ordering numbers part of the category names and >> split those off when I read them. For example: >> 27 | 1|Top >> 28 | 1|Top.1|Science >>

Re: [GENERAL] Ltree - how to sort nodes on parent node

2010-04-20 Thread Peter Hunsberger
On Tue, Apr 20, 2010 at 1:58 PM, Alban Hertroys wrote: > On 20 Apr 2010, at 11:59, cojack wrote: > > >> I am not interested about recursive queries, i think this kill ltree idea. > > > And IMHO it should. ltree is from a time when we didn't have any other means > to describe data organised as a t

[GENERAL] Can the log_statement parameter be set at the user level?

2010-04-20 Thread Arnold, Sandra
Can the log_statement configuration parameter be set at the user level? For auditing purposes I need to capture certain statements being executed by specific accounts. However, there are some accounts that it would be nice not to be logging this information nor is it required. If log_statemen

Re: [GENERAL] Ltree - how to sort nodes on parent node

2010-04-20 Thread Harald Fuchs
In article <1f96e061-713c-4929-a7d9-278e5b608...@solfertje.student.utwente.nl>, Alban Hertroys writes: > On 20 Apr 2010, at 18:05, Harald Fuchs wrote: >> Here's a working version: >> >> WITH RECURSIVE tree (path, category, sort_order, parent) AS ( >> SELECT category, category, sort_order::text,

[GENERAL] How to terminate a query

2010-04-20 Thread A B
Hi there! select * from pg_stat_activity; shows me a select my_function() query that has been running for too long. How do I kill it? kill -9 of the procpid seems to kill the entire server process. So I'm not really comfortable with that. The query was started by a webscript that was close

[GENERAL] Rollback Failure

2010-04-20 Thread mai fawzy
Hi all, I have a transaction where I get a rollback failure if a sql error is returned. I dont know why the rollback fails!! Does anyone have any suggestions or information about this case? Thanks & B.R, Mai Fawzy

[GENERAL] Re: [ADMIN] Can the log_statement parameter be set at the user level?

2010-04-20 Thread Kevin Grittner
"Arnold, Sandra" wrote: > Can the log_statement configuration parameter be set at the user level? ALTER USER userid SET log_statement = 'none'; -Kevin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailp

Re: [GENERAL] Rollback Failure

2010-04-20 Thread Scott Marlowe
On Tue, Apr 20, 2010 at 2:54 PM, mai fawzy wrote: > Hi all, > I have a transaction where I get a rollback failure if a sql error is > returned. I dont know why  the rollback fails!! > Does anyone have any suggestions or information about this case? Got a simple test case that can show it? -- Se

Re: [GENERAL] [ADMIN] Can the log_statement parameter be set at the user level?

2010-04-20 Thread Scott Marlowe
On Tue, Apr 20, 2010 at 1:23 PM, Arnold, Sandra wrote: > Can the log_statement configuration parameter be set at the user level?  For > auditing purposes I need to capture certain statements being executed by > specific accounts.  However, there are some accounts that it would be nice > not to be

Re: [GENERAL] How to terminate a query

2010-04-20 Thread Scott Marlowe
On Tue, Apr 20, 2010 at 2:42 PM, A B wrote: > Hi there! > > select * from pg_stat_activity; > shows me a >  select my_function() > query that has been running for too long. > How do I kill it? select pg_cancel_backend(pid); will kill a running query. > kill -9 of the procpid seems  to kill t

[GENERAL] Performance impact of log streaming replication

2010-04-20 Thread Andy
What is the expected performance impact of the log streaming replication in 9.0? In the past I've used the log shipping replication of MySQL and it caused the performance of the master to drop by almost 50%. Just wondered if Postgresql's replication is expected to behave similarly. --

[GENERAL] Performance impact of log streaming replication

2010-04-20 Thread Andy
What is the expected performance impact of the log streaming replication in 9.0? In the past I've used the log shipping replication of MySQL and it caused the performance of the master to drop by almost 50%. Just wondered if Postgresql's replication is expected to behave similarly. --

Re: [GENERAL] Performance impact of log streaming replication

2010-04-20 Thread Scott Marlowe
On Tue, Apr 20, 2010 at 3:48 PM, Andy wrote: > What is the expected performance impact of the log streaming replication in > 9.0? > > In the past I've used the log shipping replication of MySQL and it caused the > performance of the master to drop by almost 50%. Just wondered if > Postgresql's

Re: [GENERAL] Performance impact of log streaming replication

2010-04-20 Thread Andy
> Whoa!  Sounds like a slow disk IO subsystem, or the > inability to take > advantage of a fast one. > > PostgreSQL's PITR replication is already a working part of > pgsql.  Hot > stanbys are due in 9.0, and should produce no more load > than they > already do in 8.4 or 8.3.  Have you tried setti

Re: [GENERAL] Help with tracking!

2010-04-20 Thread Craig Ringer
On 20/04/2010 10:33 PM, Scott Marlowe wrote: psql show log_statement; log_statement --- all Note however that other sessions won't see the change. Only connections that come after the change will see it. Also, as the OP wants to use it for auditing, it's worth noting that i

Re: [GENERAL] Performance impact of log streaming replication

2010-04-20 Thread Craig Ringer
On 21/04/2010 5:15 AM, Andy wrote: What is the expected performance impact of the log streaming replication in 9.0? In the past I've used the log shipping replication of MySQL and it caused the performance of the master to drop by almost 50%. Just wondered if Postgresql's replication is expect

Re: [GENERAL] Help with tracking!

2010-04-20 Thread Steve Crawford
Craig Ringer wrote: On 20/04/2010 10:33 PM, Scott Marlowe wrote: psql show log_statement; log_statement --- all Note however that other sessions won't see the change. Only connections that come after the change will see it. Also, as the OP wants to use it for auditing, it's

Re: [GENERAL] Help with tracking!

2010-04-20 Thread Craig Ringer
On 21/04/2010 8:10 AM, Steve Crawford wrote: From the docs for log_statement: "Only superusers can change this setting. " Argh. Thankyou. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mai

Re: [GENERAL] Performance impact of log streaming replication

2010-04-20 Thread Greg Smith
Andy wrote: What is the expected performance impact of the log streaming replication in 9.0? In the past I've used the log shipping replication of MySQL and it caused the performance of the master to drop by almost 50%. Just wondered if Postgresql's replication is expected to behave similarly.

Re: [GENERAL] tar error, in pg_start_backup()

2010-04-20 Thread raghavendra t
Hi All, Thank you Magnus, Bruce...!! Regards Raghavendra On Tue, Apr 20, 2010 at 7:20 PM, Bruce Momjian wrote: > Magnus Hagander wrote: > > . > > > > On Fri, Apr 16, 2010 at 11:55 AM, raghavendra t > > wrote: > > > Hi All, > > > > > > For?some setups reason, i started taking Hot backup. In t

[GENERAL] unable to start postgresql server services (Windows XP/Professional/Service Pack3)

2010-04-20 Thread Yan Cheng CHEOK
Recently, I am facing problem for not able to start the PostgreSQL service under one of my machine : Windows XP/Professional/Service Pack3 It had been running no problem previously. I try to run the following command : D:\Program Files\PostgreSQL\8.4\bin>pg_ctl.exe runservice -N "postgresql-8.

Re: [GENERAL] unable to start postgresql server services (Windows XP/Professional/Service Pack3)

2010-04-20 Thread Yan Cheng CHEOK
And the log message (D:\Program Files\PostgreSQL\8.4\data\pg_log) is as follow : 2010-04-21 13:34:58 MYTLOG: database system was interrupted; last known up at 2010-04-08 14:26:26 MYT 2010-04-21 13:34:58 MYTLOG: could not open file "pg_xlog/000100090041" (log file 9, segment 65): N

Re: [GENERAL] unable to start postgresql server services (Windows XP/Professional/Service Pack3)

2010-04-20 Thread Yan Cheng CHEOK
Using the command solve the problem. Bravo! D:\Program Files\PostgreSQL\8.4\bin>pg_resetxlog -f "D:\Program Files\PostgreSQL\8.4\data" Transaction log reset Thanks and Regards Yan Cheng CHEOK --- On Wed, 4/21/10, Yan Cheng CHEOK wrote: > From: Yan Cheng CHEOK > Subject: Re: unable to start

Re: [GENERAL] How to terminate a query

2010-04-20 Thread A B
> select pg_cancel_backend(pid); > will kill a running query. Thanks. > Sometimes cancel_backend fails because there's no point where the code > checks for a cancel. What would such a point in the code look like? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make cha

Re: [GENERAL] unable to start postgresql server services (Windows XP/Professional/Service Pack3)

2010-04-20 Thread Scott Marlowe
On Tue, Apr 20, 2010 at 11:47 PM, Yan Cheng CHEOK wrote: > Using the command solve the problem. Bravo! > > D:\Program Files\PostgreSQL\8.4\bin>pg_resetxlog -f "D:\Program > Files\PostgreSQL\8.4\data" Just so you know you may (likely will) lose some transactions. -- Sent via pgsql-general maili

[GENERAL] Tablespace Problem

2010-04-20 Thread Kalai R
Sir, I have found a problem in my database. The following error occurs sometime not any specific database operation. ERROR:XX000:count not create temporary file "pg_tblspc/86014/pgsql_tmp/pgsql_tmp3568.0":No such file or directory. The above error received from the databas