Re: [GENERAL] Question on libpq parameters

2008-11-29 Thread Owen Hartnett
At 11:45 PM -0500 11/29/08, Tom Lane wrote: Owen Hartnett <[EMAIL PROTECTED]> writes: The following libpq code chokes on me with invalid input to an integer parameter (state == PGRES_FATAL_ERR aPtr == "Error: Invalid Input syntax for integer """ . It fails on the call to PQexecPrepared. I

Re: [GENERAL] Question on libpq parameters

2008-11-29 Thread Tom Lane
Owen Hartnett <[EMAIL PROTECTED]> writes: > The following libpq code chokes on me with invalid input to an > integer parameter (state == PGRES_FATAL_ERR aPtr == "Error: Invalid > Input syntax for integer """ . It fails on the call to > PQexecPrepared. I suspect I'm not doing the parameters ri

[GENERAL] Question on libpq parameters

2008-11-29 Thread Owen Hartnett
The following libpq code chokes on me with invalid input to an integer parameter (state == PGRES_FATAL_ERR aPtr == "Error: Invalid Input syntax for integer """ . It fails on the call to PQexecPrepared. I suspect I'm not doing the parameters right. Can anyone spot anything wrong? Thanks,

Re: [GENERAL] Install question on Mac Leopard Server 10.5

2008-11-29 Thread Shane Ambler
Steve Henry wrote: I am just getting started with PostgreSQL. I've installed PostgreSQL 8.3.5-1 on a MacPro server running Leopard Server 105.5 I can connect to the database with PGAdmin on the server, but I can't access the database from another Mac on my network. I get the following error

Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Scott Marlowe
On Sat, Nov 29, 2008 at 3:23 PM, Andrus <[EMAIL PROTECTED]> wrote: > Uwe, > > thank you very much. I created script and ran it from command line: > > #!/bin/sh > PGUSER=postgres > PGPASSWORD=password > export PGUSER PGPASSWORD > backupdir=/root/my-backups > backupdate=$(date +%u) > backupfile=${bac

Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Andrus
Uwe, thank you very much. I created script and ran it from command line: #!/bin/sh PGUSER=postgres PGPASSWORD=password export PGUSER PGPASSWORD backupdir=/root/my-backups backupdate=$(date +%u) backupfile=${backupdir}/mybackup${backupdate}.backup pg_dump -Fc -b -Z6 mydb >${backupfile} /usr/bin/f

Re: [GENERAL] Install question on Mac Leopard Server 10.5

2008-11-29 Thread ries van Twisk
On Nov 29, 2008, at 4:05 PM, ries van Twisk wrote: On Nov 29, 2008, at 3:56 PM, Steve Henry wrote: I am just getting started with PostgreSQL. I've installed PostgreSQL 8.3.5-1 on a MacPro server running Leopard Server 105.5 I can connect to the database with PGAdmin on the server, but I

[GENERAL] How do I index to speed up OVERLAPS?

2008-11-29 Thread Matthew Wilson
I have a table shift with a start_time column and a stop_time column and I do a lot of queries like: select * from shift where (start_time, stop_time) overlaps ($A, $B); $A and $B are user-submitted values. Anyhow, how do I put indexes on my table to make these queries run faster? Also,

Re: [GENERAL] Install question on Mac Leopard Server 10.5

2008-11-29 Thread ries van Twisk
On Nov 29, 2008, at 3:56 PM, Steve Henry wrote: I am just getting started with PostgreSQL. I've installed PostgreSQL 8.3.5-1 on a MacPro server running Leopard Server 105.5 I can connect to the database with PGAdmin on the server, but I can't access the database from another Mac on my net

[GENERAL] Install question on Mac Leopard Server 10.5

2008-11-29 Thread Steve Henry
I am just getting started with PostgreSQL. I've installed PostgreSQL 8.3.5-1 on a MacPro server running Leopard Server 105.5 I can connect to the database with PGAdmin on the server, but I can't access the database from another Mac on my network. I get the following error message: I've

Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Scott Marlowe
On Sat, Nov 29, 2008 at 12:39 PM, Uwe C. Schroeder <[EMAIL PROTECTED]> wrote: > Now you'd just have to figure out the ftp part, because I use rdist to push > the copies to a backup machine. Look up lftp. It's a very capable scriptable ftp client with automatic retry etc... also does ssl. -- Se

Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Uwe C. Schroeder
On Saturday 29 November 2008, Andrus wrote: > How to create automated backup script in Gentoo which in every night 3:00 > PM backups one database and sends backup > with ftp using unique file name? > > In windows I can use scheduler and script > > set FILENAME=%DATE:~8,4%%DATE:~5,2%%DATE:~2,2%MyDb

Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Alan Hodgson
On Saturday 29 November 2008, "Andrus" <[EMAIL PROTECTED]> wrote: > How to create automated backup script in Gentoo which in every night 3:00 > PM backups one database and sends backup > with ftp using unique file name? > > In windows I can use scheduler and script > > set FILENAME=%DATE:~8,4%%DATE

[GENERAL] db backup script in gentoo

2008-11-29 Thread Andrus
How to create automated backup script in Gentoo which in every night 3:00 PM backups one database and sends backup with ftp using unique file name? In windows I can use scheduler and script set FILENAME=%DATE:~8,4%%DATE:~5,2%%DATE:~2,2%MyDbBackup pg_dump -Z6 -b -v -f "%FILENAME%.backup" -F c -h

Re: [GENERAL] why hash on the primary key?

2008-11-29 Thread Robert Haas
>>> Well, that just says your cost parameters need a bit of adjustment >>> if you'd like the planner to get the crossover point exactly right. > >> Any sense of which ones might be worth fiddling with? > > random_page_cost, effective_cache_size, maybe the cpu_xxx parameters. I fiddled with this so

Re: [GENERAL] why hash on the primary key?

2008-11-29 Thread Tom Lane
"Robert Haas" <[EMAIL PROTECTED]> writes: >> What's strange about it? A probe into an in-memory hashtable is a lot >> cheaper than a probe into an index, so this type of plan makes plenty >> of sense if the hashtable will fit in RAM and there are going to be a >> lot of probes. (Where "a lot" mea

Re: [GENERAL] why hash on the primary key?

2008-11-29 Thread Robert Haas
> What's strange about it? A probe into an in-memory hashtable is a lot > cheaper than a probe into an index, so this type of plan makes plenty > of sense if the hashtable will fit in RAM and there are going to be a > lot of probes. (Where "a lot" means "enough to amortize the cost of > building

Re: [GENERAL] why hash on the primary key?

2008-11-29 Thread Robert Haas
> Could you send the output of these two queries using "explain analyze" > instead of plain explain? portal=# explain analyze select * from foo i, foo j where i.id = j.id; QUERY PLAN