Re: [GENERAL] Incrementally Updated Backups

2010-09-12 Thread Joshua D. Drake
On Sun, 2010-09-12 at 12:18 +0200, J. Roeleveld wrote: > On Sunday 12 September 2010 00:43:19 Bruce Momjian wrote: > > Gabe Nell wrote: > > > > That section has been removed from the current 9.0 docs because we are > > > > unsure it works. > > > > > > Hmm. So the only way to make a consistent back

Re: [GENERAL] JSON output

2010-09-12 Thread Dennis Gearon
No, don't need all the set stuff, just the result of either: 1/ A SELECT * from a view that is a query, 2/ Or the result of the same query. Seems like it'd take a lot of horsepower to: A/ Do the query B/ Convert it to XML C/ Convert it to JSON D/ Then insert it into ElasticSearch. I'm

Re: [GENERAL] Huge amount of memory errors with libpq

2010-09-12 Thread Casey Jones
On Sunday 12 September 2010 5:44:26 pm you wrote: > Casey Jones writes: > > I don't think valgrind is the only issue here because outside valgrind my > > data is getting magically overwritten. In the function causing that > > problem I set all the fields I wanted to set by hand instead of using >

Re: [GENERAL] Change the UI language of psql connection

2010-09-12 Thread Brodie Thiesfield
On Mon, Sep 13, 2010 at 12:33 PM, Tom Lane wrote: > Brodie Thiesfield writes: >> I have a PostgreSQL 8.4 database, installed with Japanese as the main >> language. I am connecting from an English Windows 7 client using >> psql.exe. Is there any way to change the UI of the messages shown to >> me

Re: [GENERAL] Help! pg_dump: Error message from server: ERROR: cache lookup failed for type 19

2010-09-12 Thread Craig Ringer
On 11/09/10 14:21, 夏武 wrote: > i use the slony for replication of postgresql database. it work fine > some day. > After i use the slony command to delete the replication node, pg_dump > does not work, the error message is: > *pg_dump: schema with OID 73033 does not exist* > > Then i delete the nam

Re: [GENERAL] JSON output

2010-09-12 Thread Craig Ringer
On 13/09/10 10:36, Dennis Gearon wrote: > I'm trying to import from a postgres database (which will work in parallel) > to a ElasticSearch databse (JSON input). > > Is there anyway to get JSON output from postgres? Not out of the box. The closest you'll get, AFAIK, is XML output from the SQLXML

Re: [GENERAL] Change the UI language of psql connection

2010-09-12 Thread Tom Lane
Brodie Thiesfield writes: > I have a PostgreSQL 8.4 database, installed with Japanese as the main > language. I am connecting from an English Windows 7 client using > psql.exe. Is there any way to change the UI of the messages shown to > me (e.g. the help, column headers from the \l command, etc)

[GENERAL] Change the UI language of psql connection

2010-09-12 Thread Brodie Thiesfield
I have a PostgreSQL 8.4 database, installed with Japanese as the main language. I am connecting from an English Windows 7 client using psql.exe. Is there any way to change the UI of the messages shown to me (e.g. the help, column headers from the \l command, etc) to English? I know that I can set

[GENERAL] JSON output

2010-09-12 Thread Dennis Gearon
I'm trying to import from a postgres database (which will work in parallel) to a ElasticSearch databse (JSON input). Is there anyway to get JSON output from postgres? (googled, found only 'planner' output does this) Dennis Gearon Signature Warning EARTH has a Right To Life, o

Re: [GENERAL] Monitoring Object access

2010-09-12 Thread Craig Ringer
On 09/12/2010 10:02 PM, adi hirschtein wrote: Hi Craig, Thanks a lot for the quick response! I'm coming from the Oracle side of the house and In oracle for instance, you use shared buffer as well, but you are still able to see which session is waiting for which blocks and if one session is doing

[GENERAL] Schema search path

2010-09-12 Thread Yaroslav Tykhiy
Hi there, Sorry but I've got yet another issue to discuss today, this time that on schema search path. In fact it may not be a bug, but it may be worth a note in the documentation. It seems that if the table in SELECT FROM has an explicit schema specifier, further references to the same

Re: [GENERAL] Query plan choice issue

2010-09-12 Thread Martin Gainty
a cursory look of the plan details a FTS on dbmail_headername invoked by the JOIN clause JOIN dbmail_headername n ON v.headername_id=n.id you would accelerate the seek appreciably by placing indexes on both participating columns v.headername_id n.id I also see a FTS on domain_headervalue invoke

[GENERAL] Query plan choice issue

2010-09-12 Thread Yaroslav Tykhiy
Hi all, I'm seeing a funny behaviour in Postgresql 8.4.4. Namely, a query can be executed using either of two different query plans, one taking a few milliseconds and the other, tens of seconds. The work_mem setting doesn't seem to affect it -- tried to increase or decrease it by 2 or 4

Re: [GENERAL] Huge amount of memory errors with libpq

2010-09-12 Thread Tom Lane
Casey Jones writes: > I don't think valgrind is the only issue here because outside valgrind my > data is getting magically overwritten. In the function causing that problem > I set all the fields I wanted to set by hand instead of using PQgetvalue(). > If I leave PQexec() uncommented, my data i

Re: [GENERAL] why can't see the updated value after SPI_execute("update ....", false, 1);

2010-09-12 Thread sunpeng
I then added , yet it still doesn't work. 2010/9/12 Tom Lane > sunpeng writes: > > First I use SPI_execute("update > > bool succ; > >SPI_connect(); > > int ret = SPI_execute("update where uid = 1", false, 1);//later > will > > add error processing > > if (ret == SPI_OK_

Re: [GENERAL] Huge amount of memory errors with libpq

2010-09-12 Thread Casey Jones
On Sun, Sep 12, 2010 at 7:54 AM, Craig Ringer wrote: > > Anyway, since you've provided a test program, I can at least run it here on > a modern PostgreSQL and see what results I get to provide some more info. In > this case, it runs fine and no issues are detected. I'm on a 64-bit Fedora > 13 insta

[GENERAL] pgcrypto pgp_pub_decrypt() fails with secret key password

2010-09-12 Thread Eric Lukather
Hi, I have pgcrypto working fine with gpg keys that do *not* have a passphrase. But, if I try the exact same gpg -a --export commands and application code with gpg keys that are generated *with* a passphrase, then I get the following pgp_pub_decrypt() error within psql: \set pubkey `sed

Re: [GENERAL] why can't see the updated value after SPI_execute("update ....", false, 1);

2010-09-12 Thread Tom Lane
sunpeng writes: > First I use SPI_execute("update > bool succ; >SPI_connect(); > int ret = SPI_execute("update where uid = 1", false, 1);//later will > add error processing > if (ret == SPI_OK_UPDATE && SPI_processed == 1) { > succ = true; >} >SPI_finish();

Re: [GENERAL] Monitoring Object access

2010-09-12 Thread adi hirschtein
Hi Craig, Thanks a lot for the quick response! I'm coming from the Oracle side of the house and In oracle for instance, you use shared buffer as well, but you are still able to see which session is waiting for which blocks and if one session is doing the "real" I/O then the other one wait on 'wait

Re: [GENERAL] Incrementally Updated Backups

2010-09-12 Thread Scott Marlowe
On Sun, Sep 12, 2010 at 7:51 AM, Bruce Momjian wrote: > J. Roeleveld wrote: >> Nice in theory. >> Except backups can not be fully trusted if they rely on database recovery >> mechanics as part of the restore process. > >> How certain can you be that the data you have in your backup will always >>

Re: [GENERAL] Incrementally Updated Backups

2010-09-12 Thread Bruce Momjian
J. Roeleveld wrote: > On Sunday 12 September 2010 13:32:00 Martijn van Oosterhout wrote: > > On Sun, Sep 12, 2010 at 12:18:10PM +0200, J. Roeleveld wrote: > > > How can you ensure the snapshot is in a consistent state if the server is > > > running? > > > > > > If a snapshot is taken between 2 upd

Re: [GENERAL] Incrementally Updated Backups

2010-09-12 Thread Scott Marlowe
On Sun, Sep 12, 2010 at 7:39 AM, J. Roeleveld wrote: > On Sunday 12 September 2010 13:32:00 Martijn van Oosterhout wrote: >> On Sun, Sep 12, 2010 at 12:18:10PM +0200, J. Roeleveld wrote: >> > How can you ensure the snapshot is in a consistent state if the server is >> > running? >> > >> > If a sna

Re: [GENERAL] Incrementally Updated Backups

2010-09-12 Thread J. Roeleveld
On Sunday 12 September 2010 13:32:00 Martijn van Oosterhout wrote: > On Sun, Sep 12, 2010 at 12:18:10PM +0200, J. Roeleveld wrote: > > How can you ensure the snapshot is in a consistent state if the server is > > running? > > > > If a snapshot is taken between 2 updates in a single transaction, on

Re: [GENERAL] Monitoring Object access

2010-09-12 Thread Craig Ringer
On 09/12/2010 06:52 PM, adi hirschtein wrote: Hi, Using the catalog tables, is there any way to correlate session id/user id to which object (i.e. tables, indexes etc) it access and much how disk reads or I/O wait has been done against the objects. in general, I'd like to see which objects are be

Re: [GENERAL] Huge amount of memory errors with libpq

2010-09-12 Thread Craig Ringer
On 09/12/2010 02:53 PM, Casey Jones wrote: My development server was initially running 8.4.4 on Gentoo. I downgraded to 8.1.21 (still on Gentoo) to match my CentOS production server to see if the problems would go away, but they didn't. Thanks for the test case. It's rare - and delightful - t

Re: [GENERAL] How to inherit search_path from template

2010-09-12 Thread Scott Marlowe
On Thu, Sep 9, 2010 at 7:41 PM, Merlin Moncure wrote: > On Thu, Sep 9, 2010 at 7:13 AM, Phui Hock wrote: >> Hi, >> How can I create a database template with altered search_path to be >> inherited by child databases? Say, I created a template named >> template_a with the following commands: > > It

[GENERAL] why can't see the updated value after SPI_execute("update ....", false, 1);

2010-09-12 Thread sunpeng
First I use SPI_execute("update bool succ; SPI_connect(); int ret = SPI_execute("update where uid = 1", false, 1);//later will add error processing if (ret == SPI_OK_UPDATE && SPI_processed == 1) { succ = true; } SPI_finish(); Then I use SPI_execute("select

Re: [GENERAL] Incrementally Updated Backups

2010-09-12 Thread Martijn van Oosterhout
On Sun, Sep 12, 2010 at 12:18:10PM +0200, J. Roeleveld wrote: > How can you ensure the snapshot is in a consistent state if the server is > running? > > If a snapshot is taken between 2 updates in a single transaction, only half > of > this transaction is included in the snapshot. > I would nev

Re: [GENERAL] Incrementally Updated Backups

2010-09-12 Thread J. Roeleveld
On Sunday 12 September 2010 00:43:19 Bruce Momjian wrote: > Gabe Nell wrote: > > > That section has been removed from the current 9.0 docs because we are > > > unsure it works. > > > > Hmm. So the only way to make a consistent backup from a standby server > > is to shut down the standby first? Or

[GENERAL] Monitoring Object access

2010-09-12 Thread adi hirschtein
Hi, Using the catalog tables, is there any way to correlate session id/user id to which object (i.e. tables, indexes etc) it access and much how disk reads or I/O wait has been done against the objects. in general, I'd like to see which objects are being accessed by which user and the time/amount o

[GENERAL] hi, how to let the inserted tuple visible to other backend when current backend hasn't finish?

2010-09-12 Thread sunpeng
hi, These codes are in the postgresql engine, just assume they are in PortalRun() function: //1.create table structure char *relname = "test"; ... relOid = heap_create_with_catalog(relname, ); CommandCounterIncrement(); ... //2.then i can use SPI_execute to create index on this created table SP