Re: [GENERAL] autoanalyze criteria

2013-02-25 Thread Alban Hertroys
On Feb 25, 2013, at 7:23, Stefan Andreatta wrote: > On 02/24/2013 12:52 PM, Alban Hertroys wrote: >> On Feb 23, 2013, at 14:11, Stefan Andreatta wrote: >> >>> And we are still missing a number for rows updated since the last analyse. >> >> In MVCC an update is an insert + delete, so you alread

Re: [GENERAL] autoanalyze criteria

2013-02-25 Thread Stefan Andreatta
On 02/25/2013 09:00 AM, Alban Hertroys wrote: On Feb 25, 2013, at 7:23, Stefan Andreatta > wrote: On 02/24/2013 12:52 PM, Alban Hertroys wrote: On Feb 23, 2013, at 14:11, Stefan Andreatta > wrote: And we are still missing a numb

Re: [GENERAL] Floating point error

2013-02-25 Thread Tom Duffey
Here is a smaller test case that does not involve Java. I guess this probably is just due to floating point error when the initial value is inserted that is too large for the field but it's still a surprise. Create a test table, insert a couple values and view the results: CREATE TABLE test (

Re: [GENERAL] Floating point error

2013-02-25 Thread Albe Laurenz
Tom Duffey wrote: > Here is a smaller test case that does not involve Java. I guess this probably > is just due to floating > point error when the initial value is inserted that is too large for the > field but it's still a > surprise. > > Create a test table, insert a couple values and view the

Re: [GENERAL] Floating point error

2013-02-25 Thread Tom Duffey
That's exactly what I was looking for. We use COPY to transfer data from a 1 billion+ row table to a test database and were confused why the results looked the same but were obviously not. Sounds like we need to use the extra_float_digits setting to include all the available information when tr

[GENERAL] Reading an OUT parameter out of a function call

2013-02-25 Thread Stefan Keller
Hi, I have a simple void function: CREATE OR REPLACE FUNCTION myfn(myparam OUT int) AS $$ BEGIN pnr := 1; END; $$ LANGUAGE plpgsql; How do I access myparam? I thought this should work with 9.1/9.2: SELECT (myfn()).myparam; Or inside another function? Yours, Stefan -- Sent via pgsql-general

Re: [GENERAL] Reading an OUT parameter out of a function call

2013-02-25 Thread Merlin Moncure
On Mon, Feb 25, 2013 at 11:22 AM, Stefan Keller wrote: > Hi, > > I have a simple void function: > > CREATE OR REPLACE FUNCTION myfn(myparam OUT int) > AS $$ > BEGIN > pnr := 1; > END; > $$ LANGUAGE plpgsql; > > How do I access myparam? > I thought this should work with 9.1/9.2: SELECT (myfn()).m

Re: [GENERAL] Reading an OUT parameter out of a function call

2013-02-25 Thread Pavel Stehule
Hello 2013/2/25 Stefan Keller : > Hi, > > I have a simple void function: > > CREATE OR REPLACE FUNCTION myfn(myparam OUT int) > AS $$ > BEGIN > pnr := 1; > END; > $$ LANGUAGE plpgsql; > > How do I access myparam? > I thought this should work with 9.1/9.2: SELECT (myfn()).myparam; > Or inside ano

Re: [GENERAL] Reading an OUT parameter out of a function call

2013-02-25 Thread Adrian Klaver
On 02/25/2013 09:22 AM, Stefan Keller wrote: Hi, I have a simple void function: CREATE OR REPLACE FUNCTION myfn(myparam OUT int) AS $$ BEGIN pnr := 1; END; $$ LANGUAGE plpgsql; How do I access myparam? I thought this should work with 9.1/9.2: SELECT (myfn()).myparam; Or inside another funct

[GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread Frank Cavaliero
Hi, I have an application that requires to connect to each database available in PostgreSQL. I have the following questions: 1. Is there a USE DATABASE command or something of the sort (similar to MySQL) that allows you to quickly connect to a database without having to reconnect using the

Re: [GENERAL] Reading an OUT parameter out of a function call

2013-02-25 Thread Russell Keane
> > I have a simple void function: > > > > CREATE OR REPLACE FUNCTION myfn(myparam OUT int) AS $$ BEGIN > >pnr := 1; > > END; > > $$ LANGUAGE plpgsql; > > > > How do I access myparam? > > I thought this should work with 9.1/9.2: SELECT (myfn()).myparam; Or > > inside another function? > > You

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread John R Pierce
On 2/25/2013 10:22 AM, Frank Cavaliero wrote: 1. Is there a USE DATABASE command or something of the sort (similar to MySQL) that allows you to quickly connect to a database without having to reconnect using the username,password and database again ? In Java, we are using set catalog to do t

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread Adrian Klaver
On 02/25/2013 10:22 AM, Frank Cavaliero wrote: Hi, I have an application that requires to connect to each database available in PostgreSQL. I have the following questions: 1. Is there a USE DATABASE command or something of the sort (similar to MySQL) that allows you to quickly connect to a d

Re: [GENERAL] Reading an OUT parameter out of a function call

2013-02-25 Thread Stefan Keller
Thank you Keane and all. That works for me too. Yours, Stefan 2013/2/25 Russell Keane : >> > I have a simple void function: >> > >> > CREATE OR REPLACE FUNCTION myfn(myparam OUT int) AS $$ BEGIN >> >pnr := 1; >> > END; >> > $$ LANGUAGE plpgsql; >> > >> > How do I access myparam? >> > I thoug

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread Frank Cavaliero
Hi Adrian, Thanks for the response. The situation is more like the following: Using the JDBC driver, I connect to database TEST1 and immediately, without having to pass username credentials again, I want to use database TEST2. In MySQL, you can simply run: use TEST2. Wondering if Postgre

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread Frank Cavaliero
Hi John, Thanks for the response. I will look into that as an option. Thanks, Frank From: John R Pierce To: pgsql-general@postgresql.org Date: 02/25/2013 01:33 PM Subject: Re: [GENERAL] Use, Set Catalog and JDBC questions Sent by: pgsql-general-ow...@postgresql.org On 2/25/2013 10:2

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread John R Pierce
On 2/25/2013 10:34 AM, Adrian Klaver wrote: Not sure if this will do what want?: http://jdbc.postgresql.org/documentation/91/datasource.html#ds-intro a connection pool is something completely different. pools are used when you have many client threads connecting and disconnecting to the s

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread Adrian Klaver
On 02/25/2013 10:57 AM, Frank Cavaliero wrote: Hi Adrian, Thanks for the response. The situation is more like the following: Using the JDBC driver, I connect to database TEST1 and immediately, without having to pass username credentials again, I want to use database TEST2. In MySQL, you can

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread Adrian Klaver
On 02/25/2013 10:59 AM, John R Pierce wrote: On 2/25/2013 10:34 AM, Adrian Klaver wrote: Not sure if this will do what want?: http://jdbc.postgresql.org/documentation/91/datasource.html#ds-intro a connection pool is something completely different. pools are used when you have many client th

Re: [ADMIN] [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread k...@rice.edu
On Mon, Feb 25, 2013 at 01:57:11PM -0500, Frank Cavaliero wrote: > Hi Adrian, > > Thanks for the response. The situation is more like the following: > > Using the JDBC driver, I connect to database TEST1 and immediately, > without having to pass username credentials again, I want to use databa

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread John R Pierce
On 2/25/2013 11:04 AM, Adrian Klaver wrote: test=# \c production You are now connected to database "production". and the \c metacommand in psql disconnects(closes) the current database and connects to the new one, using the same credentials as originally provided, unless you specify otherwi

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread Frank Cavaliero
Hi Adrian, Thanks a lot!I will certainly look into the multiple datasources as an option. -Frank From: Adrian Klaver To: Frank Cavaliero/Boston/IBM@IBMUS Cc: pgsql-ad...@postgresql.org, pgsql-general@postgresql.org Date: 02/25/2013 02:16 PM Subject: Re: [GENERAL] Use, Set Catalog a

[GENERAL] JDBC not returning update count from updateable view

2013-02-25 Thread Russell Keane
Hi, We have a table which is inserted to and update via a view (using rules / functions). We are trying to update this from JDBC but the view update command (on the java side) doesn't return the count of rows updated. I assume this is because the postgres update function actually returns a tup

[GENERAL] Windows build question

2013-02-25 Thread Shawn Chisholm
Hi everyone, Apologies if this is answered elsewhere (quick search didn't find anything). I have noticed that MSVC 2005 is supported for 32-bit Postgres server compilation but not 64-bit. Are there known issues limiting this, or just nobody has worked on it yet? Thanks, Shawn -- Sent via p

Re: [GENERAL] Use, Set Catalog and JDBC questions

2013-02-25 Thread Adrian Klaver
On 02/25/2013 11:21 AM, Frank Cavaliero wrote: Hi Adrian, Thanks a lot!I will certainly look into the multiple datasources as an option. Just remember, as John pointed out, a MySQL database and a Postgres database are not equivalent. You will not be able to do cross database operations(

Re: [GENERAL] Floating point error

2013-02-25 Thread Kevin Grittner
Tom Duffey wrote: > CREATE TABLE test ( > id INTEGER PRIMARY KEY, > value REAL NOT NULL > ); > > INSERT INTO test (id, value) VALUES (1, 10.3884573), (2, 10.3885); > SELECT * FROM test; > > id |  value > +- >   1 | 10.3885 >   2 | 10.3885 > (2 rows) > > At this point you wou