[GENERAL] Permission template

2008-03-15 Thread Alban Hertroys
Hi all, Reading up on the recent (and recurring) discussion about granting privileges on multiple tables I suddenly wondered whether the CREATE TABLE LIKE approach could be used to copy privileges to a to-be- created table. From the documentation it doesn't look like it, but wouldn't that

Re: [GENERAL] Percent-encod ing conversion to binary, %C2%A9 = ©

2008-03-15 Thread Martijn van Oosterhout
On Thu, Mar 13, 2008 at 03:49:37PM +0100, Hans Schou wrote: Hi I have a little trouble with the chr() function. I have a string like this: Copyright+%C2%A9+1856+Na%C3%AFve+retros%C2%AE which should be converted to binary string like: Copyright © 1856 Naïve retros® Is there an easy way

Re: [GENERAL] postgre vs MySQL

2008-03-15 Thread Ron Mayer
Greg Smith wrote: On Fri, 14 Mar 2008, Andrej Ricnik-Bay wrote: A silly question in this context: If we know of a company that does use PostgreSQL but doesn't list it anywhere ... can we take the liberty to publicise this somewhere anyway? I notice Oracle (and sleepycat before them) had a

Re: [GENERAL] Trouble with Savepoints in postgres

2008-03-15 Thread sam
On Mar 12, 3:31 pm, sam [EMAIL PROTECTED] wrote: On Mar 12, 8:11 am, [EMAIL PROTECTED] (Alvaro Herrera) wrote: Please always ensure that the list is copied on replies (use Reply to all) so that other people can help you. sam escribió: On Mar 11, 5:39 pm, [EMAIL PROTECTED] (Alvaro

Re: [GENERAL] Trouble with Savepoints in postgres

2008-03-15 Thread Tom Lane
sam [EMAIL PROTECTED] writes: Ok i realised that the only way data can be committed within a procedure is to use nested BEGIN..END. Nothing that you said in this message is correct. You can't commit anything within a function, and bare BEGIN/END don't do anything at all except create a

Re: [GENERAL] Trouble with Savepoints in postgres

2008-03-15 Thread Craig Ringer
sam wrote: FUNCTION UPDATE () BEGIN UPDATE statement EXCEPTION END when one record fails data only for that is rolled back the rest of the data is saved. EXCEPTION has to be caught. As I recently found out, too many savepoints really kill PostgreSQL's performance in a transaction. A

Re: [GENERAL] Reindex does not finish 8.2.6

2008-03-15 Thread Clodoaldo
2008/3/13, Alvaro Herrera [EMAIL PROTECTED]: Clodoaldo escribió: 2008/3/13, Alvaro Herrera [EMAIL PROTECTED]: Clodoaldo escribió: Now what is happening is that reindex does not finish even with a small 6,500 rows table and after a reboot. In top there is no CPU or

[GENERAL] Loging of postgres requests

2008-03-15 Thread Dave Potts
I am using a 3rd front end to generate postgres requests , its reportng an error with the database. Is there anyway of loging which sql requests the application is actual sending to postgres. I need to known if the error is being created by the application generating invalid SQL or if

Re: [GENERAL] Loging of postgres requests

2008-03-15 Thread Adrian Klaver
On Saturday 15 March 2008 2:29 pm, Dave Potts wrote: I am using a 3rd front end to generate postgres requests , its reportng an error with the database. Is there anyway of loging which sql requests the application is actual sending to postgres. I need to known if the error is being created

[GENERAL] how to make this database / query faster

2008-03-15 Thread mark
Hi I use postgres v 8.3 on a dual quad core, intel xeon [EMAIL PROTECTED], fedora core 8 x86_64, and 32GB RAM settings i changed on postgresql.conf: shared_buffers = 1000MB # min 128kB or max_connections*16kB effective_cache_size = 4000MB I have a user table structure is

Re: [GENERAL] Loging of postgres requests

2008-03-15 Thread Terry Fielder
You can turn up the verbosity of postgres logger to log all SQL statements. Look in postgresql.conf In particular, you can set postgres to log statements that take over x milliseconds to execute. If you set log_min_duration_statement to 0, then it will log ALL statements, which could also

Re: [GENERAL] how to make this database / query faster

2008-03-15 Thread Richard Broersma
On Sat, Mar 15, 2008 at 4:21 PM, mark [EMAIL PROTECTED] wrote: select * from users where session_key is not Null order by id offset OFFSET limit 300 OFFSET actually scans past all of the records that specify in the OFFSET. So the bigger your offset the longer the scan will be. One solution

Re: [GENERAL] how to make this database / query faster

2008-03-15 Thread mark
On Sat, Mar 15, 2008 at 4:37 PM, Richard Broersma [EMAIL PROTECTED] wrote: On Sat, Mar 15, 2008 at 4:21 PM, mark [EMAIL PROTECTED] wrote: select * from users where session_key is not Null order by id offset OFFSET limit 300 One solution is to retain the last ID from the previous scan:

Re: [GENERAL] how to make this database / query faster

2008-03-15 Thread Richard Broersma
On Sat, Mar 15, 2008 at 4:41 PM, mark [EMAIL PROTECTED] wrote: On Sat, Mar 15, 2008 at 4:37 PM, Richard Broersma [EMAIL PROTECTED] wrote: On Sat, Mar 15, 2008 at 4:21 PM, mark [EMAIL PROTECTED] wrote: select * from users where session_key is not Null order by id offset OFFSET

Re: [GENERAL] how to make this database / query faster

2008-03-15 Thread brian
Richard Broersma wrote: On Sat, Mar 15, 2008 at 4:41 PM, mark [EMAIL PROTECTED] wrote: On Sat, Mar 15, 2008 at 4:37 PM, Richard Broersma [EMAIL PROTECTED] wrote: On Sat, Mar 15, 2008 at 4:21 PM, mark [EMAIL PROTECTED] wrote: select * from users where session_key is not Null order by id

Re: [GENERAL] how to make this database / query faster

2008-03-15 Thread mark
On Sat, Mar 15, 2008 at 5:04 PM, brian [EMAIL PROTECTED] wrote: Richard Broersma wrote: On Sat, Mar 15, 2008 at 4:41 PM, mark [EMAIL PROTECTED] wrote: On Sat, Mar 15, 2008 at 4:37 PM, Richard Broersma [EMAIL PROTECTED] wrote: On Sat, Mar 15, 2008 at 4:21 PM, mark [EMAIL PROTECTED]

Re: [GENERAL] how to make this database / query faster

2008-03-15 Thread brian
mark wrote: On Sat, Mar 15, 2008 at 5:04 PM, brian [EMAIL PROTECTED] wrote: As there's an index on id would it be faster to transpose the WHERE conditions? WHERE id your_last_id AND session_key IS NOT NULL I can't remember if the order of WHERE is significant. brian, i have an index on

Re: [GENERAL] Loging of postgres requests

2008-03-15 Thread Dave Potts
Thanks everbody I have isolated the issue Davel, Terry Fielder wrote: You can turn up the verbosity of postgres logger to log all SQL statements. Look in postgresql.conf In particular, you can set postgres to log statements that take over x milliseconds to execute. If you set