Re: [GENERAL] Unexplained case insensitive results

2007-04-19 Thread Peter Eisentraut
Lloyd Mason wrote:
> 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.

He said locale, not encoding.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

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


Re: [GENERAL] cant get pg_dump/pg_restore to behave

2007-04-19 Thread Tom Lane
"Mike Frysinger" <[EMAIL PROTECTED]> writes:
> $ pg_dump -F c -s -d database-server mydb > mydb.schema
> $ psql -d mydb < mydb.schema
> 

pg_dump -Fc does not produce a file that psql can read directly.
Is the above really what you did?

regards, tom lane

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

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


[GENERAL] Technical Documentation and Community Login

2007-04-19 Thread Guy Rouillier
I was attempting to get info to answer a question on this mailing list. 
 I found a document that sounded appropriate here: 
http://www.postgresql.org/docs/techdocs.71.  Color me dumb, but I can't 
figure a way to download the document "Apache 2.0, Tomcat 5.5, WARs & 
PostgreSQL 8.1 JDBC DataSources on Windows XP".  When I click on the 
link to the document, it just brings me back to the same page.


So then I figured perhaps I needed a community login.  So I created one 
3 or 4 days ago, but I'm still waiting for the confirmation email to 
arrive.  Is that server stuck?


--
Guy Rouillier

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


[GENERAL] cant get pg_dump/pg_restore to behave

2007-04-19 Thread Mike Frysinger

i'm trying to add the ability to dump our database as a backup in case
things go wrong with the db server, and so i'm trying to test things
now so that if/when things do go bad, i'm not scrambling then :)

as a test, i'm just trying to dump a database's schema and restore
that ... but it seems like pg_dump doesnt dump things in order so when
i restore the dump, i get bunches of errors about things not existing
... looking at the actual dump, i can see the tables pg_restore is
complaining about have operations run on it before the actual CREATE
sql ...

$ pg_dump -F c -s -d database-server mydb > mydb.schema
$ psql -d mydb < mydb.schema

$ grep users_idx mydb.schema
INSERT INTO users_idx (
UPDATE users_idx SET ...
-- Name: users_idx; Type: TABLE; ...
CREATE TABLE users_idx (...

err, shouldnt that CREATE be first ?
-mike

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

  http://archives.postgresql.org/


Re: [GENERAL] selective export for subsequent import (COPY)

2007-04-19 Thread Brent Wood

chrisj wrote:

Thanks Alan,
This helped a lot, but ideally I want a tab field delimiter and -F '\t' does
not seem to work, any ideas??

I noticed one other post on this same problem of the fieldsep '\t' not
working but the only advise offered was to use \pset.  Can \pset be used on
the command line, I can only get it to work within the psql command
processor.

  


You can always have a text file (file.sql):

\pset ...
select .


the run the commands is a single client connection with

psql database -Atf file.sql

This runs a file of sql commands in a single psql connection instead of 
opening a new connection for every -c "" command.
Thus the result of the \pset is still in force when the next sql 
statement is executed.


or run your command as it is & pipe the output through tr to translate 
the commas to tabs.

You can see what tr does using
echo "1,2" | tr "," "\t"

eg:
psql $DATABASEHOST -U $DATABASEUSER -d $DATABASE -q -P footer -A -F , -c "$DETAIL_SQL" | tr 
"," "\t" >table.csv


Cheers,

 Brent Wood


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

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


Re: [GENERAL] Is it possible to move a database to another tablespace?

2007-04-19 Thread Tom Lane
Francisco Reyes <[EMAIL PROTECTED]> writes:
> I see tables and indexes can be moved to a different tablespace. 
> Is there any way to move an entire database to a different tablespace?

No.  Moving the system catalogs on-the-fly would be an interesting
problem ("uh, where did you say pg_class was? ... and I can't find its
indexes either?").  It could possibly be done, but the complexity would
be far out of proportion to the value I fear.

regards, tom lane

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

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


Re: [GENERAL] binding 64-bit integer

2007-04-19 Thread Tom Lane
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> I wanted to bind a 64-bit integer, but it failed:
> "ERROR:  incorrect binary data format in bind
> parameter 1".

It sorta looks like you are trying to send that value to a parameter
that the server doesn't think is int8.

regards, tom lane

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


Re: [GENERAL] selective export for subsequent import (COPY)

2007-04-19 Thread Tom Lane
chrisj <[EMAIL PROTECTED]> writes:
> This helped a lot, but ideally I want a tab field delimiter and -F '\t' does
> not seem to work, any ideas??

I don't think there's any provision for backslash-notation in that
switch; you'd need to type an actual tab character there.  Depending on
what shell you use, that might be a bit difficult on an interactive
shell command line, but it should be simple enough to insert one in a
script file.

regards, tom lane

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] selective export for subsequent import (COPY)

2007-04-19 Thread chrisj

Thanks Alan,
This helped a lot, but ideally I want a tab field delimiter and -F '\t' does
not seem to work, any ideas??

I noticed one other post on this same problem of the fieldsep '\t' not
working but the only advise offered was to use \pset.  Can \pset be used on
the command line, I can only get it to work within the psql command
processor.


Harvey, Allan AC wrote:
> 
> Chris,
> 
>> I know about: psql dbname -tc "select * from tableX where whatever" >
>> tableX.dat 
> 
> What about
> psql $DATABASEHOST -U $DATABASEUSER -d $DATABASE -q -P footer -A -F , -c
> "$DETAIL_SQL" >table.csv
> 
> To produce a comma separated file of tuples only.
> If I'm not mistaken, as happens quite a bit, you can then use COPY to
> import the csv file.
> 
> Allan
> 
> 
> The material contained in this email may be confidential, privileged or
> copyrighted. If you are not the intended recipient, use, disclosure or
> copying of this information is prohibited. If you have received this
> document in error, please advise the sender and delete the document.
> Neither OneSteel nor the sender accept responsibility for any viruses
> contained in this email or any attachments.
> 
> ---(end of broadcast)---
> TIP 6: explain analyze is your friend
> 
> 

-- 
View this message in context: 
http://www.nabble.com/selective-export-for-subsequent-import-%28COPY%29-tf3604927.html#a10090719
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


Re: [GENERAL] Building PG 8.2.3 for x86_64 on Mac OS X 10.4.9

2007-04-19 Thread Tom Lane
Kevin Murphy <[EMAIL PROTECTED]> writes:
> Has anybody tried making a 64-bit PostgreSQL on an Apple XServe w/  
> Intel Woodcrest CPU's?  My compile works, but the 'make check' fails  
> because of failure to allocate shared memory.  There's plenty of SYSV  
> memory available.

> creating template1 database in /usr/local/src/postgresql-8.2.3/src/ 
> test/regress/./tmp_check/data/base/1 ... FATAL:  \
> could not create shared memory segment: Cannot allocate memory
> DETAIL:  Failed system call was shmget(key=1, size=1810432, 03600).

Hmm ... not sure if this is related, but there's something mighty fishy
about that "key" parameter.  I'd expect to see key=5432001, or something
close to that depending on what port number you're using.

regards, tom lane

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

   http://archives.postgresql.org/


Re: [GENERAL] dollar-quoting trouble

2007-04-19 Thread Klint Gore
On Thu, 19 Apr 2007 23:45:47 +0200, Karsten Hilbert <[EMAIL PROTECTED]> wrote:
> I can't spot the trouble with this function definition:
> 
> create function dem.trf_null_empty_title()
>   returns trigger
>   language plpgsql
>   as $null_empty_title$
> begin
>   if (NEW.title is null) then
>   return NEW;
>   end if;
> 
>   if trim(NEW.title) <> '' then
>   return NEW;
>   end if;
> 
>   NEW.title := NULL;
>   return NEW;
> end;
> $null_empty_title$;
> 
> 
> PostgreSQL 8.1.8 (Debian/Etch) is telling me:
> 
> psql:dem-identity.sql:43: ERROR:  unterminated dollar-quoted string at or 
> near "$null_empty_title$
> begin
> if (NEW.title is null) then
> return NEW;" at character 83

Does "psql --version" match "select version()"?  There's a message in
the archive pgsql-bugs where this happened.

klint.

+---+-+
: Klint Gore: "Non rhyming:
: EMail   : [EMAIL PROTECTED]   :  slang - the:
: Snail   : A.B.R.I.:  possibilities  :
: Mail  University of New England   :  are useless"   :
:   Armidale NSW 2351 Australia : L.J.J.  :
: Fax : +61 2 6772 5376 : :
+---+-+

---(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: [GENERAL] Building PG 8.2.3 for x86_64 on Mac OS X 10.4.9

2007-04-19 Thread Kevin Murphy

A.M. wrote:

On Apr 19, 2007, at 3:21 PM, Kevin Murphy wrote:
Has anybody tried making a 64-bit PostgreSQL on an Apple XServe w/ 
Intel Woodcrest CPU's?  My compile works, but the 'make check' fails 
because of failure to allocate shared memory.  There's plenty of 
SYSV memory available.


The configure script will likely still configure for the 32-bit 
headers (so size_t will be 32 bits incorrectly). It will take a little 
more autoconf hacking to get a 64-bit build.

sizeof(size_t) reports as 8.

-Kevin



---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] dollar-quoting trouble

2007-04-19 Thread John DeSoi

Works for me on both 8.1 and 8.2. What client are you using?

John



On Apr 19, 2007, at 5:45 PM, Karsten Hilbert wrote:


I can't spot the trouble with this function definition:




John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


---(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: [GENERAL] binding 64-bit integer

2007-04-19 Thread Martin Gainty

Flying-
reading the source displays
http://doxygen.postgresql.org/postgres_8c-source.html

  /* Trouble if it didn't eat the whole buffer */
if (!isNull && pbuf.cursor != pbuf.len)
ereport(ERROR,
(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
 errmsg("incorrect binary data format in bind 
parameter %d",

paramno + 1)));

the test is
 StringInfoData pbuf;

http://doxygen.postgresql.org/structStringInfoData.html#42669853a3faef1df41850bfd686cb24

pbuf.cursor (plain 32 bit int) != pbuf.len(64)

i think you found a bug

M-
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: <[EMAIL PROTECTED]>

To: 
Sent: Thursday, April 19, 2007 9:02 PM
Subject: [GENERAL] binding 64-bit integer



Hi all,

I'm using Solaris 10 with 64-bit libpq library.

I wanted to bind a 64-bit integer, but it failed:
"ERROR:  incorrect binary data format in bind
parameter 1".

The code would succeed if the type of "val" is
uint32_t.

Doe anyone know how to fix this?  Thanks a lot!

-
uint64_t  val;
const char  *paramValues[1];
int  paramLengths[1];
int  paramFormats[1];
const char *sql_clause = "SELECT * FROM mytable  WHERE
mykey = $1";

paramValues[0] = (char *) &val;
paramLengths[0] = sizeof(val);
paramFormats[0] = 1;

res = PQexecParams(conn, sql_clause, 1, NULL,
 paramValues, paramLengths, paramFormats, 1);



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

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




---(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


[GENERAL] binding 64-bit integer

2007-04-19 Thread [EMAIL PROTECTED]
Hi all,

I'm using Solaris 10 with 64-bit libpq library.

I wanted to bind a 64-bit integer, but it failed:
"ERROR:  incorrect binary data format in bind
parameter 1".

The code would succeed if the type of "val" is
uint32_t.

Doe anyone know how to fix this?  Thanks a lot!

-
uint64_t  val;
const char  *paramValues[1];
int  paramLengths[1];
int  paramFormats[1];
const char *sql_clause = "SELECT * FROM mytable  WHERE
mykey = $1";

paramValues[0] = (char *) &val;
paramLengths[0] = sizeof(val);
paramFormats[0] = 1;

res = PQexecParams(conn, sql_clause, 1, NULL,
  paramValues, paramLengths, paramFormats, 1);



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

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


Re: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread Brent Wood

Richard Huxton wrote:

David Potts wrote:

David Potts wrote:


Any platform !

ie Web ,X, , L/Unix console, Mac or even Weandozz


pgadmin, phppgadmin - although these are pitched more towards admin, 
they let you edit table data.


PGAccess provides a spreadsheet like view of tables which users can type 
data into, & works pretty well, it
does not have the admin functionality of pgadmin, which might be a good 
thing in your case.


Perhaps a simple PHP data entry form for a web based tool.

I haven't tried these, but they may also work OK (on a Linux/KDE platform):

knodahttp://www.knoda.org/
rekallhttp://www.thekompany.com/projects/rekall/

Maybe someome who has actually tried these could comment?

Cheers,

 Brent Wood

---(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: [GENERAL] selective export for subsequent import (COPY)

2007-04-19 Thread Brent Wood

chrisj wrote:

I would like to do a selective export of a number of tables from a large
database to import into a smaller (test) DB.

I know about: psql dbname -tc "select * from tableX where whatever" >
tableX.dat 
  

You might try
psql dbname -Atc "select * from tableX where whatever" > tableX.dat

to produce un-aligned output, if this is your problem.

Brent Wood


but unless I put it through a sed script, this file cannot be easily used
for import.

It feels like I am re-inventing the wheel.  Does anybody know a better way
or have a good sed script.

  



---(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: [GENERAL] dollar-quoting trouble

2007-04-19 Thread Alvaro Herrera
Karsten Hilbert wrote:
> Hi all,
> 
> I can't spot the trouble with this function definition:
> 
> create function dem.trf_null_empty_title()
>   returns trigger
>   language plpgsql
>   as $null_empty_title$
> begin
>   if (NEW.title is null) then
>   return NEW;
>   end if;
> 
>   if trim(NEW.title) <> '' then
>   return NEW;
>   end if;
> 
>   NEW.title := NULL;
>   return NEW;
> end;
> $null_empty_title$;

Works for me ...

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---(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: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread Chris Browne
[EMAIL PROTECTED] (Kenneth Downs) writes:
> If you want end-users to be doing the data entry, Andromeda may be
> what you want.
>
> http://www.andromeda-project.org/
>
> The project is aimed at more complicated cases and may carry too much
> overhead for what you want, but perhaps not.

Their choice of "something like CSS" (e.g. - the HTML 'cascading style
sheets' language) as the language for representing data models seems
bizarre to me, but their goal of making the whole thing declarative
seems mighty attractive.

Is anyone using this for interesting applications?
-- 
(format nil "[EMAIL PROTECTED]" "cbbrowne" "linuxfinances.info")
http://linuxfinances.info/info/nonrdbms.html
--Kill Running Inferiors--

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[GENERAL] Bug o not bug in subqueries

2007-04-19 Thread William Contreras

I have one table.

create table u ( 
   id integer,



__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 

---(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


[GENERAL] dollar-quoting trouble

2007-04-19 Thread Karsten Hilbert
Hi all,

I can't spot the trouble with this function definition:

create function dem.trf_null_empty_title()
returns trigger
language plpgsql
as $null_empty_title$
begin
if (NEW.title is null) then
return NEW;
end if;

if trim(NEW.title) <> '' then
return NEW;
end if;

NEW.title := NULL;
return NEW;
end;
$null_empty_title$;


PostgreSQL 8.1.8 (Debian/Etch) is telling me:

psql:dem-identity.sql:43: ERROR:  unterminated dollar-quoted string at or near 
"$null_empty_title$
begin
if (NEW.title is null) then
return NEW;" at character 83


Can anyone help ?

Thanks,
Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

---(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: [GENERAL] Is it possible to move a database to another tablespace?

2007-04-19 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/19/07 14:51, Francisco Reyes wrote:
> I see tables and indexes can be moved to a different tablespace.
> Is there any way to move an entire database to a different tablespace?

Move one table at a time?

- --
Ron Johnson, Jr.
Jefferson LA  USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGJ95KS9HxQb37XmcRAloBAKDC+j/yS4r6dQXiY2kKUQMXUaHtYgCggy+A
JIeqTvU4Q4zZR+gX9q/6mNk=
=bIOU
-END PGP SIGNATURE-

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Can Postgresql be ported to a device with no OS and simple file I/O and memory management?

2007-04-19 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/19/07 15:11, Dave Page wrote:
> Walter Vaughan wrote:
>> Raymond Hurst wrote:
>>
>>> I have a requirement of incorporating a database in a hard disk drive.
>> Well, back in the day there was a man called Dick Pick. The US Goverment
>> had the same request. They wanted a database incorporated into a hard
>> disk drive, and that's what they got. An operating system and database
>> in one, on the hard drive. Damn good database, still in use all over the
>> world. IBM even distributes 2 versions today.
> 
> That takes me back - hours of endless fun trying to get tape drives to
> work with native Advanced Pick - and it wasn't a great deal better on
> the 'alongside HP-UX' version. So much easier when Unidata came along
> and didn't try to be an OS as well as a DBMS Ahh, those were the
> days :-)

Get off my lawn, you young whippersnappers!!!

- --
Ron Johnson, Jr.
Jefferson LA  USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGJ94WS9HxQb37XmcRAklHAJ9686PNCe8iY+9/CJcLOWJxvNp2NQCg7J6Q
WgBB6A+kFTP2umCqH29O16E=
=AiD6
-END PGP SIGNATURE-

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

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


Re: [GENERAL] Building PG 8.2.3 for x86_64 on Mac OS X 10.4.9

2007-04-19 Thread Alvaro Herrera
Kevin Murphy wrote:
> On Apr 19, 2007, at 3:21 PM, Kevin Murphy wrote:
> >Has anybody tried making a 64-bit PostgreSQL on an Apple XServe w/  
> >Intel Woodcrest CPU's?  My compile works, but the 'make check'  
> >fails because of failure to allocate shared memory.  There's plenty  
> >of SYSV memory available.
> 
> The call to shmget() is failing with ENOMEM.  A standalone SYSV  
> shared memory test program gives the same result when compiled with - 
> arch x86_64.

So this makes it a platform bug?

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

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


Re: [GENERAL] Building PG 8.2.3 for x86_64 on Mac OS X 10.4.9

2007-04-19 Thread Kevin Murphy

On Apr 19, 2007, at 3:21 PM, Kevin Murphy wrote:
Has anybody tried making a 64-bit PostgreSQL on an Apple XServe w/  
Intel Woodcrest CPU's?  My compile works, but the 'make check'  
fails because of failure to allocate shared memory.  There's plenty  
of SYSV memory available.


The call to shmget() is failing with ENOMEM.  A standalone SYSV  
shared memory test program gives the same result when compiled with - 
arch x86_64.


Harrumph.

-Kevin Murphy


---(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


[GENERAL] Incrementally Updated Backups: Docs Clarification

2007-04-19 Thread Thomas F. O'Connell
I'm about to begin playing with incrementally updated backups for a  
warm standby scenario, but I need some help understanding this  
paragraph in postgres terms. From 23.4.5 in the 8.2.3 docs:


"If we take a backup of the standby server's files while it is  
following logs shipped from the primary, we will be able to reload  
that data and restart the standby's recovery process from the last  
restart point. We no longer need to keep WAL files from before the  
restart point. If we need to recover, it will be faster to recover  
from the incrementally updated backup than from the original base  
backup."


I'm specifically confused about the meaning of the following phrases:

"backup of the standby server's files" - Which files?

"reload that data" - What does this mean in postgres terms?

"last restart point" - What is this? Wouldn't it be able to restart  
from the last recovered file, which would presumably occur later than  
the last restart point?


Does this mean make a filesystem backup of the standby server's data  
directory while it's stopped, and then start it again with that data  
and the restricted set of WAL files needed to continue recovery? I'd  
like to see the language here converted to words that have more  
meaning in the context of postgres. I'd be happy to attempt a  
revision of this section once I'm able to complete an incrementally  
updated backup successfully.


Here's how I envision it playing out in practice:

1. stop standby postgres server
2. [optional] preserve data directory, remove unnecessary WAL files
3. restart standby server

Is that all there is to it?

--
Thomas F. O'Connell

optimizing modern web applications
: for search engines, for usability, and for performance :

http://o.ptimized.com/
615-260-0005



Re: [GENERAL] recommendations for reducing mem usage on local dev machine

2007-04-19 Thread Anton Melser

On 19/04/07, Andrej Ricnik-Bay <[EMAIL PROTECTED]> wrote:

On 4/15/07, Anton Melser <[EMAIL PROTECTED]> wrote:

> it might even make more sense), and with KDE/Gnome these days, I don't
> think there is much difference with XP...
Of course you could use fluxbox, twm or something else less
bloated ... my window-manager has a 2MB foot-print.

Or use vim instead of Eclipse ;} ... would save you approx. 240MB
in the blink of an eye.


I have long wanted to spend the time to get proficient enough at vim
to be more productive than with IDEs... alas, it has just never
happened!
Cheers
Anton

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


Re: [GENERAL] Can Postgresql be ported to a device with no OS and simple file I/O and memory management?

2007-04-19 Thread Dave Page
Walter Vaughan wrote:
> Raymond Hurst wrote:
> 
>> I have a requirement of incorporating a database in a hard disk drive.
> 
> Well, back in the day there was a man called Dick Pick. The US Goverment
> had the same request. They wanted a database incorporated into a hard
> disk drive, and that's what they got. An operating system and database
> in one, on the hard drive. Damn good database, still in use all over the
> world. IBM even distributes 2 versions today.

That takes me back - hours of endless fun trying to get tape drives to
work with native Advanced Pick - and it wasn't a great deal better on
the 'alongside HP-UX' version. So much easier when Unidata came along
and didn't try to be an OS as well as a DBMS Ahh, those were the
days :-)

Regards, Dave.

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

   http://archives.postgresql.org/


Re: [GENERAL] Download source

2007-04-19 Thread Alvaro Herrera
Andrew Toth wrote:
> 2007. 04. 18, szerda keltezéssel 18.21-kor Alvaro Herrera ezt írta:
> 
> > Andrew Toth wrote:
> > > Dear List,
> > > 
> > > I would like to download the version of source code containing
> > > catversion.h with the line "#define CATALOG_VERSION_NO  200611051". This
> > > is first met in Changeset 26624
> > > (https://projects.commandprompt.com/public/pgsql/changeset/26624)
> > > 
> > > How could I download it?
> > 
> > svn checkout -r 26624
> > 
> 
> I do not exactly know what to write...
> I tried:
> #svn checkout -r 26624
> https://projects.commandprompt.com/public/pgsql/repo
> 
> But it was downloading millions of files for hours. df show 100% of my /
> root directory used... in the end I tried to kill it, but my whole
> computer crashed.

Yeah, it downloaded each and every branch, so it would fetch most
files a lot of times.  Try this:

svn checkout -r 26624 
https://projects.commandprompt.com/public/pgsql/repo/trunk/pgsql/

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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


[GENERAL] Is it possible to move a database to another tablespace?

2007-04-19 Thread Francisco Reyes
I see tables and indexes can be moved to a different tablespace. 


Is there any way to move an entire database to a different tablespace?


---(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: [GENERAL] Can Postgresql be ported to a device with no OS and simple file I/O and memory management?

2007-04-19 Thread Walter Vaughan

Raymond Hurst wrote:


I have a requirement of incorporating a database in a hard disk drive.


Well, back in the day there was a man called Dick Pick. The US Goverment had the 
same request. They wanted a database incorporated into a hard disk drive, and 
that's what they got. An operating system and database in one, on the hard 
drive. Damn good database, still in use all over the world. IBM even distributes 
2 versions today.


I don't think that's what our good friends at Western Digital are asking about. 
I'm guessing that you are looking for some sort of database that you can embed 
in the drive controller logic, and would postgreSQL work in that environment?


Is that the question?

--
Walter




---(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: [GENERAL] Download source

2007-04-19 Thread Andrew Toth
2007. 04. 18, szerda keltezéssel 18.21-kor Alvaro Herrera ezt írta:

> Andrew Toth wrote:
> > Dear List,
> > 
> > I would like to download the version of source code containing
> > catversion.h with the line "#define CATALOG_VERSION_NO  200611051". This
> > is first met in Changeset 26624
> > (https://projects.commandprompt.com/public/pgsql/changeset/26624)
> > 
> > How could I download it?
> 
> svn checkout -r 26624
> 

I do not exactly know what to write...
I tried:
#svn checkout -r 26624
https://projects.commandprompt.com/public/pgsql/repo

But it was downloading millions of files for hours. df show 100% of my /
root directory used... in the end I tried to kill it, but my whole
computer crashed.




-- 




Tisztelettel: / Grüße / Yours sincerely,
   Andrew Toth
[EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]
ICQ: 311-837-922
homepage: http://tothaa.mydns.hu mirror: http://toan.fw.hu






[GENERAL] Building PG 8.2.3 for x86_64 on Mac OS X 10.4.9

2007-04-19 Thread Kevin Murphy
Has anybody tried making a 64-bit PostgreSQL on an Apple XServe w/  
Intel Woodcrest CPU's?  My compile works, but the 'make check' fails  
because of failure to allocate shared memory.  There's plenty of SYSV  
memory available.


I compiled using:

./configure --without-readline --prefix=/usr/local/pgsql-8.2.3  
CFLAGS='-arch x86_64'


log/initdb.log contains:

creating template1 database in /usr/local/src/postgresql-8.2.3/src/ 
test/regress/./tmp_check/data/base/1 ... FATAL:  \

could not create shared memory segment: Cannot allocate memory
DETAIL:  Failed system call was shmget(key=1, size=1810432, 03600).
HINT:  This error usually means that PostgreSQL's request for a  
shared memory segment exceeded available memory or s\
wap space. To reduce the request size (currently 1810432 bytes),  
reduce PostgreSQL's shared_buffers parameter (curre\

ntly 50) and/or its max_connections parameter (currently 10).

Output of: sudo ipcs -m -b:

Shared Memory:
T ID KEYMODE   OWNERGROUP  SEGSZ

(no shared memory segments in use)

/etc/sysctl.conf contains:

kern.sysv.shmmax=268435456
kern.sysv.shmmin=1
kern.sysv.shmmni=32
kern.sysv.shmseg=8
kern.sysv.shmall=65536

I just started a 32-bit instance of PostgreSQL with no problems on  
this box, and it showed:


sudo ipcs -m -b
Shared Memory:
T ID KEYMODE   OWNERGROUP  SEGSZ
m 1310715432001 --rw--- postgresstaff 126763008

Thanks,
Kevin Murphy


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

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


Re: [GENERAL] tsearch2 benchmarks, Oleg gets prize

2007-04-19 Thread Oleg Bartunov

This is very interesting and I'm interested if you write a paper, so
we could reference on. 
Two days ago I gave a talk on Russian Internet Technologies  conference

about new FTS we developed for 8.3 version and there was real interest.

btw, there are several performance optimization tips for tsearch2 you could
try. 
1. partition your data using table inheritance + constraint exclusion,

   so GiST index for fresh data and GiN index for archive part,
   also, CE will save from scanning unnecessary tables. 
2. distribute data over several servers and use dblink to get results,

something like

select dblink_connect('pgweb','dbname=pgweb hostaddr='XXX.XXX.XXX.XXX');

select * from dblink('pgweb',
'select  tid, title, rank_cd(fts_index, q) as rank from pgweb, 
to_tsquery(''table'') q 
where q @@ fts_index and tid >= 6000 order by rank desc limit 10' )

as t1 (tid integer, title text, rank real)

union all

select tid, title,  rank_cd(fts_index, q) as rank from pgweb,
to_tsquery('table') q 
where q @@ fts_index and tid < 6000 and tid > 0 order by rank desc limit 10


) as foo
order by rank desc limit 10;

3. If you could read russian, I have several papers about new FTS.
We have FTSBOOK in English 
http://www.sai.msu.su/~megera/pgsql/ftsdoc/


Oleg
On Thu, 19 Apr 2007, Listmail wrote:



tsearch2 versus mysql FULLTEXT in the context of a large forum.

	I guess you know the answer already, but it never hurts to have nice 
graphics to show your boss.


http://peufeu.free.fr/ftsbench/

	I will upload new versions with more results, and maybe other 
engines, as I can.
	If someone is really interested, it would be interesting to run this 
stuff on a real server.


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


Regards,
Oleg
_
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

---(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


[GENERAL] tsearch2 benchmarks, Oleg gets prize

2007-04-19 Thread Listmail


tsearch2 versus mysql FULLTEXT in the context of a large forum.

	I guess you know the answer already, but it never hurts to have nice  
graphics to show your boss.


http://peufeu.free.fr/ftsbench/

	I will upload new versions with more results, and maybe other engines, as  
I can.
	If someone is really interested, it would be interesting to run this  
stuff on a real server.


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


Re: [GENERAL] Can Postgresql be ported to a device with no OS and simple file I/O and memory management?

2007-04-19 Thread Listmail


	If you want embedded SQL, you'll probably have only 1 user at a time so  
sqlite is a better choice.

But do you want embedded SQL ?


On Wed, 18 Apr 2007 22:48:52 +0200, Raymond Hurst <[EMAIL PROTECTED]>  
wrote:



I have a requirement of incorporating a database in a hard disk drive.

Can postgresql do the job? Any consultants out here that have done this?

If not, any suggestions?


Ray Hurst

Western Digital

20511 Lake Forest Drive

Lake Forest, CA 92630

949-672-9853








---(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: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread Alvaro Herrera
Reid Thompson wrote:
> On Thu, 2007-04-19 at 10:05 -0500, Tony Caduto wrote:

> http://www.gnome-db.org/

Glom (www.glom.org) would seem to fit the bill.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(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: [GENERAL] Can Postgresql be ported to a device with no OS and simple file I/O and memory management?

2007-04-19 Thread Frederick Ross

In a hard disk drive?  My god, why?  If you're doing embedded
programming, don't carry over applications that were never intended
for it.  Go port eForth or Pygmy Forth to your hard drive, or at least
set up a C cross compiler, and write whatever hash tables you need.
If you're trying to make a device smart enough where you really need
all the features and sophistication of Postgres, it's time to question
whether it's a device or a computer.

On 4/18/07, Raymond Hurst <[EMAIL PROTECTED]> wrote:





I have a requirement of incorporating a database in a hard disk drive.

Can postgresql do the job? Any consultants out here that have done this?

If not, any suggestions?



Ray Hurst

Western Digital

20511 Lake Forest Drive

Lake Forest, CA 92630

949-672-9853









--
Frederick Ross
Graduate Fellow, (|Siggia> + |McKinney>)/sqrt(2) Lab
The Rockefeller University
Je ne suis pas Fred Cross!

---(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: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread Reid Thompson
On Thu, 2007-04-19 at 10:05 -0500, Tony Caduto wrote:
> David Potts wrote:
> > Can any body recommend a generic opensource  data entry tool that can be
> > used to make some simple forms for entering data in to postgres?
> >
> >
> > ---(end of broadcast)---
> > TIP 6: explain analyze is your friend
> >
> >   
> For Desktop applications on win32
> 
> Lazarus :http://www.lazarus.freepascal.org/
> 
> Delphi Turbo Explorer: http://www.turboexplorer.com  (use with ODBC or 
> Zeoslib http://www.zeoslib.net)
> 
> Sharp Develop:  http://www.icsharpcode.com  (use with npgsql .net data 
> provider)
> 
> For web based:
> 
> PHP and use NVU (http://www.nvu.com) to design the forms. 
> 
> Netbeans IDE
> 
> There are probably many more
> 
> 
> 
http://www.gnome-db.org/

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

   http://archives.postgresql.org/


Re: [GENERAL] Incremental backups

2007-04-19 Thread Kev
On Apr 19, 9:41 am, Kev <[EMAIL PROTECTED]> wrote:
> On Apr 17, 10:27 am, [EMAIL PROTECTED] (Mageshwaran) wrote:
>
> > hi everyone,
>
> > please any one give any methods to do incremental backups. it is urgent
> > .. help me
>
> > Regards
> > J Mageshwaran
>
> Sorry, I don't have anything implemented, but I've been wondering
> about this too.  One way (not necessarily the best) might be an audit
> trail if done in such a way that you could rebuild the entire database
> from the audit trail.  Then you need only back up the audit entries
> since the last backup.  However, you have to keep all backups, or once
> in a while do a 'fresh start' backup where you take all audit
> entries.  There's another thread starting about audit trails, you
> might want to check there.
>
> Kev

Actually, check out WAL archiving, that might be more appropriate.  I
don't know much about it though.

Kev



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

   http://archives.postgresql.org/


[GENERAL] Can Postgresql be ported to a device with no OS and simple file I/O and memory management?

2007-04-19 Thread Raymond Hurst
I have a requirement of incorporating a database in a hard disk drive.

Can postgresql do the job? Any consultants out here that have done this?

If not, any suggestions?

 

Ray Hurst

Western Digital

20511 Lake Forest Drive

Lake Forest, CA 92630

949-672-9853

 

 

 



Re: [GENERAL] Incremental backups

2007-04-19 Thread Kev
On Apr 17, 10:27 am, [EMAIL PROTECTED] (Mageshwaran) wrote:
> hi everyone,
>
> please any one give any methods to do incremental backups. it is urgent
> .. help me
>
> Regards
> J Mageshwaran

Sorry, I don't have anything implemented, but I've been wondering
about this too.  One way (not necessarily the best) might be an audit
trail if done in such a way that you could rebuild the entire database
from the audit trail.  Then you need only back up the audit entries
since the last backup.  However, you have to keep all backups, or once
in a while do a 'fresh start' backup where you take all audit
entries.  There's another thread starting about audit trails, you
might want to check there.

Kev


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


[GENERAL] Auditing a database

2007-04-19 Thread Germán Hüttemann Arza
Hi,

I am developing a web application for auditing tables from a postgresql 
database.

My question is: when an update occurrs in the base table, should I insert in 
the auditing table the new record or the old one?

I was first inserting the new one but a job partner, who are testing the 
application suggested that probably would be better to insert the old record 
because it is simpler to follow the trace of updates.

What you suggest?

Regards,

-- 
Germán Hüttemann Arza
CNC - Centro Nacional de Computación
UNA - Universidad Nacional de Asunción
Campus Universitario, San Lorenzo - Paraguay
http://www.cnc.una.py  - Tel.: 595 21 585550

---(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: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread Tony Caduto

David Potts wrote:

Can any body recommend a generic opensource  data entry tool that can be
used to make some simple forms for entering data in to postgres?


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

  

For Desktop applications on win32

Lazarus :http://www.lazarus.freepascal.org/

Delphi Turbo Explorer: http://www.turboexplorer.com  (use with ODBC or 
Zeoslib http://www.zeoslib.net)


Sharp Develop:  http://www.icsharpcode.com  (use with npgsql .net data 
provider)


For web based:

PHP and use NVU (http://www.nvu.com) to design the forms. 


Netbeans IDE

There are probably many more



--
Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best option for Postgresql Administration 



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


Re: [GENERAL] Need help with db script, and daily routines

2007-04-19 Thread Richard Huxton

Peter Neu wrote:

Hello,

I have 2 tables:

In one I log the user name of a web site user like this:

Name   Access time
"makost0001"   " 2007-04-19 15:09:19"
"makost0001"   " 2007-04-19 15:09:19"

In the other I have the user name his group and the expiry date of his
account.

Name  Group   Expiry date  
"makost0001"  "book" "2013-04-05 09:41:25.357677"


When the user accesses the web site for the first time I need to change the
expiry date 
to   < today > + 3 years. 


Problem is I need to do this on a regular basis once a day to avoid table
locks. And also how do I tell the program to find the earliest access time
of a user?  Like shown above there a multiple
entries for the same time & user because of the multiple requests. :o(

Should I have a field in the first table like 
when an expiry date is already set?

I'm pretty new to db programming and especially to PostgreSQL. Can somebody
please help?


Once a day, just do something like this:

UPDATE user_expiry_dates
SET expiry_date = CURRENT_DATE + '3 years'::interval
WHERE user_name IN (
  SELECT user_name
  FROM access_logs
  GROUP BY user_name
  HAVING min(access_time) BETWEEN (CURRENT_DATE - '1 day'::interval) 
AND CURRENT_DATE)

);

However, if your expiry date was null before the user has visited the 
site you might find it more efficient to do:


UPDATE user_expiry_dates
SET expiry_date = CURRENT_DATE + '3 years'::interval
WHERE
  expiry_date IS NULL
  AND user_name IN (
SELECT user_name
FROM access_logs
HAVING access_time BETWEEN (CURRENT_DATE - '1 day'::interval) AND 
CURRENT_DATE)

);

Here we don't care if this user has logged in 100 times before today, we 
only update the expiry_date if it's NULL.


HTH
--
  Richard Huxton
  Archonet Ltd

---(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: [GENERAL] How often do I need to reindex tables?

2007-04-19 Thread Martin Gainty

Bill and Tom

Best to find out what kind of index you want to create beforehand
If your data is evenly distributed and exhibits High Cardinality (2 entries 
for A,B,C...Z) then I would recommend a BTREE Index

If not (low cardinality scenarios such as gender) then create Bitmap Index
I cant speak for postgres but index creation will necessitate you to 
schedule time when you can bring DB offline (such as a weekend) as most DB 
will not allow a unique index to be created on a table while the table is in 
use

Also I find oracle books and online documentation very helpful specifically
http://otn.oracle.com
Books are available from Oracle Press

HTH
Martin
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Bill Moran" <[EMAIL PROTECTED]>

To: "Tom Lane" <[EMAIL PROTECTED]>
Cc: 
Sent: Thursday, April 19, 2007 9:33 AM
Subject: Re: [GENERAL] How often do I need to reindex tables?



In response to Tom Lane <[EMAIL PROTECTED]>:


Bill Moran <[EMAIL PROTECTED]> writes:
> Just an FYI ... I remembered what prompted the cron job.

> We were seeing significant performance degradation.  I never did actual
> measurements, but it was on the order of "Bill, why is restoring taking
> such a long time?" from other systems people.  At the time, I poked 
> around

> and tried some stuff here and there and found that reindex restored
> performance.  I didn't look at actual size at that time.

A reindex might improve performance for reasons other than bloat --- to
wit, that a freshly-built index is in perfect physical order, which
tends to get degraded over time by page splits.  How important that is
depends on your usage patterns.  If this is what the story is for your
situation, then what might fix it (in 8.2) is to create the index with
FILLFACTOR 50 or so, so that it's already at the steady state density
and won't need many page splits.

> Anyway, I'll report back in a few weeks as to what the numbers look 
> like.


Yeah, please for the moment just watch what happens with the default
behavior.


Remember this discussion?

To recap, I had scheduled a weekly reindex of this database because I
was seeing performance issues otherwise.  In order to see if this was
actually helping, I disabled the redindex job, ran a few timing
experiments, then scheduled a job to email me the size of the indexes
in the database on a daily basis.

At this point, I have daily records of index size since March 6th.

The behaviour is like this:  A freshly created index is about 21,000
pages in size.  Under normal usage, the index size balloons to about
38,000 pages immediately after the first backup job is run.  From there
it grows slowly (but fairly consistently) by about 100 pages each day.
As of today, it is 44304 pages.

When I first brought up this discussion, the table contained 8068956
rows.  It now has 7451381, which means it's dropped by 7%

The important part is that I can't reproduce the performance problems
that I originally thought were the result of this.  It's entirely
possible that something else was changed since then that actually
fixed the problem, and that the index bloat was a red herring.

Not sure what (if any) conclusions can be drawn from this.  Is there
any other data I should gather?  Have I just proved my previous
rantings about the necessity of reindexing to be wrong?

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

[EMAIL PROTECTED]
Phone: 412-422-3463x4023

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




---(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: [GENERAL] How often do I need to reindex tables?

2007-04-19 Thread Bill Moran
In response to Tom Lane <[EMAIL PROTECTED]>:

> Bill Moran <[EMAIL PROTECTED]> writes:
> > Just an FYI ... I remembered what prompted the cron job.
> 
> > We were seeing significant performance degradation.  I never did actual
> > measurements, but it was on the order of "Bill, why is restoring taking
> > such a long time?" from other systems people.  At the time, I poked around
> > and tried some stuff here and there and found that reindex restored
> > performance.  I didn't look at actual size at that time.
> 
> A reindex might improve performance for reasons other than bloat --- to
> wit, that a freshly-built index is in perfect physical order, which
> tends to get degraded over time by page splits.  How important that is
> depends on your usage patterns.  If this is what the story is for your
> situation, then what might fix it (in 8.2) is to create the index with
> FILLFACTOR 50 or so, so that it's already at the steady state density
> and won't need many page splits.
> 
> > Anyway, I'll report back in a few weeks as to what the numbers look like.
> 
> Yeah, please for the moment just watch what happens with the default
> behavior.

Remember this discussion?

To recap, I had scheduled a weekly reindex of this database because I
was seeing performance issues otherwise.  In order to see if this was
actually helping, I disabled the redindex job, ran a few timing
experiments, then scheduled a job to email me the size of the indexes
in the database on a daily basis.

At this point, I have daily records of index size since March 6th.

The behaviour is like this:  A freshly created index is about 21,000
pages in size.  Under normal usage, the index size balloons to about
38,000 pages immediately after the first backup job is run.  From there
it grows slowly (but fairly consistently) by about 100 pages each day.
As of today, it is 44304 pages.

When I first brought up this discussion, the table contained 8068956
rows.  It now has 7451381, which means it's dropped by 7%

The important part is that I can't reproduce the performance problems
that I originally thought were the result of this.  It's entirely
possible that something else was changed since then that actually
fixed the problem, and that the index bloat was a red herring.

Not sure what (if any) conclusions can be drawn from this.  Is there
any other data I should gather?  Have I just proved my previous
rantings about the necessity of reindexing to be wrong?

-- 
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

[EMAIL PROTECTED]
Phone: 412-422-3463x4023

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


[GENERAL] Need help with db script, and daily routines

2007-04-19 Thread Peter Neu
Hello,

I have 2 tables:

In one I log the user name of a web site user like this:

Name   Access time
"makost0001"   " 2007-04-19 15:09:19"
"makost0001"   " 2007-04-19 15:09:19"

In the other I have the user name his group and the expiry date of his
account.

Name  Group   Expiry date  
"makost0001"  "book" "2013-04-05 09:41:25.357677"

When the user accesses the web site for the first time I need to change the
expiry date 
to   < today > + 3 years. 

Problem is I need to do this on a regular basis once a day to avoid table
locks. And also how do I tell the program to find the earliest access time
of a user?  Like shown above there a multiple
entries for the same time & user because of the multiple requests. :o(

Should I have a field in the first table like 
when an expiry date is already set?

I'm pretty new to db programming and especially to PostgreSQL. Can somebody
please help?


Cheers,
Pete 




---(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: [GENERAL] Auditing a database

2007-04-19 Thread Dave Page
Germán Hüttemann Arza wrote:
> Hi,
> 
> I am developing a web application for auditing tables from a postgresql 
> database.
> 
> My question is: when an update occurrs in the base table, should I insert in 
> the auditing table the new record or the old one?
> 
> I was first inserting the new one but a job partner, who are testing the 
> application suggested that probably would be better to insert the old record 
> because it is simpler to follow the trace of updates.
> 
> What you suggest?

Both?

Regards, Dave.

---(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: [GENERAL] Auditing a database

2007-04-19 Thread Kenneth Downs
Ask the question: can I make sure I always have a complete trail?  If 
you insert the old row, you will always have the old values and the 
table itself holds the new values.


Germán Hüttemann Arza wrote:

Hi,

I am developing a web application for auditing tables from a postgresql 
database.


My question is: when an update occurrs in the base table, should I insert in 
the auditing table the new record or the old one?


I was first inserting the new one but a job partner, who are testing the 
application suggested that probably would be better to insert the old record 
because it is simpler to follow the trace of updates.


What you suggest?

Regards,

  



--
Kenneth Downs
Secure Data Software, Inc.
www.secdat.comwww.andromeda-project.org
631-379-7200   Fax: 631-689-0527


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Auditing a database

2007-04-19 Thread Richard Huxton

Germán Hüttemann Arza wrote:

Hi,

I am developing a web application for auditing tables from a postgresql 
database.


My question is: when an update occurrs in the base table, should I insert in 
the auditing table the new record or the old one?


Old - you already have the new version in the main table.

Before you spend too long working on this though, I'd search for "audit" 
on www.pgfoundry.org



--
  Richard Huxton
  Archonet Ltd

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

  http://archives.postgresql.org/


[GENERAL] Auditing a database

2007-04-19 Thread Germán Hüttemann Arza
Hi,

I am developing a web application for auditing tables from a postgresql 
database.

My question is: when an update occurrs in the base table, should I insert in 
the auditing table the new record or the old one?

I was first inserting the new one but a job partner, who are testing the 
application suggested that probably would be better to insert the old record 
because it is simpler to follow the trace of updates.

What you suggest?

Regards,

-- 
Germán Hüttemann Arza
CNC - Centro Nacional de Computación
UNA - Universidad Nacional de Asunción
Campus Universitario, San Lorenzo - Paraguay
http://www.cnc.una.py  - Tel.: 595 21 585550

---(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: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread Kenneth Downs
If you want end-users to be doing the data entry, Andromeda may be what 
you want.


http://www.andromeda-project.org/

The project is aimed at more complicated cases and may carry too much 
overhead for what you want, but perhaps not.



David Potts wrote:

Can any body recommend a generic opensource  data entry tool that can be
used to make some simple forms for entering data in to postgres?


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



--
Kenneth Downs
Secure Data Software, Inc.
www.secdat.comwww.andromeda-project.org
631-379-7200   Fax: 631-689-0527


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread Richard Huxton

David Potts wrote:

David Potts wrote:


Any platform !

ie Web ,X, , L/Unix console, Mac or even Weandozz


pgadmin, phppgadmin - although these are pitched more towards admin, 
they let you edit table data.


There are also lots of commercial admin/data tools that will work with 
PG - check the announcements list and website.


MS-Access can link to PG via the ODBC drivers if you're interested in 
Windows.


If you're interested in something slightly more custom, look at 
ruby-on-rails or one of the other custom web-building systems. They all 
let you do basic data editing quite quickly.


There's also the gnuenterprise.org project which is supposed to be 
web+gui, but I've never looked at it in detail.


--
  Richard Huxton
  Archonet Ltd

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


Re: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread David Potts
> David Potts wrote:

Any platform !

ie Web ,X, , L/Unix console, Mac or even Weandozz
>>
>> Can any body recommend a generic opensource  data entry tool that can be
>> used to make some simple forms for entering data in to postgres?
>
> For the web? *nix console? GTK? Mac?
>
> --
>Richard Huxton
>Archonet Ltd
>
> ---(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
>



---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Postgres data/form entry tool

2007-04-19 Thread Richard Huxton

David Potts wrote:


Can any body recommend a generic opensource  data entry tool that can be
used to make some simple forms for entering data in to postgres?


For the web? *nix console? GTK? Mac?

--
  Richard Huxton
  Archonet Ltd

---(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: [GENERAL] WAL

2007-04-19 Thread Richard Huxton

Ashish Karalkar wrote:

Hello All,

can anybody please tell me which file name should  given in %f  parameter of 
archive_command.

As per documantation

"When not using WAL archiving, the system normally creates just a few segment files and 
then "recycles" them by renaming no-longer-needed segment files to higher segment 
numbers."


So there are 4/5 files. Now i want to switch to archiving mode.

which file name should be given in place of %f parameter of archive command

my command looks like this:

'cp -i /usr/local/pgsql/data/pg_xlog  /mnt/server/archivedir/%f'


I think you've got the wrong idea. You need to place %p and %f in your 
command-string, and the server replaces them with the correct path/filename.


So - %p will be the full path to the file the system wants you to 
archive and %f is just its name. Re-read section 23.3 of the manuals and 
start off with the example commands perhaps.


--
  Richard Huxton
  Archonet Ltd

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


[GENERAL] Postgres data/form entry tool

2007-04-19 Thread David Potts


Can any body recommend a generic opensource  data entry tool that can be
used to make some simple forms for entering data in to postgres?


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


[GENERAL] WAL

2007-04-19 Thread Ashish Karalkar
Hello All,

can anybody please tell me which file name should  given in %f  parameter of 
archive_command.

As per documantation

"When not using WAL archiving, the system normally creates just a few 
segment files and then "recycles" them by renaming no-longer-needed segment 
files to higher segment numbers."


So there are 4/5 files. Now i want to switch to archiving mode.

which file name should be given in place of %f parameter of archive command

my command looks like this:

'cp -i /usr/local/pgsql/data/pg_xlog  /mnt/server/archivedir/%f'
 

Thanks in advance

With Regards

Ashish...