Re: [GENERAL] how to avoid repeating expensive computation in select

2011-03-01 Thread Orhan Kavrakoglu
On 2011-02-03 18:07, Bob Price wrote: I would like to know if there is a way in PostgreSQL to avoid repeating an expensive computation in a SELECT where the result is needed both as a returned value and as an expression in the WHERE clause. I think I've seen it said here that PG avoids

[GENERAL] pg_catalog.pg_stat_activity and current_query

2011-03-01 Thread Alex
Good morning, I'm trying to make a Postgre profiler reading pg_catalog.pg_stat_activity. But when I read that view... I always find my query. Example: ResultSet rs = st.executeQuery(SELECT query_start,current_query FROM pg_catalog.pg_stat_activity where xact_start is not null); while(rs.next())

Re: [GENERAL] pg_catalog.pg_stat_activity and current_query

2011-03-01 Thread Szymon Guz
On 1 March 2011 09:36, Alex alexadr...@virgilio.it wrote: Good morning, I'm trying to make a Postgre profiler reading pg_catalog.pg_stat_activity. But when I read that view... I always find my query. Example: ResultSet rs = st.executeQuery(SELECT query_start,current_query FROM

[GENERAL] Tool for shifting tables from Mysql to Postgresql

2011-03-01 Thread Adarsh Sharma
Dear all, I want to convert some tables from Mysql database to Postgresql Database in Linux Systems ( Ubuntu-10.4, CentOS ). Can someone Please tell me tool for it that makes it easier. I am able to done it through FW tools in Windows System but i want to achieve it in Linux ( CentOS )

Re: [GENERAL] restore a server backup

2011-03-01 Thread Raymond O'Donnell
On 01/03/2011 06:37, Malm Paul wrote: Hi, I've used PgAdmin III to store a server backup. But I'm not able to restore it. Please, could any one tell me how to do it? Im using version 1.10 Hi there, Did you create a text or binary backup? If binary, you either (i) use pg_restore on the

Re: [GENERAL] Tool for shifting tables from Mysql to Postgresql

2011-03-01 Thread Raghavendra
Hi Adarsh, There are very good tools out for migration from Mysql to PostgreSQL. EnterpriseDB has the migration studio which will help to migrate Mysql to PostgreSQL. http://www.enterprisedb.com/solutions/mysql-vs-postgresql/how-to-move-from-mysql-to-postgresql Best Regards, Raghavendra

Re: [GENERAL] Tool for shifting tables from Mysql to Postgresql

2011-03-01 Thread Jaiswal Dhaval Sudhirkumar
By looking at error it seems that database encoding is different in mysql database. By default db encoding in PostgreSQL is UTF-8. You can set client_encoding by set client_encoding = what you have in mysql You can check the Mysql database encoding using following command. show variables

[GENERAL] Postgresql not start during Startup

2011-03-01 Thread Adarsh Sharma
Dear all, I have a problem related start up of Postgres Server, when I start or boot my system my postgres service starts and i am able to issues all Database related commands. In another system ( Ubuntu 10.4 ) , postgres service doesn't start and /etc/init.d/postgresql-8.4 status shows

Re: [GENERAL] Postgresql not start during Startup

2011-03-01 Thread Ray Stell
On Tue, Mar 01, 2011 at 06:37:35PM +0530, Adarsh Sharma wrote: But I want to start it after booting automatically. http://embraceubuntu.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Binary params in libpq

2011-03-01 Thread Kelly Burkhart
On Mon, Feb 28, 2011 at 8:42 AM, Merlin Moncure mmonc...@gmail.com wrote: On Sun, Feb 27, 2011 at 7:39 PM, Craig Ringer AFAIK, the `timestamp' type moved from a floating-point to an integer representation internally, which would've affected the binary protocol representation. That was even a

Re: [GENERAL] Lock ACCESS EXCLUSIVE and Select question !

2011-03-01 Thread Alan Acosta
Hi everyone, thanks for all your advice, i will take then in mind ^_^, yep it was a little difficult to know which seats i can sell, but it was one of the client request, some business constraints don't let me know how many seats have an specific bus even 5 minutes before departure, sometimes i

Re: [GENERAL] Lock ACCESS EXCLUSIVE and Select question !

2011-03-01 Thread Andrew Sullivan
On Tue, Mar 01, 2011 at 09:23:49AM -0500, Alan Acosta wrote: seats have an specific bus even 5 minutes before departure, sometimes i know sometimes i don't, even sometimes when i know i have to change on fly this capacity, for example my bus crash just before departure, so i have to use a

Re: [GENERAL] database is bigger after dump/restore - why? (60 GB to 109 GB)

2011-03-01 Thread Adrian Klaver
On Monday, February 28, 2011 9:51:10 pm Aleksey Tsalolikhin wrote: On Sun, Feb 27, 2011 at 2:52 AM, Alban Hertroys dal...@solfertje.student.utwente.nl wrote: Thank you for your kind replies. I noticed in your table definition that you seem to store timestamps in text-fields. Restoring

Re: [GENERAL] Binary params in libpq

2011-03-01 Thread Merlin Moncure
On Tue, Mar 1, 2011 at 8:19 AM, Kelly Burkhart kelly.burkh...@gmail.com wrote: On Mon, Feb 28, 2011 at 8:42 AM, Merlin Moncure mmonc...@gmail.com wrote: On Sun, Feb 27, 2011 at 7:39 PM, Craig Ringer AFAIK, the `timestamp' type moved from a floating-point to an integer representation

[GENERAL] Screencasts for PostgreSQL

2011-03-01 Thread James B. Byrne
I recently viewed a screen-cast on PostgreSQL developed by Peepcode.com and obtained a few really valuable insights respecting full text searches. These were things that I was dimly aware of but that extensive reading had not revealed to me ( lacking as I am in the imagination necessary ). I was

Re: [GENERAL] Lock ACCESS EXCLUSIVE and Select question !

2011-03-01 Thread Alan Acosta
Yep i already have those columns and unique constraint, my issue isn't sell the seat two times, i was a lot of paranoiac about that and use a lock mode to restricted for that. I will check if i can create rows for seats before sell and use update, so i can use SELECT FOR UPDATE and not use insert,

Re: [GENERAL] database is bigger after dump/restore - why? (60 GB to 109 GB)

2011-03-01 Thread Adrian Klaver
On Monday, February 28, 2011 9:51:10 pm Aleksey Tsalolikhin wrote: Here is what I see: nspname | relname | tablesize | indexsize | toastsize | toastindexsize +--++--

Re: [GENERAL] Binary params in libpq

2011-03-01 Thread Tom Lane
Kelly Burkhart kelly.burkh...@gmail.com writes: On Mon, Feb 28, 2011 at 8:42 AM, Merlin Moncure mmonc...@gmail.com wrote: Actually, this has always been a compile time option on the server as far as i remember and there is protocol support for it -- libpq tells you how it has been set...you've

Re: [GENERAL] database is bigger after dump/restore - why? (60 GB to 109 GB)

2011-03-01 Thread Tom Lane
Adrian Klaver adrian.kla...@gmail.com writes: Looks like the TOAST compression is not working on the second machine. Not sure how that could come to be. Further investigation underway:) Somebody carelessly messed with the per-column SET STORAGE settings, perhaps? Compare

Re: [GENERAL] slow building index and reference after Sybase to Pg

2011-03-01 Thread Gary Fu
On 02/28/11 19:30, Andres Freund wrote: Hi, On Wednesday 23 February 2011 19:31:58 Gary Fu wrote: I'm testing on converting a big Sybase db to Pg. It took about 45 hours to convert all sybase tables (bcp) to Pg (copy) without index and reference. After that I built the index (one by one,

Re: [GENERAL] Issues with imported blobs from Postgres 8 to 9

2011-03-01 Thread Mahdi Mankai
Thanks for the reply. What kind of detail can I provide? Mahdi On 2011-02-28, at 6:58 PM, Tom Lane wrote: Mahdi Mankai mahdi.man...@fuegoondemand.com writes: I created a database dumb using pg_dump on Postgres 8.3.6. After that I tried to import the same database into a Postgres 9.0

Re: [GENERAL] Issues with imported blobs from Postgres 8 to 9

2011-03-01 Thread David Johnston
Is there a way you can dump the same image in hex format (or even PostgreSQL's own escape format) from both the 8.3.6 and 9.0.X setup (with bytea_escape set to escape) and do a file comparison between the two to at least show that the results are different? As I have not actually ever done this I

[GENERAL] Thousands of users using one schema - ERROR: row is too big

2011-03-01 Thread Magnus Reftel
Hi all, I'm working on a database that will have a very large number of users, and I'm running in to a problem: when I grant more than about 2500 users access to a schema, I get my_db=# grant usage on schema my_schema to some_user; ERROR: row is too big: size 8168, maximum size 8164 This of

Re: [GENERAL] Thousands of users using one schema - ERROR: row is too big

2011-03-01 Thread Bill Moran
In response to Magnus Reftel magnus.ref...@gmail.com: I'm working on a database that will have a very large number of users, and I'm running in to a problem: when I grant more than about 2500 users access to a schema, I get my_db=# grant usage on schema my_schema to some_user; ERROR:

Re: [GENERAL] Thousands of users using one schema - ERROR: row is too big

2011-03-01 Thread Magnus Reftel
On Mar 1, 2011, at 21:57 , Bill Moran wrote: In response to Magnus Reftel magnus.ref...@gmail.com: I'm working on a database that will have a very large number of users, and I'm running in to a problem: when I grant more than about 2500 users access to a schema, I get my_db=# grant

[GENERAL] #PgEast Training Schedule Up

2011-03-01 Thread Joshua D. Drake
Hey folks, The training (not sessions) schedule is up for trainings. You can get it right off the front page: https://www.postgresqlconference.org/ . We are running 7 sessions in parallel with a total of 9 trainings. Sincerely, JD -- PostgreSQL.org Major Contributor Command Prompt, Inc:

[GENERAL] #PgEast Training Schedule Up

2011-03-01 Thread Joshua D. Drake
Hey folks, The training (not sessions) schedule is up for trainings. You can get it right off the front page: https://www.postgresqlconference.org/ . We are running 7 sessions in parallel with a total of 9 trainings. Sincerely, JD -- PostgreSQL.org Major Contributor Command Prompt, Inc:

Re: [GENERAL] Thousands of users using one schema - ERROR: row is too big

2011-03-01 Thread Joshua D. Drake
On Tue, 2011-03-01 at 15:57 -0500, Bill Moran wrote: In response to Magnus Reftel magnus.ref...@gmail.com: I'm working on a database that will have a very large number of users, and I'm running in to a problem: when I grant more than about 2500 users access to a schema, I get

Re: [GENERAL] Thousands of users using one schema - ERROR: row is too big

2011-03-01 Thread Tom Lane
Bill Moran wmo...@potentialtech.com writes: In response to Magnus Reftel magnus.ref...@gmail.com: On IRC, linuxpoet and andres suggested that the problem is that the nspacl column in pg_catalog.pg_namespace grows too large. A suggested fix by linuxpoet adds a toast table to pg_namespace. I

[GENERAL] #PgEast Training Schedule Up

2011-03-01 Thread Joshua D. Drake
Hey folks, The training (not sessions) schedule is up for trainings. You can get it right off the front page: https://www.postgresqlconference.org/ . We are running 7 sessions in parallel with a total of 9 trainings. Sincerely, JD -- PostgreSQL.org Major Contributor Command Prompt, Inc:

[GENERAL] What could cause sudden increase in PARSE stage of prepared statements?

2011-03-01 Thread hubert depesz lubaczewski
hi i have system when we log every query that is over 150ms. usually we get 100-500 parse ... elements per minute, but there are some cases where the number exceeds 15000 per minute (it's pretty busy system). the interesting fact is that io is not taxed, there is no sudden network traffic, not

[GENERAL] Dynamic binding in plpgsql function

2011-03-01 Thread Pierre Racine
Hi, I would like to write a generic plpgsql function with a text parameter being a callback function name so that my general function can call this callback function. e.g.: CREATE OR REPLACE FUNCTION ST_MyCallbackFunction(y int) RETURNS int AS $$ DECLARE BEGIN RETURN

Re: [GENERAL] Dynamic binding in plpgsql function

2011-03-01 Thread Pavel Stehule
Hello 2011/3/2 Pierre Racine pierre.rac...@sbf.ulaval.ca: Hi, I would like to write a generic plpgsql function with a text parameter being a callback function name so that my general function can call this callback function. e.g.: CREATE OR REPLACE FUNCTION ST_MyCallbackFunction(y int)  

Re: [GENERAL] Dynamic binding in plpgsql function

2011-03-01 Thread Vibhor Kumar
On Mar 2, 2011, at 4:31 AM, Pierre Racine wrote: CREATE OR REPLACE FUNCTION ST_MyGeneralFunction(callback text) RETURNS SETOF geomval AS $$ DECLARE x integer; y integer; BEGIN y := somecalculation; x := 'callback'(y); --This is what I need

[GENERAL] Query should have failed, but didn't?

2011-03-01 Thread Royce Ausburn
Hi all, Got an odd one. test=# select version(); version

Re: [GENERAL] Query should have failed, but didn't?

2011-03-01 Thread Andy Colson
On 03/01/2011 07:50 PM, Royce Ausburn wrote: Hi all, Got an odd one. test=# select version(); version --- PostgreSQL 8.4.5 on i386-apple-darwin, compiled by

Re: [GENERAL] Query should have failed, but didn't?

2011-03-01 Thread David Johnston
This is not a bug; given your test queries whenever you reference “id1” you are ALWAYS referencing the column “id1” in table “test2”. test=# select * from test2 where id1 in (select id1 from test1) and charge=70;  id1 | charge  -+   10 |     70 (1 row) Hint: Consider the results of:

Re: [GENERAL] Query should have failed, but didn't?

2011-03-01 Thread Royce Ausburn
On 02/03/2011, at 2:16 PM, Andy Colson wrote: Its getting id1 from the parent table. (test2) You can use fields from the parent table in subselects. try this and it'll complain: select * from test2 where id1 in (select junk from test1) and charge=70; Oh! Of course! What a fool.

[GENERAL] Comparing md5 hash with md5 password hash

2011-03-01 Thread Michał Koba
Hi We are developing application in Microsoft Access linked via ODBC with PostgreSQL 8.2 database. The ODBC Data Source is configured to login using single user and password for all users logining to our application in MS. Now. We need to check out if user that trying to login has

Re: [GENERAL] Comparing md5 hash with md5 password hash

2011-03-01 Thread Thom Brown
2011/3/2 Michał Koba toy...@poczta.fm Hi We are developing application in Microsoft Access linked via ODBC with PostgreSQL 8.2 database. The ODBC Data Source is configured to login using single user and password for all users logining to our application in MS. Now. We need to