Re: [ADMIN] How to track down locks held by recovery process on a slave?

2013-10-05 Thread reiner peterke
First thought is make sure you are looking in the right database. pg_locks shows data over the entire server, not just the connected database. pg_class exists for each database so if you are connected to 'my_database' but the object is in 'your_database', it won't show up in pg_class on 'my_data

Re: [ADMIN] How to implement the 'GRANT ALL ON DB1 TO 'USER'@'%' of MYSQL in PostgreSQL

2013-01-14 Thread Casey Allen Shobe
I'd recommend setting up group roles (roles which cannot login) to grant your various permission sets to, and then add users to the appropriate groups, using permission inheritence. Then any grants/revokes you make in the future to the groups automatically apply to the users. You may wish to divi

Re: [ADMIN] How to display full query in logs

2013-01-08 Thread Tom Lane
"Campbell, Lance" writes: > What I see: > UPDATE abc.table set def=$1 WHERE id=$2 > What I want to see: > UPDATE abc.table set def='hi bob' WHERE id=12 It doesn't work that way. What you should be seeing, though, is that the value of each parameter is included in a DETAIL line just after the st

Re: [ADMIN] How to check history of sequences and constraints (version 9.1)

2012-11-21 Thread Tom Lane
Shams Khan writes: > I want to check the last reset valued of sequence and the date of foreign > key constraint when it was created. Is that possible in postgres 9.1 > version?? No, the system doesn't track any such thing. You could possibly set log_statement to record all commands of interest i

Re: [ADMIN] how to allow integer overflow for calculating hash code of a string?

2012-10-30 Thread Haifeng Liu
I got a way which works fine: use bigint first, and then convert it to bit(32), and convert it to int4 at last. declare i integer := 0; declare h bigint := 0; begin for i in 1..length(str) loop h = (h * 31 + ascii(substring(str, i, 1))) & 4294967295; end loop; return cast(cast(h as bit(

Re: [ADMIN] how to allow integer overflow for calculating hash code of a string?

2012-10-30 Thread Haifeng Liu
I got a way which works fine: use bigint first, and then convert it to bit(32), and convert it to int4 at last. declare i integer := 0; declare h bigint := 0; begin for i in 1..length(str) loop h = (h * 31 + ascii(substring(str, i, 1))) & 4294967295; end loop; return cast(cast(h as bit(

Re: [ADMIN] how to allow integer overflow for calculating hash code of a string?

2012-09-21 Thread Craig James
On Thu, Sep 20, 2012 at 7:56 PM, Haifeng Liu wrote: > > On Sep 20, 2012, at 10:34 PM, Craig James wrote: > > > > On Thu, Sep 20, 2012 at 1:55 AM, Haifeng Liu wrote: > >> I want to write a hash function which acts as String.hashCode() in java: >> hash = hash * 31 + s.charAt(i)... but I got integ

Re: [ADMIN] how to allow integer overflow for calculating hash code of a string?

2012-09-20 Thread Haifeng Liu
On Sep 20, 2012, at 10:34 PM, Craig James wrote: > > > On Thu, Sep 20, 2012 at 1:55 AM, Haifeng Liu wrote: > I want to write a hash function which acts as String.hashCode() in java: hash > = hash * 31 + s.charAt(i)... but I got integer out of range error. How can I > avoid this? I saw java

Re: [ADMIN] how to allow integer overflow for calculating hash code of a string?

2012-09-20 Thread Craig James
On Thu, Sep 20, 2012 at 1:55 AM, Haifeng Liu wrote: > I want to write a hash function which acts as String.hashCode() in java: > hash = hash * 31 + s.charAt(i)... but I got integer out of range error. How > can I avoid this? I saw java do not care overflow of int, it just make the > result negati

Re: [ADMIN] How to make the row changes inside trigger function visible to the top level sql statement?

2012-08-09 Thread Haifeng Liu
On Aug 9, 2012, at 7:11 PM, Sergey Konoplev wrote: > On Thu, Aug 9, 2012 at 2:53 PM, Sergey Konoplev > wrote: >>> How can I make the row changes inside the trigger function visible to the >>> top level statement? >> >> your redirecting function is okay. However the only way to get the >> ins

Re: [ADMIN] How to make the row changes inside trigger function visible to the top level sql statement?

2012-08-09 Thread Sergey Konoplev
On Thu, Aug 9, 2012 at 2:53 PM, Sergey Konoplev wrote: >> How can I make the row changes inside the trigger function visible to the >> top level statement? > > your redirecting function is okay. However the only way to get the > inserted row back is to do it from a subsequent statement in the > p

Re: [ADMIN] How to make the row changes inside trigger function visible to the top level sql statement?

2012-08-09 Thread Sergey Konoplev
On Mon, Aug 6, 2012 at 1:14 PM, haifeng liu wrote: > Hello, > > I am doing table partitioning, all is ok except that after executing 'insert' > sql statement I can't get affected rows, it always be 0. After searching on > the documents, I found that row changes inside trigger function is not >

Re: [ADMIN] How to make data changes inside trigger function visible to the top level statement ?

2012-08-06 Thread Craig Ringer
On 08/06/2012 06:50 PM, Haifeng Liu wrote: Hello, I am doing table partitioning, all is ok except that after executing 'insert' sql statement I can't get affected rows, it always be 0. After searching on the documents, I found that row changes inside trigger function is not visible to the top

Re: [ADMIN] How to setup PostgreSQL using Windows Authentication?

2012-06-17 Thread Christian Ullrich
* Craig Ringer wrote: On 06/16/2012 08:36 PM, Christian Ullrich wrote: The one-click installer (assuming you used that) left you with PostgreSQL running under a local account named "postgres". First, you have to change that, because SSPI requires that the service uses a domain account: That

Re: [ADMIN] How to setup PostgreSQL using Windows Authentication?

2012-06-17 Thread Craig Ringer
On 06/16/2012 08:36 PM, Christian Ullrich wrote: * Peter Cheung wrote: I’m new to PostgreSQL. I installed PostgreSQL on a Windows Server 2008 R2 server. I have created a database and an user in Windows Active Directory. How can I configure that user to access that database? The one-cli

Re: [ADMIN] How to setup PostgreSQL using Windows Authentication?

2012-06-16 Thread Christian Ullrich
* Peter Cheung wrote: I’m new to PostgreSQL. I installed PostgreSQL on a Windows Server 2008 R2 server. I have created a database and an user in Windows Active Directory. How can I configure that user to access that database? The one-click installer (assuming you used that) left you with

Re: [ADMIN] How to setup PostgreSQL using Windows Authentication?

2012-06-12 Thread Magnus Hagander
On Jun 13, 2012 4:21 AM, "Craig Ringer" wrote: > > On 06/13/2012 02:37 AM, Peter Cheung wrote: >> >> According to http://www.postgresql.org/docs/9.1/static/auth-methods.html, SSPI only works when GSSAPI is available and GSSAPI support has to be enabled when PostgreSQL is built. Does it mean that

Re: [ADMIN] How to setup PostgreSQL using Windows Authentication?

2012-06-12 Thread Craig Ringer
On 06/13/2012 02:37 AM, Peter Cheung wrote: According to http://www.postgresql.org/docs/9.1/static/auth-methods.html, SSPI only works when GSSAPI is available and GSSAPI support has to be enabled when PostgreSQL is built. Does it mean that I need to uninstall PostgreSQL and reinstall it wi

Re: [ADMIN] How to setup PostgreSQL using Windows Authentication?

2012-06-12 Thread Peter Cheung
installer downloaded from http://www.postgresql.org/download/windows to install PostgreSQL and I'm not sure how to include GSSAPI support. From: Craig Ringer [mailto:ring...@ringerc.id.au] Sent: Tuesday, June 12, 2012 1:11 AM To: Peter Cheung Cc: 'pgsql-admin@postgresql.org' Subject: Re:

Re: [ADMIN] How to setup PostgreSQL using Windows Authentication?

2012-06-12 Thread Craig Ringer
On 06/12/2012 10:00 AM, Peter Cheung wrote: Hi, I'm new to PostgreSQL. I installed PostgreSQL on a Windows Server 2008 R2 server. I have created a database and an user in Windows Active Directory. How can I configure that user to access that database? By default, Windows users and Pos

Re: [ADMIN] How To Change Password Hash Algorithm From MD5 to SHA-256

2012-06-08 Thread Josh Kupershmidt
On Thu, Jun 7, 2012 at 8:12 AM, ROMAIN, ERICKA W CTR DISA PEO-MA wrote: > I am trying to get Postgres to use SHA as the password hash algorithm instead > of MD5. This is a security requirement. I am running PostgreSQL 8.4 on a Red > Hat Linux platform. I have installed pgcrypto and ran pgcrypto.

Re: [ADMIN] How to auto swtich the roles of primary and standby

2012-04-19 Thread videanuadrian
hi, i tried the exact setup that you described here, but unfortunately i had to restart the new master(former slave)  in order to get the new settings and this will conduct to a downtime and service interruption. anyway thanks for sharing your experience. Adrian Videanu --- On Fri, 4/20/12, jen

Re: [ADMIN] How to auto swtich the roles of primary and standby

2012-04-19 Thread jenopob
hi we did a new shell script named recovery_config_chage.sh at standby server. the script I wanted to change the fail down postgres master config ,let it start as standby server and build the communication with the former standby now is master server,then started it by remotestart.sh the abo

Re: [ADMIN] How to auto swtich the roles of primary and standby

2012-04-19 Thread videanuadrian
so, just to make sure that i understand: after the master failed, the slave become the new master, the you have changed postgresql.conf from master to slave and viceversa and restarted the old master as slave ? --- On Thu, 4/19/12, jenopob [via PostgreSQL] wrote: From: jenopob [via PostgreSQ

Re: [ADMIN] How to auto swtich the roles of primary and standby

2012-04-16 Thread videanuadrian
Hi there, i have the exact same problem. Did you find a solution for this ? thanks, Adrian Videanu -- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-auto-swtich-the-roles-of-primary-and-standby-tp4546630p5645680.html Sent from the PostgreSQL - admin mailing list arc

Re: [ADMIN] How to back up selected rows using

2012-03-12 Thread Kevin Grittner
Piyush Lenka wrote: > How can i backup only 5 records from that table using pg_dump or psql or > both. In psql: \copy ( select * from that_table where ... ) to 'filename' http://www.postgresql.org/docs/9.1/interactive/app-psql.html Search the page for \copy -Kevin -- Sent via pgsql-a

Re: [ADMIN] How to deal with corrupted database?

2011-11-09 Thread Ruslan A. Bondar
> > So I've stopped software caused these inserts and deletes, but > > reindexing shows same warnings. I've restarted postgresql server. > > How did you restart PostgreSQL? > > If there were backends hung in the vfs, did the eventually terminate > by themselves? If not, did you terminate them you

Re: [ADMIN] How to deal with corrupted database?

2011-11-09 Thread Craig Ringer
On 09/11/11 21:37, Ruslan A. Bondar wrote: > This database isn't mission critical, so if you want - I can experiment on this. Brilliant! It's rare for people to be able to investigate issues like this, most of the time they just have to get up and running ASAP and often destroy data required to u

Re: [ADMIN] How to deal with corrupted database?

2011-11-09 Thread Kevin Grittner
"Ruslan A. Bondar" wrote: > No, this was a clean install of 9.0.x. Then it isn't related to the issue I raised. > Maybe It was upgraded from 9.0.3 to 9.0.4. I'm not sure. You don't normally use pg_upgrade for that; this was a pg_upgrade bug. -Kevin -- Sent via pgsql-admin mailing list

Re: [ADMIN] How to deal with corrupted database?

2011-11-09 Thread Ruslan A. Bondar
No, this was a clean install of 9.0.x. Maybe It was upgraded from 9.0.3 to 9.0.4. I'm not sure. On Wed, 09 Nov 2011 09:21:18 -0600 "Kevin Grittner" wrote: > "Ruslan A. Bondar" wrote: > > > ERROR: could not access status of transaction 15892843 > > DETAIL: Could not open file "pg_subtrans/0

Re: [ADMIN] How to deal with corrupted database?

2011-11-09 Thread Kevin Grittner
"Ruslan A. Bondar" wrote: > ERROR: could not access status of transaction 15892843 > DETAIL: Could not open file "pg_subtrans/00F2": No such file or directory. > postgres version: 9.0.4 Did you move to 9.0.x using pg_upgrade version 9.0.3 or earlier? http://wiki.postgresql.org/wiki/20110

Re: [ADMIN] How to deal with corrupted database?

2011-11-09 Thread Ruslan A. Bondar
There were no unexpected reboots. First issue was some kind of deadlock (concurrent insert and concurrent delete on a table) I saw them wile reindexing the database. Also mesages like this were in dmesg: [3681001.529179] INFO: task postgres:12432 blocked for more than 120 seconds. [3681001.52919

Re: [ADMIN] How to deal with corrupted database?

2011-11-09 Thread Craig Ringer
On 11/09/2011 07:02 PM, Ruslan A. Bondar wrote: Hello all. This is a first time I receive such an issue. My database was corrupted some way. Before you do ANYTHING else, make a copy of your database somewhere safe. See: http://wiki.postgresql.org/wiki/Corruption When I'm trying to access the

Re: [ADMIN] How to find and/or REINDEX only GiST indexes in the database?

2011-10-28 Thread Dimitri Fontaine
"Gnanakumar" writes: > My question is, how do I find out or REINDEX *only* GiST indexes in the > database? Is there a single syntax/command that does this? You might find this article useful: http://tapoueh.org/blog/2010/08/05-querying-the-catalog-to-plan-an-upgrade.html Regards, -- Dimitr

Re: [ADMIN] How to find and/or REINDEX only GiST indexes in the database?

2011-10-12 Thread Kevin Grittner
"Gnanakumar" wrote: > how do I find out or REINDEX *only* GiST indexes in the > database? Is there a single syntax/command that does this? I would probably capture the output from: SELECT indexdef || ';' FROM pg_indexes WHERE indexdef ~ ' USING gist '; -Kevin -- Sent via pgsql-admin

Re: [ADMIN] How to find and/or REINDEX only GiST indexes in the database?

2011-10-12 Thread Tom Lane
"Gnanakumar" writes: > My question is, how do I find out or REINDEX *only* GiST indexes in the > database? Is there a single syntax/command that does this? You could do something like select relname from pg_class where relam = (select oid from pg_am where amname = 'gist');

Re: [ADMIN] How to find and/or REINDEX only GiST indexes in the database?

2011-10-12 Thread Achilleas Mantzios
Στις Wednesday 12 October 2011 15:46:45 ο/η Gnanakumar έγραψε: > Hi, > > We're planning to upgrade our Production server from PostgreSQL v8.2.3 to > the latest version in 8.2 series, that is v8.2.22. > > In 8.2.11 Release Notes here > http://www.postgresql.org/docs/current/interactive/release-8

Re: [ADMIN] How to change query planner configuration paramerters

2011-09-18 Thread Melaka Gunasekara
Thanks for the information Tom. It solved my confusion. On Sun, Sep 18, 2011 at 10:03 PM, Tom Lane wrote: > Craig Ringer writes: > > On 18/09/2011 5:51 PM, Melaka Gunasekara wrote: > >> Merge Full Join (cost=174.40..193.69 rows=1159 > width=286) > > >> Can you suggest why the me

Re: [ADMIN] How to change query planner configuration paramerters

2011-09-18 Thread Tom Lane
Craig Ringer writes: > On 18/09/2011 5:51 PM, Melaka Gunasekara wrote: >> Merge Full Join (cost=174.40..193.69 rows=1159 width=286) >> Can you suggest why the merge join is being suggested when I have >> turned it off ? > AFAIK SETting a join type to "off" really just increases

Re: [ADMIN] How to change query planner configuration paramerters

2011-09-18 Thread Craig Ringer
On 18/09/2011 5:51 PM, Melaka Gunasekara wrote: Merge Full Join (cost=174.40..193.69 rows=1159 width=286) Can you suggest why the merge join is being suggested when I have turned it off ? AFAIK SETting a join type to "off" really just increases the cost estimate so high th

Re: [ADMIN] How to change query planner configuration paramerters

2011-09-18 Thread Melaka Gunasekara
Hi Raghavendra, Thanks for your quick reply, I did as you suggessted and following is my output. melaka=# set enable_mergejoin to off; SET melaka=# show enable_mergejoin; enable_mergejoin -- off (1 row) Then I executed the following query melaka=# EXPLAIN select * from distribu

Re: [ADMIN] How to change query planner configuration paramerters

2011-09-18 Thread Raghavendra
postgres=# set enable_hashjoin to off; SET postgres=# show enable_hashjoin; enable_hashjoin - off (1 row) Above, changes applies for the current session (its Session-Level). If you want to do at Database-level use ALTER DATABASE and for entire Cluster-level edit postgresql.conf a

Re: [ADMIN] how to tell if a replication server has stopped replicating

2011-08-26 Thread mark
> -Original Message- > From: pgsql-admin-ow...@postgresql.org [mailto:pgsql-admin- > ow...@postgresql.org] On Behalf Of Bill MacArthur > Sent: Friday, August 26, 2011 10:21 AM > To: pgsql-admin@postgresql.org > Subject: [ADMIN] how to tell if a replication server has stopped > replicating

Re: [ADMIN] How to remove index from memory ?

2011-08-12 Thread Kevin Grittner
A J wrote: > I am running a test to find the impact of corrupt indexes on > queries. I corrupted the index file but observed that the queries > continued to perform without issues. It was only on restart of the > database that postgres realized that the indexes are corrupt and > my queries start

Re: [ADMIN] how to make PostgreSQL using "all" memory and chaching the DB completely there

2011-07-21 Thread Kevin Grittner
Christoph Anton Mitterer wrote: > Well I'm still very unsure on how to configure many values... > We've increased e.g. shared_buffers, temp_buffers, work_mem, > maintenance_work_mem, max_stack_depth... and this greatly improved > performance. But I can hardly judge to which values I should > in

Re: [ADMIN] How to find out hit count or read activities on functions in postgresql 8.4.6

2011-07-15 Thread Sergey Konoplev
Hi, On 14 July 2011 14:17, Jenish Vyas wrote: > Hi All, > Can you guide me how to find out the read activities for stored functions in > database? > (How many times function called in specific time frame) I hope this will help you http://www.postgresql.org/docs/current/interactive/pgstatstatemen

Re: [ADMIN] how to make PostgreSQL using "all" memory and chaching the DB completely there

2011-07-14 Thread Kevin Grittner
>Christoph Anton Mitterer wrote: > What we have here at the institute is a quite powerful server, > whit about 100GB RAM that has a PostgreSQL running on it (with > several DBs). In one cluster (postmaster instance) or separate? > Currently it's 8.4 but we shall switch to 9.x eventually. Th

Re: [ADMIN] how to make PostgreSQL using "all" memory and chaching the DB completely there

2011-07-14 Thread Scott Marlowe
2011/7/14 Christoph Anton Mitterer : > Hi. > > I've read through the documentation and while I've seen dozens of > options which allow to set which kind of buffer/cache/shared-mem gets > how big... I do not quite understand how to reach the following. > > What we have here at the institute is a qui

Re: [ADMIN] How to auto switch the roles of master and standby

2011-07-14 Thread jenopob
hi you could use pgpool-II failover_command to trigger the script what you want to something you can take at http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html and pgpool-II works in Master/Slave Mode will meet your requirements best regards jenopob -- View this message in c

Re: [ADMIN] How to start a database in ReadOnly mode?

2011-07-09 Thread Guillaume Lelarge
On Sat, 2011-07-09 at 11:58 +, Greg Sabino Mullane wrote: > > Is it possible to start a postgres cluster or 1 postgres database in > > readonly mode? And - if yes - how can this be done? > > Clusterwide: edit postgresql.conf and set > default_transaction_read_only = on; > > No restart needed,

Re: [ADMIN] How to start a database in ReadOnly mode?

2011-07-09 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > Is it possible to start a postgres cluster or 1 postgres database in > readonly mode? And - if yes - how can this be done? Clusterwide: edit postgresql.conf and set default_transaction_read_only = on; No restart needed, just a reload (HUP)

Re: [ADMIN] How to start a database in ReadOnly mode?

2011-07-07 Thread Achilleas Mantzios
Hello Στις Thursday 07 July 2011 10:26:19 ο/η Simon Riggs έγραψε: > On Thu, Jul 7, 2011 at 8:08 AM, Paul Schluck wrote: > > > Is it possible to start a postgres cluster or 1 postgres database in > > readonly mode? And - if yes - how can this be done? > > There is no formal, explicit command to d

Re: [ADMIN] How to start a database in ReadOnly mode?

2011-07-07 Thread Simon Riggs
On Thu, Jul 7, 2011 at 8:08 AM, Paul Schluck wrote: > Is it possible to start a postgres cluster or 1 postgres database in > readonly mode? And - if yes - how can this be done? There is no formal, explicit command to do that. Just avoid doing writes, either in the application or by removing priv

Re: [ADMIN] How to change all owners on all objects in a schema

2011-06-23 Thread Greg Spiegelberg
On Thu, Jun 23, 2011 at 2:41 PM, Kevin Grittner wrote: > "Kevin Grittner" wrote: > > > || ' set schema newschema;' > > Oops; you wanted to change the owner, but I'll leave that as an > exercise for the reader. :-) > > Beat me to it :) Replace , and psql -qAt -d -c "SELECT 'AL

Re: [ADMIN] How to change all owners on all objects in a schema

2011-06-23 Thread Kevin Grittner
"Kevin Grittner" wrote: > || ' set schema newschema;' Oops; you wanted to change the owner, but I'll leave that as an exercise for the reader. :-) -Kevin -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgre

Re: [ADMIN] How to change all owners on all objects in a schema

2011-06-23 Thread Kevin Grittner
"Campbell, Lance" wrote: > PostgreSQL: 9.0.x > > How do I change the ownership of all objects within a schema from > X to Y? The objects within each schema would be tables and > sequences. I would use DO statements. What could be done as a one-liner to handle the tables is shown below with

Re: [ADMIN] How to pg_upgrade an 8.4.3 Installation

2011-06-20 Thread Greg Smith
On 06/20/2011 09:23 AM, Nils Gösche wrote: Can I simply use the 9.0.4 pg_upgrade on this since the bug has been fixed in 9.0.4, or would I first have to upgrade the 8.4 installation to 8.4.8? Unless this 8.4 install was itself upgraded from 8.3 using pg_upgrade, you can go right from 8.4.3

Re: [ADMIN] How to remove conflicts when installing postgres where some other installation of postgres is already running using silent installer

2011-05-25 Thread Marcelo Leite
Hello there... If you perform a fresh installation from source code, you can have a better control of that issue. Cheers, Marcelo Leite

Re: [ADMIN] How to uninstall PostgreSQL 8.4 on both Windows XP and Windows 7

2011-04-21 Thread Kevin Grittner
Mlondolozi Ncapayi wrote: > I installed PostgreSql 8.4 and now I want to delete/ uninstall it > completely to start a new fresh installation. > Can you please give me clear instructions on how to do that or > maybe a script that I can run. That's going to depend entirely on how you installed

Re: [ADMIN] How to log canceled SQL statement due to statement timeout

2011-04-14 Thread Eric Comeau
On 11-04-13 12:37 PM, Kevin Grittner wrote: Eric Comeau wrote: We currently have statement timeout set statement_timeout = 1080 # 3 hrs and we receive the following in the postgresql.log [1-1] ERROR: canceling statement due to statement timeout Is there a way to have the

Re: [ADMIN] How to log canceled SQL statement due to statement timeout

2011-04-13 Thread Kevin Grittner
Eric Comeau wrote: > We currently have statement timeout set > > statement_timeout = 1080 # 3 hrs > > and we receive the following in the postgresql.log > >[1-1] ERROR: canceling statement due to statement timeout > > Is there a way to have the SQL statement logged as well?

Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-09 Thread Christian Ullrich
* Gnanakumar wrote: We're using PostgreSQL v8.2.3. How do I get the schema name in which TEMPORARY table is created using "CREATE TEMP TABLE mytable " syntax? SELECT nspname FROM pg_namespace WHERE oid = pg_my_temp_schema(); I don't have an 8.2.3 lying around, but git says that function

Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-08 Thread Gnanakumar
>> How do I get the schema name in which TEMPORARY table is created using >> "CREATE TEMP TABLE mytable " syntax? > Do you need the real schema name, or will the "pg_temp" alias be > sufficient? I need the real schema name (for example, pg_temp_xxx) in which it is created and not just the ali

Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-08 Thread Tom Lane
"Gnanakumar" writes: > We're using PostgreSQL v8.2.3. > How do I get the schema name in which TEMPORARY table is created using > "CREATE TEMP TABLE mytable " syntax? Do you need the real schema name, or will the "pg_temp" alias be sufficient? regression=# create temp table foo(f1 int); CREA

Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-08 Thread Gnanakumar
> select n.nspname from pg_class c join pg_namespace n on n.oid=c.relnamespace > where c.relname ='foo' and n.nspname like 'pg_temp%'; This will return all the schema name that are available which were created using TEMP TABLE syntax. Since our application is web-based, of course, there will be

Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-08 Thread Jens Wilke
On Tuesday 08 March 2011 15:02:57 Gnanakumar wrote: Hi, > How do I get the schema name in which TEMPORARY table is created using > "CREATE TEMP TABLE mytable " syntax? select n.nspname from pg_class c join pg_namespace n on n.oid=c.relnamespace where c.relname ='foo' and n.nspname like 'pg_

Re: [ADMIN] How to upgrade PostgreSQL minor releases without a dump/restore?

2011-03-04 Thread John Rouillard
On Fri, Mar 04, 2011 at 08:37:46AM -0600, Kenneth Marshall wrote: > On Thu, Mar 03, 2011 at 07:43:46PM -0800, Uwe Schroeder wrote: > > > > Did you read the paragraph above? > > > > Install latest version, and restart postmaster. > > > Installing of latest version as-is will keep overwriting the exi

Re: [ADMIN] How to upgrade PostgreSQL minor releases without a dump/restore?

2011-03-04 Thread Kenneth Marshall
On Thu, Mar 03, 2011 at 07:43:46PM -0800, Uwe Schroeder wrote: > > > > ? Did you read the paragraph above? > > > > > > Install latest version, and restart postmaster. > > > > Installing of latest version as-is will keep overwriting the existing > > installed directories/files/binaries but not th

Re: [ADMIN] How to upgrade PostgreSQL minor releases without a dump/restore?

2011-03-03 Thread Uwe Schroeder
> > ? Did you read the paragraph above? > > > > Install latest version, and restart postmaster. > > Installing of latest version as-is will keep overwriting the existing > installed directories/files/binaries but not the "/usr/local/pgsql/data/" > directory right? Since this is our production s

Re: [ADMIN] How to upgrade PostgreSQL minor releases without a dump/restore?

2011-03-01 Thread Gnanakumar
> ? Did you read the paragraph above? > Install latest version, and restart postmaster. Installing of latest version as-is will keep overwriting the existing installed directories/files/binaries but not the "/usr/local/pgsql/data/" directory right? Since this is our production server database,

Re: [ADMIN] How to upgrade PostgreSQL minor releases without a dump/restore?

2011-03-01 Thread Vibhor Kumar
On Mar 1, 2011, at 1:23 PM, Gnanakumar wrote: > > PostgreSQL Versioning policy says: "Upgrading to a minor release does not > require a dump and restore; merely stop the database server, install the > updated binaries, and restart the server." Install the Binaries of Specific Minor Release and

Re: [ADMIN] How to upgrade PostgreSQL minor releases without a dump/restore?

2011-03-01 Thread Devrim GÜNDÜZ
On Tue, 2011-03-01 at 13:23 +0530, Gnanakumar wrote: > > PostgreSQL Versioning policy says: "Upgrading to a minor release does > not require a dump and restore; merely stop the database server, > install the updated binaries, and restart the server." > > Now, without a dump/restore, what are the

Re: [ADMIN] How to

2011-02-07 Thread Kevin Grittner
Nicolas Thauvin wrote: > On 06/02/2011 17:30, Kevin Grittner wrote: >> Guy Deleeuw wrote: >> >> My hardware : lapto hp envy I7 processor with a ssd disk >> >>> Memory : >>> totalused free shared buffers cached >>>8129356 2866516 5262840 0 387172 9

Re: [ADMIN] How to

2011-02-07 Thread Nicolas Thauvin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/02/2011 17:30, Kevin Grittner wrote: > Guy Deleeuw wrote: > > My hardware : lapto hp envy I7 processor with a ssd disk > >> Memory : >> totalused free shared buffers cached >> Mem: 8129356 2866516

Re: [ADMIN] How to

2011-02-07 Thread Guy Deleeuw
Hello Kevin, > > You should probably look at reqorking the v_stock view to use joins > instead of subqueries -- they often optimize much better. This is the problem effectively. For creating this view I use a query tools that generate the code, not a good idea. I update and work now :-) Best rega

Re: [ADMIN] How to

2011-02-06 Thread Kevin Grittner
Guy Deleeuw wrote: My hardware : lapto hp envy I7 processor with a ssd disk > Memory : > totalused free shared buffers cached > Mem: 8129356 2866516 5262840 0 387172 948132 > -/+ buffers/cache: 1531212 6598144 > Swap: 156252

Re: [ADMIN] How to

2011-02-06 Thread Kevin Grittner
Guy Deleeuw wrote: > Why with the clause WHERE the time are 10x greater than ? How can I > work around this ? Nobody can answer that without a bit more detail. Could you show an EXPLAIN ANALYZE of both queries and the definition of v_stock_status? I that is a view, then we would need definiti

Re: [ADMIN] How to find the primary server of a hot standby server?

2010-10-14 Thread Guillaume Lelarge
Le 15/10/2010 00:53, Shoaib Mir a écrit : > On Fri, Oct 15, 2010 at 9:39 AM, Guillaume Lelarge > wrote: > >> Le 14/10/2010 23:18, Rudolf van der Leeden a écrit : >>> [...] >>> quick question to the PG 9 community. >>> >>> I can query a hot standby server if recovery is still active using >>> the a

Re: [ADMIN] How to find the primary server of a hot standby server?

2010-10-14 Thread Shoaib Mir
On Fri, Oct 15, 2010 at 9:39 AM, Guillaume Lelarge wrote: > Le 14/10/2010 23:18, Rudolf van der Leeden a écrit : > > [...] > > quick question to the PG 9 community. > > > > I can query a hot standby server if recovery is still active using > > the administration function pg_is_in_recovery(). Is th

Re: [ADMIN] How to find the primary server of a hot standby server?

2010-10-14 Thread Guillaume Lelarge
Le 14/10/2010 23:18, Rudolf van der Leeden a écrit : > [...] > quick question to the PG 9 community. > > I can query a hot standby server if recovery is still active using > the administration function pg_is_in_recovery(). Is there also a way > to query for the 'primary server', i.e. which server

Re: [ADMIN] how to PG close session

2010-10-01 Thread Greg Smith
Little, Douglas wrote: The only admin function that look close is pg_terminate_backend(pid int) boolean Terminate a backend I tried it and it couldn't be found. It is newist. We're running PG8.2.13/GP3.3.7 Yes, that's an 8.4 function. We tried pgpool for awhile, but I think I'll hav

Re: [ADMIN] how to PG close session

2010-10-01 Thread Little, Douglas
Thanks The only admin function that look close is pg_terminate_backend(pid int) boolean Terminate a backend I tried it and it couldn't be found. It is newist. We're running PG8.2.13/GP3.3.7 >Oh, these connections aren't waiting for *database* events? Then >you should either restructure

Re: [ADMIN] how to PG close session

2010-10-01 Thread Kevin Grittner
"Little, Douglas" wrote: > Kevin Grittner [mailto:kevin.gritt...@wicourts.gov] wrote: >> "Little, Douglas" wrote: >> >>> We have a number of long running java/jdbc applications that >>> wait for events and then extract data from PG. >>> During the time the apps are running, The app is maintai

Re: [ADMIN] how to PG close session

2010-10-01 Thread Little, Douglas
Sent: Friday, October 01, 2010 9:01 AM To: Little, Douglas; pgsql-admin@postgresql.org Subject: Re: [ADMIN] how to PG close session "Little, Douglas" wrote: > We have a number of long running java/jdbc applications that wait > for events and then extract data from PG. > During

Re: [ADMIN] how to PG close session

2010-10-01 Thread Kevin Grittner
"Little, Douglas" wrote: > We have a number of long running java/jdbc applications that wait > for events and then extract data from PG. > During the time the apps are running, The app is maintaining > active connections to PG. > Is there a way that we can close/terminate the pg session so tha

Re: [ADMIN] How To: LARGE html text or csv file COPY FROM?

2010-09-15 Thread Greg Smith
Lou Picciano wrote:p { margin: 0; } Both errors above make sense to me; COPY is running into either a cr or a tab character in each case. Even though they might seem very similar at first, text mode and CSV mode work very differently here. To quote TFM at http://www.postgresql.org/docs/curre

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-08-10 Thread Kevin Grittner
Craig James wrote: > If you have a slow network, then run pg_dump on the machine where > the database lives and use compression (--format=c) and restore > using pg_restore. It will cut WAY down on the amount of data that > has to move across the net. If you don't mind dancing around a bit you

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-08-10 Thread Craig James
On 8/9/10 5:14 PM, Bruce Momjian wrote: ENGEMANN, DAYSE wrote: Hi Kevin, Sorry to disturb you.. But I am really new in it... Let me see if I understood... pg_dump -h sourcemachine -U sourceuser source_dbname | psql target_dbname Has anyone done any measurement of whether it is faster to do

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-08-10 Thread Kevin Grittner
Bruce Momjian wrote: > ENGEMANN, DAYSE wrote: >> pg_dump -h sourcemachine -U sourceuser source_dbname \ >> | psql target_dbname > > Has anyone done any measurement of whether it is faster to do the > dump on the local machine with psql remote or from a remote > machine (where psql would be l

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-08-09 Thread Bruce Momjian
ENGEMANN, DAYSE wrote: > Hi Kevin, > Sorry to disturb you.. But I am really new in it... > Let me see if I understood... > > pg_dump -h sourcemachine -U sourceuser source_dbname | psql target_dbname Has anyone done any measurement of whether it is faster to do the dump on the local machine with

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-19 Thread Scott Marlowe
On Mon, Jul 19, 2010 at 10:49 AM, ENGEMANN, DAYSE wrote: > How can I create it as the same that I have in the other server? What you likely want here is the same database name, with the same encoding and collation. And then the global stuff, like user accounts. psql -h olddbserver postgres \l

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-19 Thread Kevin Grittner
"ENGEMANN, DAYSE" wrote: > How can I create it as the same that I have in the other server? Well, you could use CREATE DATABASE, and maybe a few REVOKE and/or GRANT statements. Is there some particular concern you have about this? -Kevin -- Sent via pgsql-admin mailing list (pgsql-admin@

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-19 Thread ENGEMANN, DAYSE
How can I create it as the same that I have in the other server? -Original Message- From: Kevin Grittner [mailto:kevin.gritt...@wicourts.gov] Sent: segunda-feira, 19 de julho de 2010 13:43 To: ENGEMANN, DAYSE; pgsql-admin@postgresql.org Subject: RE: [ADMIN] How to move a database from

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-19 Thread Kevin Grittner
"ENGEMANN, DAYSE" wrote: > pg_dump -h sourcemachine -U sourceuser source_dbname | psql > target_dbname > > Is that? Yes. You need to enter passwords unless they are specified in .pgpass or you have some form of authorization which doesn't require typing a password (for example, trust or iden

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-19 Thread ENGEMANN, DAYSE
...@wicourts.gov] Sent: segunda-feira, 19 de julho de 2010 13:07 To: ENGEMANN, DAYSE; pgsql-admin@postgresql.org Subject: RE: [ADMIN] How to move a database from HP server to Linux Server that had already one database. "ENGEMANN, DAYSE" wrote: > If I use the : > Origim: pg_dum

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-19 Thread Kevin Grittner
"ENGEMANN, DAYSE" wrote: > If I use the : > Origim: pg_dump -Ft -b db_name > file.tar > Target: pg_restore -d new_db file.tar > > The target server has a db, using PGDATA=/postgres, the same in > the other server... There is any risk to lost any data? Restoring to a new database should not p

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-19 Thread ENGEMANN, DAYSE
org [mailto:pgsql-admin-ow...@postgresql.org] On Behalf Of ENGEMANN, DAYSE Sent: sexta-feira, 16 de julho de 2010 15:22 To: Kevin Grittner; pgsql-admin@postgresql.org Subject: Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database. I am not sure if I can do

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-16 Thread ENGEMANN, DAYSE
ira, 16 de julho de 2010 15:12 To: ENGEMANN, DAYSE; pgsql-admin@postgresql.org Subject: Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database. "ENGEMANN, DAYSE" wrote: > Kevin Grittner wrote: >> pg_dump | psql > And to restore it.

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-16 Thread Kevin Grittner
"ENGEMANN, DAYSE" wrote: > Kevin Grittner wrote: >> pg_dump | psql > And to restore it.. Can I use pg_restore -d new_db_name ?? I usually pipe the output of pg_dump to psql, and thereby avoid making a copy of the dump output entirely. If you want to dump in custom format, yeah, you would

Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

2010-07-16 Thread ENGEMANN, DAYSE
And to restore it.. Can I use pg_restore -d new_db_name ?? -Original Message- From: Kevin Grittner [mailto:kevin.gritt...@wicourts.gov] Sent: sexta-feira, 16 de julho de 2010 14:47 To: ENGEMANN, DAYSE; pgsql-admin@postgresql.org Subject: Re: [ADMIN] How to move a database from HP server

  1   2   3   4   5   6   7   8   >