Re: [HACKERS] Interface for pg_autovacuum

2006-12-23 Thread Dave Page

Robert Treat wrote:

Dave: How does PgAdmin handle setting table-specific autovacuum
parameters? (Does it?)

Yes, it adds/removes/edits rows in pg_autovacuum as required.



We do this in phppgadmin too, although I also added a screen that show alist 
of entries with schema and table names (rather than vacrelid) since otherwise 
it is too much pita to keep things straight.  My intent is also to add 
controls at the table level (where we'll know the vacrelid anyway) though it 
will probably be put off until there is more demand for it. 


The actual user interface is at table level in pgAdmin - there's an 
extra tab on the table properties dialogue that allows you to tweak the 
values or leave them at system default.


Regards, Dave


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Strange pgsql crash on MacOSX

2006-12-23 Thread Shane Ambler

Shane Ambler wrote:

Tom Lane wrote:

Shane Ambler [EMAIL PROTECTED] writes:

postgres=# \q
psql(24931) malloc: *** error for object 0x180a800: incorrect checksum
for freed object - object was probably modified after being freed, break
at szone_error to debug
psql(24931) malloc: *** set a breakpoint in szone_error to debug
Segmentation fault


I think we've seen something like this before in connection with
readline/libedit follies.  Does the crash go away if you invoke
psql with -n option?  If so, exactly which version of readline or
libedit are you using?





psql -n stops the error.



I just found out the problem.

psql_history - I had tried to copy from a text file earlier that was 
utf8 and came up with some errors, I guess these got into the history 
file and stuffed it up.


Renamed it so it created a new one and all is fine now.

--

Shane Ambler
[EMAIL PROTECTED]

Get Sheeky @ http://Sheeky.Biz

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


[HACKERS] cannot add to postgresql project my own source files

2006-12-23 Thread dakotali kasap
Hi,

I want to write a function that takes the raw parsetree and rewrites it 
according to my rules, then produce new raw parsetrees.

I will call this function inside backend/tcop/postgres.c . I wrote an header 
file called my_rewriter.h and include this inside postgres.c.

my_writer.h looks like:
-
#ifndef UWSDREWRITE_H
#define UWSDREWRITE_H

#include nodes/pg_list.h
#include nodes/nodes.h

typedef struct my_Projection
{
char *relname;
List attnames;
char *result_relname;

} my_Projection;

.
.
.

extern void  my_analyze(Node *parsetree);
extern void my_rewrite(List *parsetree_list);

#endif UWSDREWRITE_H
-

Then I wrote a C file called my_writer.c, and do the implementation of 
my_analyze(Node *parsetree) and my_rewrite(List *parsetree_list) functions.  I 
need Node and List structures here, but when I include the necessary header 
files (#include nodes/pg_list.h, #include nodes/nodes.h), I got errors at 
compile time like:

---
../../../src/include/nodes/nodes.h:359: error: syntax error before ‘Node’
../../../src/include/nodes/nodes.h:398: error: syntax error before ‘equal’
../../../src/include/nodes/nodes.h:398: warning: type defaults to ‘int’ in 
declaration of ‘equal’
../../../src/include/nodes/nodes.h:398: warning: data definition has no type or 
storage class


So, I think there is a problem with the Makefiles but I do not know what. I 
added the object file my_writer.o  to the Makefile inside  
backend/parser/Makefile and configured again, but it did not work, what else 
should I do?

regards,

dakotali




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[HACKERS] libxml on unixware

2006-12-23 Thread ohp
Hi everyone

I'm trying to test libxml on UnixWare and came with this problem:

Backend crashes with the follolwing log during make check when libxml is
enabled.

parallel group (13 tests):  text boolean name char int2 varchar int8 float8 oid 
float4 int4 bit numeric
 boolean  ... ok
 char ... ok
 name ... ok
 varchar  ... ok
 text ... ok
 int2 ... ok
 int4 ... ok
 int8 ... ok
 oid  ... ok
 float4   ... ok
 float8   ... ok
 bit  ... ok
 numeric  ... ok
test strings  ... ok
test numerology   ... ok
parallel group (20 tests):  box path abstime comments lseg point tinterval time 
reltime timetz circle polygon inet interval type_sanity date timestamptz 
timestamp oidjoins opr_sanity
 point... ok
 lseg ... ok
 box  ... ok
 path ... ok
 polygon  ... ok
 circle   ... ok
 date ... ok
 time ... ok
 timetz   ... ok
 timestamp... ok
 timestamptz  ... ok
 interval ... ok
 abstime  ... ok
 reltime  ... ok
 tinterval... ok
 inet ... ok
 comments ... ok
 oidjoins ... ok
 type_sanity  ... ok
 opr_sanity   ... ok
test geometry ... ok
test horology ... ok
test insert   ... ok
test create_function_1... ok
test create_type  ... ok
test create_table ... ok
test create_function_2... ok
parallel group (2 tests):  copyselect copy
 copy ... ok
 copyselect   ... ok
parallel group (8 tests):  create_operator create_aggregate vacuum 
drop_if_exists triggers constraints create_misc inherit
 constraints  ... ok
 triggers ... ok
 create_misc  ... ok
 create_aggregate ... ok
 create_operator  ... ok
 inherit  ... ok
 vacuum   ... ok
 drop_if_exists   ... ok
parallel group (2 tests):  create_view create_index
 create_index ... ok
 create_view  ... ok
test sanity_check ... ok
test errors   ... ok
test select   ... ok
parallel group (20 tests):  select_distinct_on select_distinct select_into 
btree_index select_having union delete update case random aggregates hash_index 
namespace select_implicit portals arrays subselect transactions join 
prepared_xacts
 select_into  ... ok
 select_distinct  ... ok
 select_distinct_on   ... ok
 select_implicit  ... ok
 select_having... ok
 subselect... ok
 union... ok
 case ... ok
 join ... ok
 aggregates   ... ok
 transactions ... ok
 random   ... ok
 portals  ... ok
 arrays   ... ok
 btree_index  ... ok
 hash_index   ... ok
 update   ... ok
 namespace... ok
 prepared_xacts   ... ok
 delete   ... ok
test privileges   ... ok
test misc ... ok
parallel group (7 tests):  portals_p2 guc dependency select_views cluster rules 
foreign_key
 select_views ... ok
 portals_p2   ... ok
 rules... ok
 foreign_key  ... ok
 cluster  ... ok
 dependency   ... ok
 guc  ... ok
parallel group (16 tests):  limit prepare polymorphism conversion copy2 
without_oid temp returning sequence xml alter_table truncate rangefuncs plpgsql 
rowtypes domain
 limit... ok
 plpgsql  ... FAILED
 copy2... ok
 temp ... ok
 domain   ... FAILED
 rangefuncs   ... FAILED
 prepare  ... ok
 without_oid  ... ok
 conversion   ... ok
 truncate ... FAILED
 alter_table  ... FAILED
 sequence ... ok
 polymorphism ... ok
 rowtypes ... FAILED
 returning... ok
 xml  ... FAILED
test stats... FAILED
test tablespace   ... FAILED

In order to send a back trace, I recompiled with --enable-debug
--enable-cassert and regression test is ok!

What can I do next ?

Best regards,
-- 
Olivier PRENANT Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges+33-5-61-50-97-01 (Fax)
31190 AUTERIVE   +33-6-07-63-80-64 (GSM)
FRANCE  

Re: [HACKERS] Strange pgsql crash on MacOSX

2006-12-23 Thread Tom Lane
Shane Ambler [EMAIL PROTECTED] writes:
 I just found out the problem.
 psql_history - I had tried to copy from a text file earlier that was 
 utf8 and came up with some errors, I guess these got into the history 
 file and stuffed it up.

Hm, so the question is: is it our bug or Apple's?  If you kept the
busted history file, would you be willing to send me a copy?

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] libxml on unixware

2006-12-23 Thread Tom Lane
ohp@pyrenet.fr writes:
 In order to send a back trace, I recompiled with --enable-debug
 --enable-cassert and regression test is ok!

Oh, that's interesting!  Try it with just --enable-debug.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] libxml on unixware

2006-12-23 Thread Andrew Dunstan
Tom Lane wrote:
 ohp@pyrenet.fr writes:
 In order to send a back trace, I recompiled with --enable-debug
 --enable-cassert and regression test is ok!

 Oh, that's interesting!  Try it with just --enable-debug.


Is this one of those compilers where turning debug on turns off optimisation?

cheers

andrew




---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] recent --with-libxml support

2006-12-23 Thread Tom Lane
Jeremy Drake [EMAIL PROTECTED] writes:
 On Fri, 22 Dec 2006, Tom Lane wrote:
 Jeremy Drake [EMAIL PROTECTED] writes:
 As seen, I needed to add an include dir for configure to pass.  However,
 make check fails now with the backend crashing.  This can be seen in the
 buildfarm results for mongoose.
 
 Can you provide a stack trace for that crash?

 #0  0xb7c4dc85 in memcpy () from /lib/tls/libc.so.6
 #1  0x08190f59 in appendBinaryStringInfo (str=0xbfd87f90,
 data=0x841ffc0 qux, datalen=138543040) at stringinfo.c:192
 #2  0x0828377f in map_sql_identifier_to_xml_name (ident=0x841ffc0 qux,
 fully_escaped=0 '\0') at xml.c:933
 #3  0x0811ce83 in transformXmlExpr (pstate=0x84202b8, x=0x8420034)
 at parse_expr.c:1426
 #4  0x0811ac91 in transformExpr (pstate=0x84202b8, expr=0x8420034)
 at parse_expr.c:238

Ah-hah, I've sussed it.  sqlchar_to_unicode() calls the
mb2wchar_with_len converters, which are defined to return a *null
terminated* pg_wchar string.  So even if you only ask for the conversion
of a single character, you need a 2-pg_wchar array to hold the result,
and that wasn't being allocated.  So the code was clobbering a word of
stack space that evidently is critical on some machines and not others.

Fix committed, please see if it works for you now.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


[HACKERS] Loose ends in PG XML patch

2006-12-23 Thread Tom Lane
I cleaned up some things I didn't like in the recent XML patch, but
there are several loose ends that I lack the energy to tackle now:

* Isn't mapping XMLSERIALIZE to a cast completely wrong?  Aside from
the issue already noted in the code that it won't reverse-list
correctly, this loses the DOCUMENT-vs-CONTENT flag, which I suppose
must be important.

* Shouldn't the xml type support binary I/O?  Right now it is the only
standard datatype that doesn't.  I have no idea whether there is an
appropriate representation besides text, but if not we could define the
binary representation to be the same as text.

* Reverse-listing of XMLELEMENT and XMLPI is currently wrong because
the name string is not de-escaped back to a plain SQL identifier.

* It doesn't look to me like any thought has been given to localization
in xml_ereport() --- there are a ton of strings there that won't get
translated.

* I'm also quite afraid of xml_errmsg remaining non-null when the
storage it points at has been deallocated.  Since this is apparently
only intended as debug support, maybe we could compile it only in debug
builds, to reduce the probability that it will fail in production?

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] quick review

2006-12-23 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, Dec 18, 2006 at 03:47:42AM +0100, Molle Bestefich wrote:

[...]

 Simply put, a tool with just a single button named recover
 all the data that you can is by far the best solution in so
 many cases.  Minimal fuzz, minimal downtime, minimal money
 spent on recovery.  And perhaps there's even a good chance that
 any missing data could be entered back into the system manually.

I think the point which has been made here was that the recovery tool
*is already there*: i.e. all what can be done as an one-click recovery
is done by the system at start-up. Beyond this no cookbook exists (and
thus no way to put it under an one-click procedure).

So this one-click thing would be mainly something to cater for the
needs of marketing.

Regards
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFjg4/Bcgs9XrR2kYRAtnSAKCCFkB+YAlvbuyhepUnR9/CeG3tsACfb8bE
lCszfmaps1PN1jLMQrc6eLo=
=/6Pa
-END PGP SIGNATURE-


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] recent --with-libxml support

2006-12-23 Thread Jeremy Drake
On Sat, 23 Dec 2006, Tom Lane wrote:

 Ah-hah, I've sussed it.  sqlchar_to_unicode() calls the
 mb2wchar_with_len converters, which are defined to return a *null
 terminated* pg_wchar string.  So even if you only ask for the conversion
 of a single character, you need a 2-pg_wchar array to hold the result,
 and that wasn't being allocated.  So the code was clobbering a word of
 stack space that evidently is critical on some machines and not others.

 Fix committed, please see if it works for you now.

The buildfarm run seems to be green now.  I am compiling a sandbox to test
it manually now, but I'm pretty sure that fixed it.  Yep, the make check
works there too...

-- 
As long as war is regarded as wicked, it will always have its
fascination.  When it is looked upon as vulgar, it will cease to be
popular.
-- Oscar Wilde

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq