Re: [GENERAL] PITR - "Rewind to snapshot" scheme

2007-04-16 Thread Richard Huxton
Martin Langhoff wrote: I have been following and experimenting a bit with PITR for a while, and I wonder whether it is practical to use the PITR hooks to roll back the database to a known state. The scenario is that I am developing a script that will be massaging data in a medium size database. A

Re: [GENERAL] string fields helps

2007-04-16 Thread marcelo Cortez
Thanks Tom! this works. best regards MDC --- Tom Lane <[EMAIL PROTECTED]> escribió: > Bill Moran <[EMAIL PROTECTED]> writes: > > marcelo Cortez <[EMAIL PROTECTED]> wrote: > >> I need to save data on rtf format but , postgres > > >> refuses to storage for backslah or character's > >> pr

Re: [GENERAL] query optimizer

2007-04-16 Thread Tom Lane
"jungmin shin" <[EMAIL PROTECTED]> writes: > As I see the documentation of postgres, postgres use genetic algorithm for > query optimization rather than system R optimizer. right? Only for queries with more than geqo_threshold relations. The join search algorithm for smaller queries is a System-R

[GENERAL] query optimizer

2007-04-16 Thread jungmin shin
Hello, As I see the documentation of postgres, postgres use genetic algorithm for query optimization rather than system R optimizer. right? -- Jungmin Shin

Re: [GENERAL] string fields helps

2007-04-16 Thread Chris
Has anybody written a 'proper escaping function' in php, something along the lines of addslashes()? It has been around for ages: http://php.net/pg_escape_string -- Postgresql & php tutorials http://www.designmagick.com/ ---(end of broadcast)---

Re: [GENERAL] string fields helps

2007-04-16 Thread Michael Nolan
On 4/16/07, Tom Lane <[EMAIL PROTECTED]> wrote: . It's still the case that not using a proper escaping function will come back to haunt you someday, though. Has anybody written a 'proper escaping function' in php, something along the lines of addslashes()? -- Mike Nolan

[GENERAL] pg_standby + test_warm_standby: A Community Report

2007-04-16 Thread Thomas F. O'Connell
After being asked to implement a warm standby server, I was pleased to happen upon Simon's pg_standby contribution. I was even more pleased to discover that it was designed to be compatible with the 8.2.x releases despite not being officially released until 8.3. I was then even more pleased

Re: [GENERAL] string fields helps

2007-04-16 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > marcelo Cortez <[EMAIL PROTECTED]> wrote: >> I need to save data on rtf format but , postgres >> refuses to storage for backslah or character's >> problem's any idea or vice are welcomed best > You need to escape the data before you insert it.

Re: [GENERAL] digest data types?

2007-04-16 Thread Jeff Davis
On Wed, 2007-04-11 at 14:41 -0700, Reece Hart wrote: > Does anyone have postgresql types for message digests, especially md5 > and sha1? > > Obviously I could store these as text (as I currently do), but I'm > particularly interested in custom types that store digests as binary > blobs and provide

Re: [GENERAL] string fields helps

2007-04-16 Thread Bill Moran
marcelo Cortez <[EMAIL PROTECTED]> wrote: > > Folks > > I need to save data on rtf format but , postgres > refuses to storage for backslah or character's > problem's any idea or vice are welcomed best > regards > mdc You need to escape the data before you insert it. This is lan

Re: [GENERAL] Dynamic DDL

2007-04-16 Thread Tom Lane
"Ketema" <[EMAIL PROTECTED]> writes: > I have an example were I have to build a string in the below manner: > values (' || new.tpv_success_id || ',''' || new.order_date || ''',' || > new.tpv_id || ',' || new.ver_code || ',''' || new.agent_name || ''',' > || new.agent_id || ',' > || n

[GENERAL] string fields helps

2007-04-16 Thread marcelo Cortez
Folks I need to save data on rtf format but , postgres refuses to storage for backslah or character's problem's any idea or vice are welcomed best regards mdc pd: sample off data to save ( from postgres log) " UPDATE plbrecord SET documentation = '{\rtf1\ansi\deff0{\fonttbl{\f

[GENERAL] Advanced query rewrite

2007-04-16 Thread Christan Josefsson
Hi! I was looking into the PostgreSQL RULE system in order to define rewriting / redirecting queries under certain conditions. For my part I would like to fully be able to control the query rewrite, e.g by implemening a stored procedure to define the query rewrite results, since as it seems the m

Re: [GENERAL] delete with self join

2007-04-16 Thread Richard Broersma Jr
--- garry saddington <[EMAIL PROTECTED]> wrote: > I am trying this syntax which is my interpretation of the docs: > > delete from siblings s1 using siblings s2 > WHERE s1.principal = s2.principal > and s1.sibling=175 > > Can anyone tell me where I am going wrong? Wh

Re: [GENERAL] Dynamic DDL

2007-04-16 Thread Ketema
On Apr 16, 4:47 pm, [EMAIL PROTECTED] (Martijn van Oosterhout) wrote: > On Mon, Apr 16, 2007 at 01:37:43PM -0700, Ketema wrote: > > create or replace function schema.insert_function(_schema text, _table > > text) returns integer > > > > >set search_path to _schema; > >insert into _table (c

Re: [GENERAL] Dynamic DDL

2007-04-16 Thread Martijn van Oosterhout
On Mon, Apr 16, 2007 at 01:37:43PM -0700, Ketema wrote: > create or replace function schema.insert_function(_schema text, _table > text) returns integer > set search_path to _schema; > insert into _table (columns) values(vals); > is there any whay to get the functionality of above

[GENERAL] delete with self join

2007-04-16 Thread garry saddington
I am trying this syntax which is my interpretation of the docs: delete from siblings s1 using siblings s2 WHERE s1.principal = s2.principal and s1.sibling=175 Can anyone tell me where I am going wrong? regards Garry ---(end of broadcast)--

[GENERAL] Dynamic DDL

2007-04-16 Thread Ketema
create or replace function schema.insert_function(_schema text, _table text) returns integer as $BODY$ declare _affected integer; begin set search_path to _schema; insert into _table (columns) values(vals); return 0; end; $BODY$ language plpgsql; is there any whay to get th

Re: [GENERAL] concatenating setof functions

2007-04-16 Thread Tom Lane
"Frederick Ross" <[EMAIL PROTECTED]> writes: > But say I have a table with an integer column. If I had a pure SQL > function, I could call > select twohundreds(i) from table; > and get a properly concatenated list of the rows resulting from > applying twohundreds to each row of table. This is dep

[GENERAL] concatenating setof functions

2007-04-16 Thread Frederick Ross
I suspect I am missing a much cleaner way of doing this, but say I have a function which returns a setof integer, i.e., create or replace function testfunc (integer) returns setof integer as $$ declare i alias for $1; begin return next i; return next i+100; return; end $$ language

Re: [GENERAL] pg_dump seg fault on sequences

2007-04-16 Thread Tom Lane
I wrote: > The definitional question is: if we selected only the sequence to dump, > do we want that ALTER command to appear in the output or not? It's a > reasonably straightforward fix either way (a bit easier for "not"), > but I'm unsure which is the most useful behavior. There doesn't seem to

Re: [GENERAL] PITR - "Rewind to snapshot" scheme

2007-04-16 Thread Tom Lane
"Martin Langhoff" <[EMAIL PROTECTED]> writes: > I have been following and experimenting a bit with PITR for a while, > and I wonder whether it is practical to use the PITR hooks to roll > back the database to a known state. The scenario is that I am > developing a script that will be massaging data

Re: [GENERAL] one more performance question I cannot test yet :(

2007-04-16 Thread Alvaro Herrera
Sergei Shelukhin escribió: > On Apr 15, 12:13 am, "Sergei Shelukhin" <[EMAIL PROTECTED]> wrote: > > Suppose there's a table with two text fields and a lot of int fields. > > THe table will be huge, updated constantly, and will be searched by > > all of the int fields, whereas text fields will be fo

[GENERAL] autovacuum vacuums entire database...is this right?

2007-04-16 Thread [EMAIL PROTECTED]
Hi, I'm just wondering if autovacuum is ever supposed to vacuum the entire database during one of its runs. As far as I remember, it's supposed to vacuum one table at a time, based on the autovacuum_vacuum_threshold, autovacuum_analyze_threshold, etc. settings. For some reason, autovacuum decide

[GENERAL] PITR - "Rewind to snapshot" scheme

2007-04-16 Thread Martin Langhoff
I have been following and experimenting a bit with PITR for a while, and I wonder whether it is practical to use the PITR hooks to roll back the database to a known state. The scenario is that I am developing a script that will be massaging data in a medium size database. A pg_restore of the prist

Re: [GENERAL] one more performance question I cannot test yet :(

2007-04-16 Thread Sergei Shelukhin
On Apr 15, 12:13 am, "Sergei Shelukhin" <[EMAIL PROTECTED]> wrote: > Suppose there's a table with two text fields and a lot of int fields. > THe table will be huge, updated constantly, and will be searched by > all of the int fields, whereas text fields will be for display only. > > Does it make se

[GENERAL] one more performance question I cannot test yet :(

2007-04-16 Thread Sergei Shelukhin
Suppose there's a table with two text fields and a lot of int fields. THe table will be huge, updated constantly, and will be searched by all of the int fields, whereas text fields will be for display only. Does it make sense to split it vertically into two tables, one with ints and one with texts

Re: [GENERAL] Unexplained case insensitive results

2007-04-16 Thread Lloyd Mason
I have also tried the query using the same encoding with both the 8.1.5 and 8.1.8 versions and the query is still coming back with different results. The 8.1.5 shows all records that include upper and lower case while the 8.1.8 shows only the lower case. -Original Message- From: Tom Lane [

[GENERAL]

2007-04-16 Thread Mikko Partio
Nico Sabbi wrote: > > > but "cp /tmp/pg//00010021 pg_xlog/RECOVERYXLOG" looks suspicious to me. > Works for me [clip from process listing]: postgres 12864 12863 0 18:36 ?00:00:00 cp /wal/000100E10035 pg_xlog/RECOVERYXLOG I think RECOVERYXLOG should be ove

Re: [GENERAL] autovacuum vacuums entire database...is this right?

2007-04-16 Thread Chris Browne
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I'm just wondering if autovacuum is ever supposed to vacuum the entire > database during one of its runs. As far as I remember, it's supposed > to vacuum one table at a time, based on the > autovacuum_vacuum_threshold, autovacuum_analyze_threshold,

Re: [GENERAL] Help setting up warm standby replication

2007-04-16 Thread Nico Sabbi
Nico Sabbi wrote: Merlin Moncure wrote: try link mode, not copy mode (-l). make sure you read about the -k switch. merlin replaced -c with -l, but the result was the same. I assume that with -k you mean the socket dir for postgres - since pg_standby doesn't seek to recognize that switc

Re: [GENERAL] Dump & restore required for x86 -> EM64T?

2007-04-16 Thread Tom Lane
Hannes Dorbath <[EMAIL PROTECTED]> writes: > As the subject says.. is there a problem when starting a cluster created > on a x86 box on a EM64T one? Are they binary compatible? No. regards, tom lane ---(end of broadcast)---

Re: [GENERAL] Help setting up warm standby replication

2007-04-16 Thread Nico Sabbi
Merlin Moncure wrote: try link mode, not copy mode (-l). make sure you read about the -k switch. merlin replaced -c with -l, but the result was the same. I assume that with -k you mean the socket dir for postgres - since pg_standby doesn't seek to recognize that switch - but I didn't ne

Re: [GENERAL] Q re installing Pg on OS X?

2007-04-16 Thread Kevin Murphy
Seneca Cunningham wrote: On Sun, Apr 15, 2007 at 06:18:18PM -0400, Kynn Jones wrote: Still, it would be nice to have more up-to-date instructions on how to install PostgreSQL on OS X. Any pointers would be much appreciated! Try the main documentation And just for the record, PostgreS

Re: [GENERAL] Help setting up warm standby replication

2007-04-16 Thread Merlin Moncure
On 4/16/07, Nico Sabbi <[EMAIL PROTECTED]> wrote: Merlin Moncure wrote: > On 4/16/07, Nico Sabbi <[EMAIL PROTECTED]> wrote: > >> Is there any parameter that I have to pass to the second server to keep >> on requesting WALs? >> I still don't understand what instructs the server to continously >>

Re: [GENERAL] Help setting up warm standby replication

2007-04-16 Thread Nico Sabbi
Merlin Moncure wrote: On 4/16/07, Nico Sabbi <[EMAIL PROTECTED]> wrote: Is there any parameter that I have to pass to the second server to keep on requesting WALs? I still don't understand what instructs the server to continously request the master's logs. google pg_standby. I've set it up

Re: [GENERAL] indexing array columns

2007-04-16 Thread Teodor Sigaev
you should be able to index the way you want. In contrib there a module "cube" which does similar to what you want to 3D, extending it to 12D shouldn't be too hard... contrib/cube module implements N dimensional cube representation -- Teodor Sigaev E-mail: [EMA

Re: [GENERAL] Help setting up warm standby replication

2007-04-16 Thread Merlin Moncure
On 4/16/07, Nico Sabbi <[EMAIL PROTECTED]> wrote: Is there any parameter that I have to pass to the second server to keep on requesting WALs? I still don't understand what instructs the server to continously request the master's logs. google pg_standby. I've set it up and it works. merlin --

Re: [GENERAL] Help setting up warm standby replication

2007-04-16 Thread Nico Sabbi
Tom Lane wrote: Nico Sabbi <[EMAIL PROTECTED]> writes: To begin with I followed the example of the docs: in the recovery.conf file of the slave instance I set restore_command = 'cp -av /var/lib/pgsql/data/pg_xlog/%f %p' Hm, it looks like you are trying to copy xlog segme

[GENERAL] Dump & restore required for x86 -> EM64T?

2007-04-16 Thread Hannes Dorbath
As the subject says.. is there a problem when starting a cluster created on a x86 box on a EM64T one? Are they binary compatible? Thanks. -- Regards, Hannes Dorbath ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore y

Re: [GENERAL] median query causes disk to fill up

2007-04-16 Thread Alban Hertroys
[EMAIL PROTECTED] wrote: > Sorry, I forgot to also mention that I am running this on a machine > with 80GB free disk space, and 1GB RAM (but I wouldn't think that this > would be the problem, would it?) Running out of disk space during a select sounds like you ran out of memory and out of swap con