Re: [GENERAL] recovery via base + WAL replay failure

2008-08-04 Thread Magnus Hagander
Rob Adams wrote: > I'm trying to demonstrate recovery using the "continuous archiving" > backup technique. I'm using 8.3 on Windows. > > I made a base backup while the postgres was running using the following > batch file: > > -- > psql -d test_database -U user_name -c "S

[GENERAL] postgres-r patch: autoconf/make problem

2008-08-04 Thread Markus Lehmann
hi, I am trying to compile the postgres-r patch, but ran into problems.. Probably just a simple lack of understanding of the make system. Any help is appreciated. I got the CVS head for postgres on Jul-31 and applying the Jul-31 patch from here: http://www.postgres-r.org/downloads/. The patch a

Re: [GENERAL] bytea encode performance issues

2008-08-04 Thread Tomasz Ostrowski
On 2008-08-03 12:12, Sim Zacks wrote: > SELECT m.message_idnr,k.messageblk > FROM dbmail_messageblks k > JOIN dbmail_physmessage p ON k.physmessage_id = p.id > JOIN dbmail_messages m ON p.id = m.physmessage_id > WHERE > mailbox_idnr = 8 > AND status IN (0,1 ) > AND k.is_header = '0' > GROUP BY

[GENERAL] Efficient data structures and UI for product matrix

2008-08-04 Thread Markus Wollny
Hi! We wish to provide our users with a simple-to-use web-based processor-selection tool, where a user could select a couple of attribute values and be presented with a list of matching processors. The basis of the required data would be provided by our editors as Excel documents of the followi

[GENERAL] Fwd: Returning Cursor

2008-08-04 Thread ravi kiran
Hello, I am a developer working on postgres. I just wrote a function which ll return a refcurosor as shown below. CREATE OR REPLACE FUNCTION reffunc(refcursor) RETURNS refcursor AS $BODY$ BEGIN OPEN $1 FOR SELECT * FROM SAM1; RETURN $1; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE COST

[GENERAL] Fwd: Returning Cursor

2008-08-04 Thread ravi kiran
Hello, I am a developer working on postgres. I just wrote a function which ll return a refcurosor as shown below. CREATE OR REPLACE FUNCTION reffunc(refcursor) RETURNS refcursor AS $BODY$ BEGIN OPEN $1 FOR SELECT * FROM SAM1; RETURN $1; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE COST

Re: [GENERAL] eliminating records not in (select id ... so SLOW?

2008-08-04 Thread Ivan Sergio Borgonovo
On Fri, 01 Aug 2008 10:33:59 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > > Well I reached 3Gb of work_mem and still I got: > > > "Seq Scan on catalog_categoryitem (cost=31747.84..4019284477.13 > > rows=475532 width=6)" > > " Filter: (NOT (subp

[GENERAL] index speed and failed expectations?

2008-08-04 Thread rihad
sol=> \d stats; Table "public.stats" Column| Type | Modifiers --++--- id | integer| not null start_time | timestamp(0) without time zone | not null ... Index

Re: [GENERAL] index speed and failed expectations?

2008-08-04 Thread Adam Rich
> This query from the console: > > select * from stats order by start_time; > > takes 8 seconds before starting its output. Am I wrong in assuming that > the index on start_time should make ORDER BY orders of magnitude > faster? > Or is this already fast enough? Or should I max up some memory (bu

Re: [GENERAL] index speed and failed expectations?

2008-08-04 Thread rihad
Adam Rich wrote: This query from the console: select * from stats order by start_time; takes 8 seconds before starting its output. Am I wrong in assuming that the index on start_time should make ORDER BY orders of magnitude faster? Or is this already fast enough? Or should I max up some memory

Re: [GENERAL] bytea encode performance issues

2008-08-04 Thread Tom Lane
Sim Zacks <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Could we see EXPLAIN ANALYZE, not EXPLAIN? Without actual facts >> to work from, any suggestions would be mere guesswork. > " -> Seq Scan on dbmail_messageblks k > (cost=0.00..39193.21 rows=259 width=764) (actual time=30.662

Re: [GENERAL] index speed and failed expectations?

2008-08-04 Thread Tom Lane
"Adam Rich" <[EMAIL PROTECTED]> writes: >> This query from the console: >> select * from stats order by start_time; >> takes 8 seconds before starting its output. Am I wrong in assuming that >> the index on start_time should make ORDER BY orders of magnitude >> faster? > Postgresql won't use the i

Re: [GENERAL] index speed and failed expectations?

2008-08-04 Thread Glyn Astill
> > > > However, if you limit the number of rows enough, you > might force it > > to use an index: > > > > select * from stats order by start_time limit 1000; > > > > Thanks! Since LIMIT/OFFSET is the typical usage pattern for > a paginated > data set accessed from the Web (which is my case),

Re: [GENERAL] index speed and failed expectations?

2008-08-04 Thread Michael Fuhr
On Mon, Aug 04, 2008 at 08:35:28AM -0500, Adam Rich wrote: > > This query from the console: > > > > select * from stats order by start_time; > > > > takes 8 seconds before starting its output. Am I wrong in assuming that > > the index on start_time should make ORDER BY orders of magnitude > > fas

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-08-04 Thread Kedar
Julio Cesar Sánchez González wrote: > A B wrote: >> I have a table with rows like this >> A 1 >> A 1 >> B 3 >> B 3 >> C 44 >> C 44 >> and so on. >> >> and I want it to be >> A 1 >> B 3 >> C 44 >> >> so how can I remove the all the duplicate lines but one? >> >> You think this would help? create t

[GENERAL] Howto disable login?

2008-08-04 Thread Teemu Juntunen
Hi all, is there some way to disable and enable login in PostgreSQL? I would like to have only local login enabled when the server starts and make some checks before allowing general login. Best regards and thanks, Teemu Juntunen

Re: [GENERAL] recovery via base + WAL replay failure

2008-08-04 Thread Greg Smith
On Sun, 3 Aug 2008, Rob Adams wrote: I made a base backup while the postgres was running using the following batch file: psql -d test_database -U user_name -c "SELECT pg_start_backup('test');" What did you have archive_command set to? That needs to dump the WAL files generated while the bac

[GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Rajarshi Guha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have a table of the form aid cid - - 1 123 2 456 3 667 3 879 3 123 4 878 4 456 4 123 5 999 5 667 5 879 My goal is to identify for each pair of cid values, the number of ti

Re: [GENERAL] recovery via base + WAL replay failure

2008-08-04 Thread Lennin Caro
what error show the log file? --- On Mon, 8/4/08, Greg Smith <[EMAIL PROTECTED]> wrote: > From: Greg Smith <[EMAIL PROTECTED]> > Subject: Re: [GENERAL] recovery via base + WAL replay failure > To: "Rob Adams" <[EMAIL PROTECTED]> > Cc: "postgres general" > Date: Monday, August 4, 2008, 5:58 PM >

Re: [GENERAL] recovery via base + WAL replay failure

2008-08-04 Thread Rob Adams
The WAL file archiving appears to be working correctly. These are the settings I'm using for archiving the WAL files: archive_mode = on archive_command = 'copy %p C:\backup\%f /A' archive_timeout = 15s Thanks again, --Rob Greg Smith wrote: On Sun, 3 Aug 2008, Rob Adams wrote: I made a b

Re: [GENERAL] Howto disable login?

2008-08-04 Thread Roberts, Jon
You can using the pg_hba.conf file. Set the non-local accounts to reject when you start the database. After you finish your scripts, change the pg_hba.conf file to enable logins and then use pg_ctl reload to enable the new pg_hba.conf file. host all all 0.0.0.0/0 reject And then change it

Re: [GENERAL] [EMAIL PROTECTED]

2008-08-04 Thread Robert Treat
Hiroshi-san, Is this something specific to windows? If so, should this be consider a bug? Robert Treat On Sunday 03 August 2008 18:01:05 Hiroshi Saito wrote: > Hi. > > Sorry, it was not included in release. > please see, > http://winpg.jp/~saito/pg_work/OSSP_win32/ > > Regards, > Hiroshi Saito

Re: [GENERAL] Howto disable login?

2008-08-04 Thread Martin Gainty
Teemufollow the instructions for implementing SSL in postgreshttp://developer.postgresql.org/pgdocs/postgres/ssl-tcp.htmlbut you'll have to start by compiling in the SSL module into postgres build http://developer.postgresql.org/pgdocs/postgres/install-procedure.html./configure --with-openssl k

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread David Wilson
On Mon, Aug 4, 2008 at 2:08 PM, Rajarshi Guha <[EMAIL PROTECTED]> wrote: > select count(aid) where cid = 123 and cid = 456; > > but I was wondering whether I could construct a single SQL statement to do > this. > > Any pointers would be appreciated, Typed into gmail, so may need some tweaking, bu

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Scott Marlowe
On Mon, Aug 4, 2008 at 1:02 PM, David Wilson <[EMAIL PROTECTED]> wrote: > On Mon, Aug 4, 2008 at 2:08 PM, Rajarshi Guha <[EMAIL PROTECTED]> wrote: > >> select count(aid) where cid = 123 and cid = 456; >> >> but I was wondering whether I could construct a single SQL statement to do >> this. >> >> An

Re: [GENERAL] recovery via base + WAL replay failure

2008-08-04 Thread Rob Adams
There is nothing in the log file (in pg_log dir) with regard to this. Should I set any particular parameter in the postgresql.conf file to log information about a failed startup? I have not altered or uncommented any lines in the "ERROR REPORTING AND LOGGING" section of the conf file. Thanks

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Francisco Reyes
On 2:08 pm 08/04/08 Rajarshi Guha <[EMAIL PROTECTED]> wrote: > paircount > - - > 123 & 456 1 > 667 & 879 2 create temp table aic_cid ( id smallint, cid smallint ); insert into aic_cid values (1,123); insert into aic_cid values (2,456); insert into aic_cid values (3,66

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Rajarshi Guha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: On 2:08 pm 08/04/08 Rajarshi Guha <[EMAIL PROTECTED]> wrote: paircount - - 123 & 456 1 667 & 879 2 select a.cid as ac, b.cid as bc, count(*) from aic_cid a left

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Ragnar
On mán, 2008-08-04 at 17:00 -0400, Rajarshi Guha wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: > > On 2:08 pm 08/04/08 Rajarshi Guha <[EMAIL PROTECTED]> wrote: > >> paircount > >> - - > >> 123 & 456 1 >

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Rainer Pruy
Rajarshi Guha wrote > > On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: >> On 2:08 pm 08/04/08 Rajarshi Guha <[EMAIL PROTECTED]> wrote: >>> paircount >>> - - >>> 123 & 456 1 >>> 667 & 879 2 > > > >> select a.cid as ac, b.cid as bc, count(*) from aic_cid a left

Re: [GENERAL] Initdb problem on debian mips cobalt: Bus error

2008-08-04 Thread Glyn Astill
Heres a backtrace on a fresh core file http://privatepaste.com/911BTjYrY1 Does this change get us any closer? --- On Tue, 22/7/08, Glyn Astill <[EMAIL PROTECTED]> wrote: > From: Glyn Astill <[EMAIL PROTECTED]> > Subject: Re: [GENERAL] Initdb problem on debian mips cobalt: Bus error > To: "Tom

Re: [GENERAL] [EMAIL PROTECTED]

2008-08-04 Thread Hiroshi Saito
Hi Robert-san Ahh yes.. I'm sorry delaying release bugfix was not included in pg8.3.3. Then,I will adjust next release(1.6.3/4) with Rarf-san again. Regards, Hiroshi Saito. >Hiroshi-san, > >Is this something specific to windows? If so, should this be consider a bug? > >Robert Treat > >On Sunda

Re: [GENERAL] recovery via base + WAL replay failure

2008-08-04 Thread Rob Adams
I found error log entries in the Windows Event Viewer: 2008-08-01 23:57:55 GMT FATAL: could not remove old lock file "postmaster.pid": Permission denied 2008-08-01 23:57:55 GMT HINT: The file seems accidentally left over, but it could not be removed. Please remove the file

Re: [GENERAL] Initdb problem on debian mips cobalt: Bus error

2008-08-04 Thread Tom Lane
Glyn Astill <[EMAIL PROTECTED]> writes: > Heres a backtrace on a fresh core file > http://privatepaste.com/911BTjYrY1 > Does this change get us any closer? Not really ... there's no plausible reason to crash there, either. Just for entertainment's sake, try recompiling with -O0 instead of the def

Re: [GENERAL] Initdb problem on debian mips cobalt: Bus error

2008-08-04 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > (Rather than trying to browbeat configure into doing this, I'd suggest > manually adjusting CFLAGS in src/Makefile.global, then "make clean" and > rebuild.) eh? either of these should work fine: ./configure --enable-debug CFLAGS=-O0 CFLAGS=-O0 ./configu

Re: [GENERAL] Initdb problem on debian mips cobalt: Bus error

2008-08-04 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > "Tom Lane" <[EMAIL PROTECTED]> writes: >> (Rather than trying to browbeat configure into doing this, I'd suggest >> manually adjusting CFLAGS in src/Makefile.global, then "make clean" and >> rebuild.) > eh? either of these should work fine: > ./configur

Re: [GENERAL] Initdb problem on debian mips cobalt: Bus error

2008-08-04 Thread Alvaro Herrera
Gregory Stark wrote: > "Tom Lane" <[EMAIL PROTECTED]> writes: > > > (Rather than trying to browbeat configure into doing this, I'd suggest > > manually adjusting CFLAGS in src/Makefile.global, then "make clean" and > > rebuild.) > > eh? either of these should work fine: > > ./configure --enable

Re: [GENERAL] Fwd: Returning Cursor

2008-08-04 Thread Craig Ringer
ravi kiran wrote: > Hello, > > I am a developer working on postgres. I just wrote a function which ll > return a refcurosor as shown below. [snip] > i have problems accessing this function from my middle tier i.e VC++. > > I wrote a VC statement to retrieve values from this refcursor using a re

[GENERAL] Easy way to alias all columns in a table by adding a prefix or suffix?

2008-08-04 Thread D. Dante Lorenso
All, I have 2 tables with a lot of columns with similar names. I'd like to join both tables and include all columns from each without naming collisions. I can use the 'AS' to rename a single column, but is there a way to do the rename in bulk by just appending a prefix or suffix to the colu

Re: [GENERAL] bytea encode performance issues

2008-08-04 Thread Sim Zacks
Results below: > ... but given that, I wonder whether the cost isn't from fetching > the toasted messageblk data, and nothing directly to do with either > the encode() call or the ~~ test. It would be interesting to compare > the results of > > explain analyze select encode(messageblk, 'escape')