Re: [GENERAL] dynamic table names

2013-07-17 Thread Alban Hertroys
On Jul 17, 2013, at 22:39, John Smith wrote: > so my query goes like so: > > > execute 'select * from ' || tabname::regclass || ' where firstname = > > "john"' into e; Are those quotes around 'john' double-quotes (for identifiers) or double single-quotes (for literals)? They look like double

[GENERAL] Reply: Reply: [GENERAL] ?????? [GENERAL] Can't create plpython language

2013-07-17 Thread guxiaobo1982
Problem with ActivePython-2.7.2.5 is [postgres@lix stado]$ psql psql (9.3beta2) Type "help" for help. postgres=# create language plpython2u; ERROR: could not load library "/opt/PostgreSQL/93b2src/lib/postgresql/plpython2.so": /opt/PostgreSQL/93b2src/lib/postgresql/plpython2.so: undefined sy

Re: [GENERAL] pgAdmin for ubuntu

2013-07-17 Thread Luca Ferrari
On Wed, Jul 17, 2013 at 4:02 PM, Muhammad Bashir Al-Noimi wrote: > Failed to fetch > bzip2:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_quantal-updates_main_binary-amd64_Packages > Hash Sum mismatch I guess this is the problem. It happened to me sometimes when working behind a pro

Re: [GENERAL] Update big table

2013-07-17 Thread Haiming Zhang
Thanks. I have fixed the problem. And now the query can run in 4 mins for 1.5 million records in TABLE1 and 0.5 million records in TABLE2. The solution is I created a function that gets all event_id from TABLE2 then travel through each event_id and do the update for TABLE1. This removes the si

Re: [GENERAL] dynamic table names

2013-07-17 Thread David Johnston
John Smith-54 wrote > any help? Sorry. Its hard enough teaching people via e-mail let alone teaching them on an unsupported version of PostgreSQL that has reduced functionality with respect to function writing compared to the more recent versions. You are going to need to some kind of "FOR" loo

Re: [GENERAL] dynamic table names

2013-07-17 Thread John Smith
david, you're right. i didn't realize it had to be executed inside a function so now i'm trying this: -- create function create or replace function get_tables(sname varchar) returns record as $$ select tablename from pg_tables where schemaname = $1; $$ language 'plpgsql'; -- query tables wher

Re: [GENERAL] About postgres scale out

2013-07-17 Thread David Kerr
On Wed, Jul 17, 2013 at 03:10:37PM +0800, Xiang Jun Wu wrote: - Hello, - - I'd like to ask a common question about scale out for postgres. - - Our current data volume is about 500GB ~ 1TB in one pg cluster(postgres 9.2). We've set up master/slave replication to keep sync. - To reach better perf

[GENERAL] About postgres scale out

2013-07-17 Thread Xiang Jun Wu
Hello, I'd like to ask a common question about scale out for postgres. Our current data volume is about 500GB ~ 1TB in one pg cluster(postgres 9.2). We've set up master/slave replication to keep sync. To reach better performance from apps side, we want to use pgbounder like app to split read/

Re: [GENERAL] dynamic table names

2013-07-17 Thread Thomas Kellerer
John Smith wrote on 17.07.2013 22:39: guys, have to use legacy 8.1. i have 100,000 tables in a schema that need to be queried (optimizing this by combining them into one will have to wait). so my query goes like so: > execute 'select * from ' || tabname::regclass || ' where firstname = "joh

Re: [GENERAL] dynamic table names

2013-07-17 Thread David Johnston
John Smith-54 wrote > guys, > > have to use legacy 8.1. > > i have 100,000 tables in a schema that need to be queried (optimizing this > by combining them into one will have to wait). > > so my query goes like so: > >> execute 'select * from ' || tabname::regclass || ' where firstname = > "john

Re: [GENERAL] dynamic table names

2013-07-17 Thread Rob Sargent
On 07/17/2013 02:39 PM, John Smith wrote: guys, have to use legacy 8.1. i have 100,000 tables in a schema that need to be queried (optimizing this by combining them into one will have to wait). so my query goes like so: > execute 'select * from ' || tabname::regclass || ' where firstname =

Re: [GENERAL] dynamic table names

2013-07-17 Thread Rob Sargent
On 07/17/2013 02:39 PM, John Smith wrote: guys, have to use legacy 8.1. i have 100,000 tables in a schema that need to be queried (optimizing this by combining them into one will have to wait). so my query goes like so: > execute 'select * from ' || tabname::regclass || ' where firstname =

[GENERAL] dynamic table names

2013-07-17 Thread John Smith
guys, have to use legacy 8.1. i have 100,000 tables in a schema that need to be queried (optimizing this by combining them into one will have to wait). so my query goes like so: > execute 'select * from ' || tabname::regclass || ' where firstname = "john"' into e; but i am getting an error: >

[GENERAL] What are my options to avoid a Row Exclusive/RowShareLock conflict / is there a better way?

2013-07-17 Thread rox
I have a long running stored procedure that pulls data from 2-3 tables, updates columns in a row in the IMPORT_STATUS table, creates a couple of temp tables, and then deletes/inserts/updates back into 3-4 tables... but never once does anything directly with the USER table. The long running sto

Re: [GENERAL] Query plan different depending on the value of where filter

2013-07-17 Thread Tom Lane
"Looby, Denis" writes: > What I don't understand is why the plan is different just because the > group_id = has changed value? > Does the planner have some statistical info on the contents of non-indexed > rows? Of course. In this case it knows that a nestloop would be a loser because many row

[GENERAL] Query plan different depending on the value of where filter

2013-07-17 Thread Looby, Denis
Hi All, I have an interesting query scenario I'm trying to understand. I came across this while investigating a slow query in our application. I've been able to reproduce the scenario in a psql script that sets up the tables and runs the queries. Script here http://pastebin.com/CBkdDmWp if anyone

Re: [GENERAL] pgAdmin for ubuntu

2013-07-17 Thread Muhammad Bashir Al-Noimi
On Wed, Jul 17, 2013 at 4:10 PM, Vincenzo Romano wrote: > Did you run "apt-get update" once you did che change? sure yes. -- Best Regards Muhammad Bashir Al-Noimi -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql

Re: [GENERAL] pgAdmin for ubuntu

2013-07-17 Thread Vincenzo Romano
2013/7/17 Muhammad Bashir Al-Noimi : > On Wed, Jul 17, 2013 at 3:34 PM, Vincenzo Romano > wrote: >> Once you "sudo add-apt-repository ppa:pitti/postgresql" then you go in >> /etc/apt/sources.list.d/pitti* and you replace the word with your >> Ubuntu version with "precise". By doing so you'll insta

Re: [GENERAL] Build RPM from Postgres Source

2013-07-17 Thread Michael Paquier
On Wed, Jul 17, 2013 at 9:28 PM, Devrim GÜNDÜZ wrote: > > Hi, > > On Fri, 2013-07-12 at 14:37 -0700, ktewari1 wrote: >> Hi, >> I need to have some different settings(like NAMEDATALEN etc.) and >> that's why I'm trying to build postgres from the source and to create an rpm >> to be send for in

Re: [GENERAL] pgAdmin for ubuntu

2013-07-17 Thread Muhammad Bashir Al-Noimi
On Wed, Jul 17, 2013 at 3:34 PM, Vincenzo Romano wrote: > Once you "sudo add-apt-repository ppa:pitti/postgresql" then you go in > /etc/apt/sources.list.d/pitti* and you replace the word with your > Ubuntu version with "precise". By doing so you'll install that version > into your distribution. T

Re: [GENERAL] pgAdmin for ubuntu

2013-07-17 Thread Vincenzo Romano
2013/7/17 Muhammad Bashir Al-Noimi : > Howdy, > > After upgrading my Pg from 9.1 to 9.2 the avaliable pgAdmin in ubuntu > 21.10 reporotiy can't deal with Pg 9.2. > > How can I get recent pgAdmin version for ubuntu 12.10? > > P.S. > - I tried ppa:pitti/postgresql but it doesn’t contain on suitable >

[GENERAL] pgAdmin for ubuntu

2013-07-17 Thread Muhammad Bashir Al-Noimi
Howdy, After upgrading my Pg from 9.1 to 9.2 the avaliable pgAdmin in ubuntu 21.10 reporotiy can't deal with Pg 9.2. How can I get recent pgAdmin version for ubuntu 12.10? P.S. - I tried ppa:pitti/postgresql but it doesn’t contain on suitable pgAdmin version for Pg 9.2 - I don’t prefer to build

Re: [GENERAL] Upgrading from Pg 9.1 to 9.2

2013-07-17 Thread Muhammad Bashir Al-Noimi
On Tue, Jul 16, 2013 at 11:52 PM, salah jubeh wrote: > Also have a look here > > http://wiki.postgresql.org/wiki/Using_pg_upgrade_on_Ubuntu/Debian Thanks a lot, I could successfully upgrade my server -- Best Regards Muhammad Bashir Al-Noimi -- Sent via pgsql-general mailing list (pgsql-gener

Re: [GENERAL] Build RPM from Postgres Source

2013-07-17 Thread Devrim GÜNDÜZ
Hi, On Fri, 2013-07-12 at 14:37 -0700, ktewari1 wrote: > Hi, > I need to have some different settings(like NAMEDATALEN etc.) and > that's why I'm trying to build postgres from the source and to create an rpm > to be send for install. > > Now, the build works fine but, I don't see a way to

Re: [GENERAL] transactional swap of tables

2013-07-17 Thread Vincenzo Romano
I have done the following test pn v9.2.4 with two concurrent sessions: -- session no.1 tmp1=# create table t1 ( t text ); CREATE TABLE Tempo: 37,351 ms tmp1=# create table t2 ( t text ); CREATE TABLE Tempo: 33,363 ms tmp1=# create or replace function f1( out tx text ) tmp1-# language plpgsql tmp1-

Re: [GENERAL] V8.4 TOAST table problem

2013-07-17 Thread David Welton
Hi, I'm talking about our own massively bloated toast table - described in an earlier post - that I think I can replicate. I didn't mean to steal your thread, but the problem seems very similar, and we're using 9.1. I don't know a lot about Postgres internals, but to me it smells like a bug of s

Re: [GENERAL] Question re contribs of Julian Assange

2013-07-17 Thread Luca Ferrari
On Wed, Jul 17, 2013 at 10:15 AM, ERR ORR wrote: > I noticed on the postgresql website that a certain Julian Assange is > mentioned among the contributors to Postgresql. > > Out of curiosity, could anybody post in short what exactly he contributed to > the DB? http://lmgtfy.com/?q=julian+assange

Re: [GENERAL] Question re contribs of Julian Assange

2013-07-17 Thread Magnus Hagander
On Wed, Jul 17, 2013 at 9:15 AM, ERR ORR wrote: > I noticed on the postgresql website that a certain Julian Assange is > mentioned among the contributors to Postgresql. > > Out of curiosity, could anybody post in short what exactly he contributed to > the DB? You can find a list of his contributi

[GENERAL] Question re contribs of Julian Assange

2013-07-17 Thread ERR ORR
I noticed on the postgresql website that a certain *Julian Assange* is mentioned among the contributors to Postgresql. Out of curiosity, could anybody post in short what exactly he contributed to the DB? Thanks, RD

Re: [GENERAL]

2013-07-17 Thread ERR ORR
- Is your postgres server actually up and running? - Did you add localhost to the addresses served by postgres in pg_hba.conf (with proper permissions)? - Have you considered upgrading your postgres installation to a current version? 8.0.0-rc1 is WAY obsolete. On 23 March 2013 15:13, News Subsyst

Re: [GENERAL] Driver Question

2013-07-17 Thread Luca Ferrari
On Tue, Jul 16, 2013 at 5:36 PM, Corbett, James wrote: > Hello all: > > My first official message so please be gentle with me. > > I’m attempting to make a new JDBC Connection Profile via my Eclipse IDE. > Apparently it’s looking for the following jar in the driver wizard: > > postgresql-8.1-404.j