Re: [GENERAL] How to capture an interactive psql session in a log file?

2009-04-02 Thread Scott Marlowe
On Thu, Apr 2, 2009 at 11:55 PM, Gordon Shannon wrote: > > What I'm trying to do doesn't seem like it should be that difficult or > unusual, but I can't seem to find the right combination of commands to make > it happen.  I want to have a log file that captures everything from an > interactive psq

Re: [GENERAL] How to capture an interactive psql session in a log file?

2009-04-02 Thread Gordon Shannon
That does the trick, awesome! I do think it would be great if psql had a "stderr" capture in addition to stdout. Thanks hubert depesz lubaczewski-2 wrote: > > On Thu, Apr 02, 2009 at 10:55:10PM -0700, Gordon Shannon wrote: >> Has anyone solved this issue before? > > have you seen program "sc

Re: [GENERAL] How to capture an interactive psql session in a log file?

2009-04-02 Thread hubert depesz lubaczewski
On Thu, Apr 02, 2009 at 10:55:10PM -0700, Gordon Shannon wrote: > Has anyone solved this issue before? have you seen program "script"? usage: just run script you will get shell. now run your command you want to capture everything from - it will work as usual. after you finish - exit the "script-

[GENERAL] How to capture an interactive psql session in a log file?

2009-04-02 Thread Gordon Shannon
What I'm trying to do doesn't seem like it should be that difficult or unusual, but I can't seem to find the right combination of commands to make it happen. I want to have a log file that captures everything from an interactive psql session. Running 8.3.7 with bash shell on Linux. If I use \

Re: [GENERAL] Hello, i want to subscribe...

2009-04-02 Thread itishree sukla
On Fri, Apr 3, 2009 at 2:35 AM, Ricardo Fuentes wrote: > Hello, i want to subscribe to this lists > Hi Ricardo, Here is the link to subscribe. http://www.postgresql.org/community/lists/ Regards, Itishree

Re: [GENERAL] reducing IO and memory usage: sending the content of a table to multiple files

2009-04-02 Thread Scott Marlowe
On Thu, Apr 2, 2009 at 7:05 PM, Sam Mason wrote: > On Thu, Apr 02, 2009 at 09:48:33PM +0200, Ivan Sergio Borgonovo wrote: >> I didn't find any elegant example of cursor use in PHP... OK PHP is >> not the most elegant language around... but still any good exapmle >> someone could point me at? > > I

Re: [GENERAL] slow select in big table

2009-04-02 Thread Scott Marlowe
On Thu, Apr 2, 2009 at 2:48 PM, rafalak wrote: > Hello i have big table > 80mln records, ~6GB data, 2columns (int, int) > > if query > select count(col1) from tab where col2=1234; > return low records (1-10) time is good 30-40ms > but when records is >1000 time is >12s > > > How to increse perform

[GENERAL] Re: [GENERAL] Re: [GENERAL] R e: [GENERAL] ERROR: XX001: could not read block 2354 of relation...

2009-04-02 Thread Craig Ringer
Patrick Desjardins wrote: > Humm, they want to close the AntiVirus for 1 night not anymore. Do you think > that if we take out the database directory of the scan that it will solve > the problem or it really need to have no antivirus on the server? They > really want to keep it... It depends on th

Re: [GENERAL] slow select in big table

2009-04-02 Thread Abbas
On Fri, Apr 3, 2009 at 2:18 AM, rafalak wrote: > Hello i have big table > 80mln records, ~6GB data, 2columns (int, int) > > if query > select count(col1) from tab where col2=1234; > return low records (1-10) time is good 30-40ms > but when records is >1000 time is >12s > > > How to increse perfor

Re: [GENERAL] reducing IO and memory usage: sending the content of a table to multiple files

2009-04-02 Thread Sam Mason
On Thu, Apr 02, 2009 at 09:48:33PM +0200, Ivan Sergio Borgonovo wrote: > I didn't find any elegant example of cursor use in PHP... OK PHP is > not the most elegant language around... but still any good exapmle > someone could point me at? I don't program PHP; but my guess would be something like:

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Sam Mason
On Thu, Apr 02, 2009 at 12:06:01PM -0700, David E. Wheeler wrote: > On Apr 2, 2009, at 11:24 AM, Sam Mason wrote: > >Yes, I'd be tempted to pick one and go with it. It's seems a > >completely arbitrary choice one way or the other but the current > >behaviour is certainly wrong. > > > >I'd go with

Re: [GENERAL] indirect membership in group roles

2009-04-02 Thread Tom Lane
Kev writes: > For some reason, which I couldn't see spelled out very well in the > docs for GRANT ROLE and SET ROLE, indirect membership in the group > "user" doesn't give one its privileges unless you SET ROLE "user" > first, even if all roles involved have INHERIT set. Really? Works for me: r

[GENERAL] indirect membership in group roles

2009-04-02 Thread Kev
Suppose I have some group roles, say "student" and "employee", to which I want to grant another group role, "user". I then want to give privileges to an updateable view "my_preferences" to "user" so that they'll be given to any login role that's a member of "student" or "employee". Seems sensible

[GENERAL] Re: [GENERAL] Re: [GENERAL] ERROR: XX001: could not read block 2354 of relation…

2009-04-02 Thread Patrick Desjardins
Humm, they want to close the AntiVirus for 1 night not anymore. Do you think that if we take out the database directory of the scan that it will solve the problem or it really need to have no antivirus on the server? They really want to keep it... On Wed, Apr 1, 2009 at 1:06 PM, Scott Marlowe wrot

[GENERAL] slow select in big table

2009-04-02 Thread rafalak
Hello i have big table 80mln records, ~6GB data, 2columns (int, int) if query select count(col1) from tab where col2=1234; return low records (1-10) time is good 30-40ms but when records is >1000 time is >12s How to increse performace ? my postgresql.conf shared_buffers = 810MB temp_buffers =

[GENERAL] Hello, i want to subscribe...

2009-04-02 Thread Ricardo Fuentes
Hello, i want to subscribe to this lists

[GENERAL] Thank you

2009-04-02 Thread dfx
Thank you very much to all people!!! I reached the goal using lynx to dowload the rpms and then the "An Almost Idiots's Guide To PostgreSQL YUM" from Postgres OnLine Journal Domenico -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: ht

Re: [GENERAL] Postgresql installation with ssh connection.

2009-04-02 Thread Scott Marlowe
On Thu, Apr 2, 2009 at 12:51 PM, dfx wrote: > dear Sirs, > > is there on the web a simple guide (for "idiots") to install postgresql on > CentOS 5.2 using only a ssh connection? (no web browser, no graphical > capability). My first problem is to download using ftp instead a web > browser. > > The

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Robert Haas
On Thu, Apr 2, 2009 at 2:50 PM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Apr 2, 2009 at 2:18 PM, Tom Lane wrote: >>> If there's a camp that actually *wants* a NULL result for this case, >>> I missed the reasoning. > >> So that we don't break existing apps because of an issue that is >> t

Re: [GENERAL] reducing IO and memory usage: sending the content of a table to multiple files

2009-04-02 Thread Ivan Sergio Borgonovo
On Thu, 2 Apr 2009 17:27:55 +0100 Sam Mason wrote: > On Thu, Apr 02, 2009 at 11:20:02AM +0200, Ivan Sergio Borgonovo > wrote: > > This is the work-flow I've in mind: > > > > 1a) take out *all* data from a table in chunks (M record for each > > file, one big file?) (\copy??, from inside a scriptin

Re: [GENERAL] Postgresql installation with ssh connection.

2009-04-02 Thread Richard Huxton
dfx wrote: dear Sirs, is there on the web a simple guide (for "idiots") to install postgresql on CentOS 5.2 using only a ssh connection? (no web browser, no graphical capability). My first problem is to download using ftp instead a web browser. Try something like "yum install lynx" first -

Re: [GENERAL] Postgresql installation with ssh connection.

2009-04-02 Thread Andrej
2009/4/3 dfx : > dear Sirs, > The default installation (#>yum install opstresql)suggest the version 8.1 > but I would like to install the latest 8.3, so I suppose that I have to > change some file containing yum directive per postgresql. 30 seconds on the postgres website ... ran into this ;} h

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread David E. Wheeler
On Apr 2, 2009, at 11:24 AM, Sam Mason wrote: Yes, I'd be tempted to pick one and go with it. It's seems a completely arbitrary choice one way or the other but the current behaviour is certainly wrong. I'd go with returning a zero element array because it would do the "right thing" more ofte

[GENERAL] Postgresql installation with ssh connection.

2009-04-02 Thread dfx
dear Sirs, is there on the web a simple guide (for "idiots") to install postgresql on CentOS 5.2 using only a ssh connection? (no web browser, no graphical capability). My first problem is to download using ftp instead a web browser. The default installation (#>yum install opstresql)suggest

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Tom Lane
Robert Haas writes: > On Thu, Apr 2, 2009 at 2:18 PM, Tom Lane wrote: >> If there's a camp that actually *wants* a NULL result for this case, >> I missed the reasoning. > So that we don't break existing apps because of an issue that is > trivial to work around. We would only be breaking them if

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Robert Haas
On Thu, Apr 2, 2009 at 2:18 PM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Apr 2, 2009 at 2:04 PM, Tom Lane wrote: >>> Right at the moment, if we stick with the historical definition >>> of the function, *both* camps have to write out their choice of >>> the above.  Seems like this is the

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Sam Mason
On Thu, Apr 02, 2009 at 02:04:41PM -0400, Tom Lane wrote: > A correct fix > outside-the-function would look more like > > case when str = '' then '{}'::text[] else string_to_array(str, ',') end > > which should correctly yield NULL for NULL input and an empty array > for empty input. Similarly,

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Tom Lane
Robert Haas writes: > On Thu, Apr 2, 2009 at 2:04 PM, Tom Lane wrote: >> Right at the moment, if we stick with the historical definition >> of the function, *both* camps have to write out their choice of >> the above.  Seems like this is the worst of all possible worlds. >> We should probably pic

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Robert Haas
On Thu, Apr 2, 2009 at 2:04 PM, Tom Lane wrote: > Right at the moment, if we stick with the historical definition > of the function, *both* camps have to write out their choice of > the above.  Seems like this is the worst of all possible worlds. > We should probably pick one or the other. ISTM t

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Tom Lane
"David E. Wheeler" writes: >> Or we could stick to the current behavior and say "use COALESCE() to >> resolve the ambiguity, if you need to". > Steve has a point that leaving it as-is leaves it as impossible to > tell the difference between string_to_array(NULL, ',') and > string_to_array('',

[GENERAL] Re: [GENERAL] Re: [GENERAL] ERROR: XX001: could not read block 2354 of relation…

2009-04-02 Thread Scott Marlowe
On Thu, Apr 2, 2009 at 11:34 AM, Patrick Desjardins wrote: > Humm, they want to close the AntiVirus for 1 night not anymore. Do you think > that if we take out the database directory of the scan that it will solve > the problem or it really need to have no antivirus on the server? They > really wa

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Robert Haas
On Thu, Apr 2, 2009 at 12:10 PM, David E. Wheeler wrote: > On Apr 1, 2009, at 12:19 PM, Robert Haas wrote: > >>> my @ints = map { $_ || 0 } split ',', $string; >>> >>> This ensures that I get the proper number of records in the example of >>> something like '1,2,,4'. >> >> I can't see that there's

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Robert Haas
On Thu, Apr 2, 2009 at 12:17 PM, David E. Wheeler wrote: > On Apr 1, 2009, at 2:22 PM, Tom Lane wrote: > >> Another way to state the point is that we can offer people a choice of >> two limitations: string_to_array doesn't work for zero-length lists, >> or string_to_array doesn't work for empty st

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Sam Mason
On Thu, Apr 02, 2009 at 09:29:04AM -0700, Steve Crawford wrote: > Leif B. Kristensen wrote: > >Somehow this reminds me of the old "division by zero" problem. > > > >IMO, the proper way to handle this kind of anomaly would be to test if > >the length of the string is non-zero before submitting it t

Re: [GENERAL] How to find the query completeion time?

2009-04-02 Thread Craig Ringer
> In ORACLE I can get that information from V$SESSION_LONGOPS view which will > give the approx TIME_REMAINING to complete running queries. Is there a > similar way in postgres? As far as I know, PostgreSQL has no such facility, and the database server has no idea how long a given query will ta

Re: [GENERAL] cast needed - but where and why?

2009-04-02 Thread Steve Clark
Tom Lane wrote: Steve Clark writes: I am getting the following error after upgrading from 7.4.6 to 8.3.6 and can't figure out what is wrong. Any help would be greatly appreciated. 2009-04-02 10:45:10 EDT:srm2api:ERROR: column "event_ref_log_no" is of type integer but expression is of type tex

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread Steve Crawford
Leif B. Kristensen wrote: On Thursday 2. April 2009, Steve Crawford wrote: Currently string_to_array(null, ',') yields a null result - indistinguishable from string_to_array('',','). Wrapping in coalesce does not help distinguish true null input from empty-string input. I'm not sure at the mo

Re: [GENERAL] reducing IO and memory usage: sending the content of a table to multiple files

2009-04-02 Thread Sam Mason
On Thu, Apr 02, 2009 at 11:20:02AM +0200, Ivan Sergio Borgonovo wrote: > This is the work-flow I've in mind: > > 1a) take out *all* data from a table in chunks (M record for each > file, one big file?) (\copy??, from inside a scripting language?) What about using cursors here? > 2a) process each

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread David E. Wheeler
On Apr 1, 2009, at 2:22 PM, Tom Lane wrote: Another way to state the point is that we can offer people a choice of two limitations: string_to_array doesn't work for zero-length lists, or string_to_array doesn't work for empty strings (except most of the time, it does). The former is sounding le

Re: [HACKERS] [GENERAL] string_to_array with empty input

2009-04-02 Thread David E. Wheeler
On Apr 1, 2009, at 12:19 PM, Robert Haas wrote: my @ints = map { $_ || 0 } split ',', $string; This ensures that I get the proper number of records in the example of something like '1,2,,4'. I can't see that there's any way to do this in SQL regardless of how we define this operation. It'

Re: [GENERAL] Help with C-Function on Postgre

2009-04-02 Thread Sam Mason
On Thu, Apr 02, 2009 at 12:52:40PM +0200, Angelo Nicolosi wrote: > I wanted to write some C-Function Where is this code going to live? if it's going to be "inside" PG as a function you can call from SQL you want something called SPI: http://www.postgresql.org/docs/current/static/spi.html If it

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread linnewbie
On Apr 2, 11:06 am, linnewbie wrote: > On Apr 2, 10:01 am, andreas.kretsch...@schollglas.com ("A. > > > > Kretschmer") wrote: > > In response to linnewbie : > > > > I am using tcl ( ncgi and tclobdc ) so it is more like the excerpts > > > below: > > > > ie I input: > > > > Hello World > > > > xyz

Re: [GENERAL] cast needed - but where and why?

2009-04-02 Thread Tom Lane
Steve Clark writes: > I am getting the following error after upgrading from 7.4.6 to 8.3.6 > and can't figure out what is wrong. Any help would be greatly appreciated. > 2009-04-02 10:45:10 EDT:srm2api:ERROR: column "event_ref_log_no" is of type > integer but expression is of type text at charac

Re: [GENERAL] How to find the query completeion time?

2009-04-02 Thread SHARMILA JOTHIRAJAH
--- On Thu, 4/2/09, Leif B. Kristensen wrote: > From: Leif B. Kristensen > Subject: Re: [GENERAL] How to find the query completeion time? > To: pgsql-general@postgresql.org > Date: Thursday, April 2, 2009, 10:53 AM > On Thursday 2. April 2009, SHARMILA > JOTHIRAJAH wrote: > >Hi, > >Is there a

[GENERAL] cast needed - but where and why?

2009-04-02 Thread Steve Clark
Hello list, I am getting the following error after upgrading from 7.4.6 to 8.3.6 and can't figure out what is wrong. Any help would be greatly appreciated. from our program: sqlcode=-400 errmsg='column "event_ref_log_no" is of type integer but expression is of type text' in line 4138. from pg_

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread linnewbie
On Apr 2, 10:01 am, andreas.kretsch...@schollglas.com ("A. Kretschmer") wrote: > In response to linnewbie : > > > > > I am using tcl ( ncgi and tclobdc ) so it is more like the excerpts > > below: > > > ie I input: > > > Hello World > > > xyz > > . > > > into the text area field, save: >

Re: [GENERAL] How to find the query completeion time?

2009-04-02 Thread Leif B. Kristensen
On Thursday 2. April 2009, SHARMILA JOTHIRAJAH wrote: >Hi, >Is there a way in Postgres to find when a particular query will > finish? > >For example, for a query like this >SELECT * FROM TABLE1 >Can we find out from any of the catalog tables(or any other way) when > this query is likely to complet

[GENERAL] How to find the query completeion time?

2009-04-02 Thread SHARMILA JOTHIRAJAH
Hi, Is there a way in Postgres to find when a particular query will finish? For example, for a query like this SELECT * FROM TABLE1 Can we find out from any of the catalog tables(or any other way) when this query is likely to complete? Thanks -- Sent via pgsql-general mailing list

Re: [GENERAL] possible small contribution to the PostgreSQL manual? Example for two-phase commit section.

2009-04-02 Thread Aleksey Tsalolikhin
On Thu, Apr 2, 2009 at 1:23 AM, Craig Ringer wrote: > > You might want to add this as a comment on the interactive version of the > online documentation, too, so it's not lost when revising the docs for 8.4 / > 8.5 . Done, sir. Thanks! Aleksey -- Aleksey Tsalolikhin UNIX System Administrator

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread Thomas Markus
hi, i'm not a tcl user but it looks like an array representation. try to remove braces [] from page_content. regards. thomas linnewbie schrieb: into the text area field, save: set page_content [ ncgi::value textarea_field_name] database connect dbh $datasource $dbuser $dbpassword set s

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread A. Kretschmer
In response to linnewbie : > I am using tcl ( ncgi and tclobdc ) so it is more like the excerpts > below: > > ie I input: > > Hello World > > xyz > . > > into the text area field, save: > > set page_content [ ncgi::value textarea_field_name] > > database connect dbh $datasource $d

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread linnewbie
On Apr 2, 8:59 am, l...@solumslekt.org ("Leif B. Kristensen") wrote: > On Thursday 2. April 2009, linnewbie wrote: > > >Hi All, > > >I'm fairly new to postgres and I'm having this peculiar problem. > > >I'm storing raw html in a text field and I want users who know HTML to > >update the content in

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread John Cheng
PostgreSQL does not add braces to text. It sounds like a problem with the code you have that inserts and retreives data out of PostgreSQL Let's try a test case: BEGIN; CREATE TEMP TABLE test_table ( foo text ); INSERT INTO test_table (foo) VALUES('foo'); SELECT foo FROM test_table; ROLLBACK

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread Leif B. Kristensen
(CC'ed to the list) On Thursday 2. April 2009, linnewbie wrote: > I am using tcl ( ncgi and tclobdc ) so it is more like the excerpts > below: > >ie I input: > >Hello World > >xyz > >into the text area field, save: > >set page_content [ ncgi::value textarea_field_name] > >database connect dbh

Re: [GENERAL] %r in restore_command?

2009-04-02 Thread Alvaro Herrera
Duco Fijma wrote: > Please allow me to rephrase a question I asked on this list some time > ago. Could somebody shine some light on what exactly influences the > value of the %r parameter in the restore_command (as used in > recovery.conf)? I'm using this in a hot-standby-configuration in

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread Leif B. Kristensen
On Thursday 2. April 2009, linnewbie wrote: >Hi All, > >I'm fairly new to postgres and I'm having this peculiar problem. > >I'm storing raw html in a text field and I want users who know HTML to >update the content in a textarea field. > >The problem is postgres is adding braces to the begining and

[GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread linnewbie
Hi All, I'm fairly new to postgres and I'm having this peculiar problem. I'm storing raw html in a text field and I want users who know HTML to update the content in a textarea field. The problem is postgres is adding braces to the begining and ending of the content. On creation and every time

[GENERAL] Help with C-Function on Postgre

2009-04-02 Thread Angelo Nicolosi
Hi to all, I'm new on this list and also on using postgre. I wanted to write some C-Function but, also if I read all the documentation about it on the Manuals directory on the postgre web page, i still have some problems. I already made some simple works just to try how was working and all went

Re: [GENERAL] %r in restore_command?

2009-04-02 Thread bernhard_s
Hi Duco, sorry that I can't help you. But I want to say, that I have experienced this last week too. In my case there was a power outage before and after restart this happened, so ... ... but would be nice to have a comment from an expert. Regards, Bernhard -- Sent via pgsql-general mailing

[GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread linnewbie
Hi All, I'm fairly new to postgres and I'm having this peculiar problem. I'm storing raw html in a text field and I want users who know HTML to update the content in a textarea field. The problem is postgres is adding braces to the begining and ending of the content. On creation and every time

[GENERAL] reducing IO and memory usage: sending the content of a table to multiple files

2009-04-02 Thread Ivan Sergio Borgonovo
This is the work-flow I've in mind: 1a) take out *all* data from a table in chunks (M record for each file, one big file?) (\copy??, from inside a scripting language?) 2a) process each file with awk to produce N files very similar each other (substantially turn them into very simple xml) 3a) gzip

Re: [GENERAL] possible small contribution to the PostgreSQL manual? Example for two-phase commit section.

2009-04-02 Thread Craig Ringer
Aleksey Tsalolikhin wrote: Hi. We're trying to implement two-phase commit and did not find a complete working example in the manual. We found examples of the separate pieces, but not the sequence in which to put them together. [snip] If there is somebody on this list involved with editing t

Re: [GENERAL] Is there any special way to a trigger send a signal to outer application?

2009-04-02 Thread Craig Ringer
durumdara wrote: Which way is supports by PGSQL trigger? One way you did NOT mention, but you need to look into: use LISTEN and NOTIFY. Whether or not this is suitable depends on how your application is accessing PostgreSQL, as IIRC some database access APIs (eg: ODBC) do not support LISTEN

[GENERAL] Is there any special way to a trigger send a signal to outer application?

2009-04-02 Thread durumdara
Hi! Windows Server, PGSQL. When a new records arrived to the database, I want process them in the background. I have a processor service. This is periodically (5-10 minutes) checking the "message" table, and if there is some message, it is process them. This periodic processing is good, but