[GENERAL] Backups

2009-11-08 Thread Bret

I need to back up a production database every night
on FreeBSD 7.2, running Postgresql 8.3.

Any good backup tips I should be aware of.

Typically, I make a backup based on the current day,
and rotate the seven days in the backup file name
 (eg; sat_backup, sun_backup etc).

Thanks for all the chatter.

Bret Stern




-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Backups

2009-11-08 Thread Uwe Schroeder
Personally I prefer multiple stages of backups off-site.
So for my production webserver database, I have slony replicating the database 
to a different location. In addition I run full dumps every 12 hours which in 
turn I replicate using rdist to a remote system. That way, whatever happens, 
the max data loss in the worst case scenario is about 12 hours - which for my 
application is acceptable.
Oh, yes, forgot to mention: the replicated database also gets dumped and goes 
onto a tape every day.



On Saturday 07 November 2009 11:41:55 pm Bret wrote:
 I need to back up a production database every night
 on FreeBSD 7.2, running Postgresql 8.3.

 Any good backup tips I should be aware of.

 Typically, I make a backup based on the current day,
 and rotate the seven days in the backup file name
  (eg; sat_backup, sun_backup etc).

 Thanks for all the chatter.

 Bret Stern

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] WAL shipping to two machines (PITR)

2009-11-08 Thread Tomas Simonaitis
We are using two slaves this way:

- Active server moves WAL files to local directory,
doesn't care about slaves
(basically archive_command = 'mv %p /some/arch_dir/%f')
- Slaves pull WAL files via rsync
- Slaves also do full syncs every several hours (pg_start_backup / rsync / 
pg_stop_backup)
- Active server also has cleanup daemon: removes redundant archived WALs 
based on last full backup time

The slaves are not warm,
however they periodically create LVM snapshots and pg_dump databases.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Problem to use remote cygwin server using ssh and native psql 8.3.5

2009-11-08 Thread Jukka Inkeri


I have installed cycwin and sshd in my Windows server.

I have Winnative psql.exe (8.3.5)

If I use cygwin locally in this server and give command in cygwin session:
   psql -h somehost -U someuser -d somedb
it works fine

But if i use via ssh same way, then no echo ... and process hang.

I have tested remote ssh and local

Cygwin session
   ssh localhost
   = connect local, ...
   psql -h somehost -U someuser -d somedb
   will hang

Cygwin old native psql 8.2 works, but I like to use newer psql = Win 
native psql.exe


tested using Cygwin 1.5.x and 1.7.x

Ssh tty problem using Windows native psql.exe  ?

-jukka-




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem to use remote cygwin server using ssh and native psql 8.3.5

2009-11-08 Thread Jukka Inkeri

Jukka Inkeri wrote:


I have installed cycwin and sshd in my Windows server.

I have Winnative psql.exe (8.3.5)

If I use cygwin locally in this server and give command in cygwin session:
psql -h somehost -U someuser -d somedb
it works fine

But if i use via ssh same way, then no echo ... and process hang.

I have tested remote ssh and local

Cygwin session
ssh localhost
= connect local, ...
psql -h somehost -U someuser -d somedb
will hang

Cygwin old native psql 8.2 works, but I like to use newer psql = Win
native psql.exe

tested using Cygwin 1.5.x and 1.7.x

Ssh tty problem using Windows native psql.exe ?



If I use flag -f in psql, then no problem.

psql -h somehost -U someuser -d somedb -f mysqlcommands.txt
works fine.  Also special -f - = stdin works.

Interactive work not.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Getting iPhone Simulator App to compile with libpq on Snow Leopard

2009-11-08 Thread Bob Henkel
In my quest to create a simple PostgreSQL program that runs on the
iPhone I have ran into some problems.

The first issue I had with my build was libpq being compiled for
architecture of type x86_64 by default on Snow Leopard and the
Simulator being i386 so my build would fail telling me libpq was the
wrong architecture type. I was able to get around this issue as found
here - 
http://stackoverflow.com/questions/1678381/connect-iphone-app-to-postgresql-using-libpq.

Now I'm getting a new Undefined symbols issue.
Here is the code that is attempting to connect to PostgreSQL

//
//  iPhonePgAppDelegate.m
//  iPhonePg
//
//  Created by bob on 11/4/09.
//  Copyright __MyCompanyName__ 2009. All rights reserved.
//

#import iPhonePgAppDelegate.h
#import iPhonePgViewController.h
#include libpq-fe.h
@implementation iPhonePgAppDelegate

@synthesize window;
@synthesize viewController;


- (void)applicationDidFinishLaunching:(UIApplication *)application {
const char *conninfo;
PGconn *conn;
PGresult   *res;



conninfo = host = 192.168.1.5 dbname = dev user=postgres password=z;

/* Make a connection to the database */
conn = PQconnectdb(conninfo);
res = PQexec(conn, INSERT INTO public.junk(junk_data) VALUES('HELLO'););
if (PQstatus(conn) != CONNECTION_OK)
{
fprintf(stderr, Connection to database failed: %s,
PQerrorMessage(conn));
}
PQclear(res);
PQfinish(conn);

[window addSubview:viewController.view];
[window makeKeyAndVisible];
}


- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
Here is the output from my build attempt that is showing an error.
Keep in mind I have the equivalent Mac version of this app connecting
to PostgreSQL just fine. The only real difference is the project type
of the apps, Mac app vs iPhone app. So I feel pretty good about me not
doing something that is obviously wrong. I'm on Snow Leopard with
Xcode 3.2 using libpq compiled for i386 from PostgreSQL 8.4.1 source.

Ld build/Debug-iphonesimulator/iPhonePg.app/iPhonePg normal i386
cd /Users/bob/Documents/Programming/PragProgrammerIphoneSDK/iPhonePg
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH 
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
-arch i386 -isysroot
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk
-L/Users/bob/Documents/Programming/PragProgrammerIphoneSDK/iPhonePg/build/Debug-iphonesimulator
-L../../../../mylibs
-L/Users/bob/Documents/Programming/PragProgrammerIphoneSDK/iPhonePg
-L/Users/bob/Documents/Programming/PragProgrammerIphoneSDK/iPhonePg/../../../../mylibs
-F/Users/bob/Documents/Programming/PragProgrammerIphoneSDK/iPhonePg/build/Debug-iphonesimulator
-filelist 
/Users/bob/Documents/Programming/PragProgrammerIphoneSDK/iPhonePg/build/iPhonePg.build/Debug-iphonesimulator/iPhonePg.build/Objects-normal/i386/iPhonePg.LinkFileList
-mmacosx-version-min=10.5 -framework Foundation -framework UIKit
-framework CoreGraphics
/Users/bob/Documents/Programming/PragProgrammerIphoneSDK/iPhonePg/../../../../mylibs/libpq.i386
-o 
/Users/bob/Documents/Programming/PragProgrammerIphoneSDK/iPhonePg/build/Debug-iphonesimulator/iPhonePg.app/iPhonePg

Undefined symbols:
  _fopen$UNIX2003, referenced from:
  _parseServiceInfo in libpq.i386(fe-connect.o)
  _PasswordFromFile in libpq.i386(fe-connect.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Any help would be greatly appreciated.

Thanks
Bob

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] adding a custom tsearch parser

2009-11-08 Thread Daniel Verite
ara.t.howard wrote:

 my questions are
 
 1) can the current parser be configured in any way?
 
 2) if not, can someone provide and direction towards writing my own
 and configuring pg to use it?

http://www.postgresql.org/docs/current/static/test-parser.html

Best regards,
-- 
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem to use remote cygwin server using ssh and native psql 8.3.5

2009-11-08 Thread Sam Mason
On Sun, Nov 08, 2009 at 02:25:26PM +0200, Jukka Inkeri wrote:
 Jukka Inkeri wrote:
 tested using Cygwin 1.5.x and 1.7.x
 
 Ssh tty problem using Windows native psql.exe ?
 
 If I use flag -f in psql, then no problem.
  [...]
 Interactive work not.

If I remember correctly it's to do with strange interactions with
the terminal under cygwin.  I think it is actually working, just not
displaying things correctly.  Try typing in a query and exiting, I think
it'll do the right thing.  I can't remember what I did to get it
working though.

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Problem granting access to a PlPython function

2009-11-08 Thread Mariano Mara
Hi,
I have this plpython function that I need to execute with a non
superuser. I logged in the postgres account, create it and grant execute
rights to the target user. 
However I cannot execute it with this user: I'm getting a function ...
does not exist error and after poking it for a few hours without luck,
it seems this problem is too much for a n00b like me.
Can anyone offer a hint how to make it work?
Following is a full example of what I'm doing:


# su - postgres
-bash-3.2$ psql -f hours_pgsql_function.sql
CREATE FUNCTION
-bash-3.2$ psql
Welcome to psql 8.3.8, the PostgreSQL interactive terminal.

postgres=# select hours_between(localtimestamp, localtimestamp,
cast('Argentina' as character varying));
 hours_between 
---
 0
(1 row)

postgres=# grant execute on function hours_between (timestamp without
time zone, timestamp without time zone, character varying) to otrs;
GRANT
postgres=# \q
-bash-3.2$ psql -d otrs -U otrs
Welcome to psql 8.3.8, the PostgreSQL interactive terminal.

otrs= select hours_between(localtimestamp, localtimestamp,
cast('Argentina' as character varying));
ERROR:  function hours_between(timestamp without time zone, timestamp
without time zone, character varying) does not exist
LINE 1: select hours_between(localtimestamp, localtimestamp, cast('A...
   ^
HINT:  No function matches the given name and argument types. You might
need to add explicit type casts.
otrs= 

TIA,
Mariano.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem granting access to a PlPython function

2009-11-08 Thread Sam Mason
On Sun, Nov 08, 2009 at 05:07:16PM -0300, Mariano Mara wrote:
 I have this plpython function that I need to execute with a non
 superuser. I logged in the postgres account, create it and grant execute
 rights to the target user. 
 However I cannot execute it with this user: I'm getting a function ...
 does not exist error and after poking it for a few hours without luck,

It looks like you're creating it in a different database (and/or schema)
from the one you're trying to access it from.  Functions are associated
with exactly one schema and this schema will exist in exactly one
database. Your search_path specifies the schema(s) to look in for
tables/functions, you can change it by doing:

  SET search_path = myschema;

You need to be connected to the right database for this to work; psql
-l gives you a list.  The command \df lists all (user defined)
functions that you can currently see.

Hope that helps point you in the right direction!

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem to use remote cygwin server using ssh and native psql 8.3.5

2009-11-08 Thread Magnus Hagander
On Sun, Nov 8, 2009 at 12:35, Jukka Inkeri p...@awot.fi wrote:

 I have installed cycwin and sshd in my Windows server.

 I have Winnative psql.exe (8.3.5)

 If I use cygwin locally in this server and give command in cygwin session:
   psql -h somehost -U someuser -d somedb
 it works fine

 But if i use via ssh same way, then no echo ... and process hang.

 I have tested remote ssh and local

 Cygwin session
   ssh localhost
   = connect local, ...
   psql -h somehost -U someuser -d somedb
   will hang

 Cygwin old native psql 8.2 works, but I like to use newer psql = Win native
 psql.exe

 tested using Cygwin 1.5.x and 1.7.x

 Ssh tty problem using Windows native psql.exe  ?

The native psql is written for Windows, not for Cygwin. You really
shouldn't be using it there... If you are using Cygwin, you should be
using a Cygwin psql.exe.


-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem granting access to a PlPython function

2009-11-08 Thread Mariano Mara
Excerpts from Sam Mason's message of Sun Nov 08 17:18:52 -0300 2009:
 On Sun, Nov 08, 2009 at 05:07:16PM -0300, Mariano Mara wrote:
  I have this plpython function that I need to execute with a non
  superuser. I logged in the postgres account, create it and grant execute
  rights to the target user. 
  However I cannot execute it with this user: I'm getting a function ...
  does not exist error and after poking it for a few hours without luck,
 
 It looks like you're creating it in a different database (and/or schema)
 from the one you're trying to access it from.  Functions are associated
 with exactly one schema and this schema will exist in exactly one
 database. Your search_path specifies the schema(s) to look in for
 tables/functions, you can change it by doing:
 
   SET search_path = myschema;
 
 You need to be connected to the right database for this to work; psql
 -l gives you a list.  The command \df lists all (user defined)
 functions that you can currently see.
 
 Hope that helps point you in the right direction!
 

That was fast and it was right too. Seems I still need to master the
whole database/schema concept.

Thanks a lot Sam for your time and advice, I really appreciate it.

Mariano.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] I can't seem to put the right combination of magic into the pg_hba and pg_ident files.

2009-11-08 Thread Tim Uckun
I want to accomplish what I would think would be a simple thing. I
want the root user to be able to connect to the postgres database as
user postgres from the local machine without passwords.  Since I am
doing this from a program I don't want to use the su facility.

I have tried a lot of different combinations of things into the
pg_hba.conf and pg_ident.conf but I can't make anything work.

Here is my pg_ident file

pg_map  rootpostgres


Here is the line from pg_hba

local   all all   ident map=pg_map

What am I doing wrong here?

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [pgsql-es-ayuda] Ayuda con NOTIFY en C

2009-11-08 Thread Yadisnel Galvez Velazquez
Gracias Alvaro, mi pregunta era por si se podía implementar por uno mismo. El 
problema es que necesito comunicar una librería en C de un trigger con una 
aplicación que realiza réplica para que informe sobre cambios que se realizan 
en las tablas, esto lo he logrado mediante una implementación de la 
arquitectura CORBA para C pero no estoy conforme con el rendimiento. Quisiera 
utilizar mecanismos nativos de PostgreSQL para comunicar la librería .so del 
trigger con mi aplicación también escrita en C. Conoces algún mecanismo 
(sockets o algo así) de PostgreSQL para hacer esto??

- Mensaje original -
De: Alvaro Herrera alvhe...@alvh.no-ip.org
Para: Yadisnel Galvez Velazquez ygal...@uci.cu
CC: pgsql-es-ay...@postgresql.org
Enviados: Domingo, 8 de Noviembre 2009 21:36:04 GMT -04:00 Georgetown
Asunto: Re: [pgsql-es-ayuda] Ayuda con NOTIFY en C

Yadisnel Galvez Velazquez escribió:
 Hola a todos:
 He implementado un proceso (LISTEN) en C que está subscrito a un evento 
 NOTIFY, este funciona bien pero necesito pasar un parámetro extra (en el 
 campo notify-extra). Según la documentación oficial esto es posible, mi 
 pregunta es cómo hacerlo. Se que puedo forzar un evento NOTIFY haciendo:
 NOTIFY nombre_del_evento; 
 en este caso como paso un argumento extra??

No está implementado el paso de parámetros extra, hasta donde recuerdo.

-- 
Alvaro Herrera   Vendo parcela en Valdivia:
http://valdivia.vivastreet.cl/loteos-lotes+valdivia/parcela-en-cabo-blanco--valdivia/19288372
Ciencias políticas es la ciencia de entender por qué
 los políticos actúan como lo hacen  (netfunny.com)

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [pgsql-es-ayuda] Ayuda con NOTIFY en C

2009-11-08 Thread Alvaro Herrera
Yadisnel Galvez Velazquez wrote:
 Gracias Alvaro, mi pregunta era por si se podía implementar por uno mismo. El 
 problema es que necesito comunicar una librería en C de un trigger con una 
 aplicación que realiza réplica para que informe sobre cambios que se realizan 
 en las tablas, esto lo he logrado mediante una implementación de la 
 arquitectura CORBA para C pero no estoy conforme con el rendimiento. Quisiera 
 utilizar mecanismos nativos de PostgreSQL para comunicar la librería .so del 
 trigger con mi aplicación también escrita en C. Conoces algún mecanismo 
 (sockets o algo así) de PostgreSQL para hacer esto??

Ya hay varios sistemas de replicación implementados, ¿los estudiaste
antes de intentar implementar uno tú mismo?



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

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] I can't seem to put the right combination of magic into the pg_hba and pg_ident files.

2009-11-08 Thread Tom Lane
Tim Uckun timuc...@gmail.com writes:
 I want to accomplish what I would think would be a simple thing. I
 want the root user to be able to connect to the postgres database as
 user postgres from the local machine without passwords.  Since I am
 doing this from a program I don't want to use the su facility.

I suspect you are expecting that the map will cause root to be
logged in as postgres without asking for that.  It won't.
What it will do is allow psql -U postgres and similar to work.

BTW, one has to wonder why you are using the root account for this
work in the first place.  Wouldn't it be a lot more secure to use
a less privileged account (oh, I don't know, maybe postgres)?

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] question about using pgmemcache

2009-11-08 Thread Juan Backson
Hi,

I am planning to pgmemcache to act as a fast-accessible cache before my app
and postgres.

I have got it pgmemcache setup.  The question I have is that if memcached
crashes, and I need to restart memcached, since memcached is not persistent,
do I need to run some scripts to auto-recreate all the key value data from
postgres?

What is the easiest way to do it?  Is there anyway that I can write some
syncup function to let postgres to do the re-creation of data to memcached.

Thanks,
jb


Re: [GENERAL] question about using pgmemcache

2009-11-08 Thread Chris

Juan Backson wrote:

Hi,
 
I am planning to pgmemcache to act as a fast-accessible cache before my 
app and postgres.
 
I have got it pgmemcache setup.  The question I have is that if 
memcached crashes, and I need to restart memcached, since memcached is 
not persistent, do I need to run some scripts to auto-recreate all the 
key value data from postgres?  


It depends on how your app is using it. If it absolutely requires the 
data to be in memcache, then yes. If it supports falling back to the db 
if it doesn't find it in memcache (and then adding it to memcache), then 
no - your app will re-populate memcache as it needs to.


What is the easiest way to do it?  Is there anyway that I can write some 
syncup function to let postgres to do the re-creation of data to memcached.


You'll need to write your own script(s) to do this - memcache has no 
idea what you want to cache (so there's no auto sync type script).


--
Postgresql  php tutorials
http://www.designmagick.com/


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] I can't seem to put the right combination of magic into the pg_hba and pg_ident files.

2009-11-08 Thread Tim Uckun
 I suspect you are expecting that the map will cause root to be
 logged in as postgres without asking for that.  It won't.
 What it will do is allow psql -U postgres and similar to work.

That's exactly what I am looking to do. In my case I have a script
that runs as root. I want to log in as postgres user from that script
but the script is running as root.

The way I have it set up doesn't permit that. I want to know what I
need to do in order to make that happen.


 BTW, one has to wonder why you are using the root account for this
 work in the first place.  Wouldn't it be a lot more secure to use
 a less privileged account (oh, I don't know, maybe postgres)?


This script is a part of the initial setup script for the server. It
has to run as root because when it starts running postgres is not
installed and there is no postgres user.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem to use remote cygwin server using ssh and native psql 8.3.5

2009-11-08 Thread Jukka Inkeri




The native psql is written for Windows, not for Cygwin. You really
shouldn't be using it there... If you are using Cygwin, you should be
using a Cygwin psql.exe.




PG pages says: use native, not cygwin version anymore. It's not problem 
if it's windows binary, you can use many native binary commands in 
cygwin, ex. java. psql termio is the problem. If I translate 8.4.1 using 
gcc, those binary not work also.


Psql not work. It works, if you set -f - = stdin, but then you not get 
command prompt and that kind of psql output.


My scripts works now, after I use win binary psql with flag -f, just as 
I said in my own answer.


-jukka-

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] I can't seem to put the right combination of magic into the pg_hba and pg_ident files.

2009-11-08 Thread Scott Marlowe
On Sun, Nov 8, 2009 at 9:08 PM, Tim Uckun timuc...@gmail.com wrote:
 I suspect you are expecting that the map will cause root to be
 logged in as postgres without asking for that.  It won't.
 What it will do is allow psql -U postgres and similar to work.

 That's exactly what I am looking to do. In my case I have a script
 that runs as root. I want to log in as postgres user from that script
 but the script is running as root.

 The way I have it set up doesn't permit that. I want to know what I
 need to do in order to make that happen.

then say you're postgres in the script with the -U (if you're using psql)

AS ROOT:
psql -U postgres -h remote_db dbname

Note that ident doesn't work so well between machines, so you might
want to look at .pgpass

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] I can't seem to put the right combination of magic into the pg_hba and pg_ident files.

2009-11-08 Thread Tim Uckun
 then say you're postgres in the script with the -U (if you're using psql)

 AS ROOT:
 psql -U postgres -h remote_db dbname

 Note that ident doesn't work so well between machines, so you might
 want to look at .pgpass


That's what I am trying to get working. In actuality I am using ruby
and using a db library but the concept is the same. I need to log in
as postgres when the script is running as root.  I could trust all
local connections or something but I don't want to do that either.

 When I do a psql -U postgres I get this

psql -U postgres
psql: FATAL:  Ident authentication failed for user postgres


Obviously  I need to tell postgres to trust the user root when
connected locally as postgres.

How do I do that?

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] I can't seem to put the right combination of magic into the pg_hba and pg_ident files.

2009-11-08 Thread John R Pierce

Tim Uckun wrote:

psql -U postgres
psql: FATAL:  Ident authentication failed for user postgres


Obviously  I need to tell postgres to trust the user root when
connected locally as postgres.

How do I do that?
  



either create a postgres user named 'root' and give it superuser 
privileges, or switch to a different method of authentication for LOCAL 
users




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] virtualidx exclusive lock

2009-11-08 Thread Uwe Schroeder

I've googled, but there's 0 hits.

I have an issue with a ton of idle in transaction backends.
What I noticed is when I look at pg_locks, pretty much all of the processes 
being idle in transaction have an exclusive lock of locktype virtualidx.

Well, that doesn't make sense to me, but maybe someone here can tell me where a 
virtualidx locktype would come from. I'm sure it has to be some type of query.
There is no info about table or anything, all the records look like:

   locktype| database | relation | page | tuple | virtualxid | 
transactionid | classid | objid | objsubid | virtualtransaction |  pid  |   
mode   | granted
---+--+--+--+---++---+-+---+--++---+--+-
virtualxid|  |  |  |   | 63/10150   |   
| |   |  | 63/10150   | 31932 | ExclusiveLock| t
 virtualxid|  |  |  |   | 48/48530   |  
 | |   |  | 48/48530   | 31323 | ExclusiveLock| 
t
 virtualxid|  |  |  |   | 47/52387   |  
 | |   |  | 47/52387   | 31321 | ExclusiveLock| 
t
 virtualxid|  |  |  |   | 76/4086|  
 | |   |  | 76/4086| 32074 | ExclusiveLock| 
t
 virtualxid|  |  |  |   | 15/6007096 |  
 | |   |  | 15/6007096 | 31169 | ExclusiveLock| 
t
 virtualxid|  |  |  |   | 10/5689919 |  
 | |   |  | 10/5689919 | 31595 | ExclusiveLock| 
t
 virtualxid|  |  |  |   | 32/603998  |  
 | |   |  | 32/603998  | 31213 | ExclusiveLock| 
t
 virtualxid|  |  |  |   | 42/117511  |  
 | |   |  | 42/117511  | 31270 | ExclusiveLock| 
t
 virtualxid|  |  |  |   | 39/279415  |  
 | |   |  | 39/279415  | 31267 | ExclusiveLock| 
t


Is there a way to find out what query, or in lack of that at least what table 
is involved?

Thanks

Uwe


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general