Re: [GENERAL] Prepared statements and cursors

2014-01-28 Thread Andreas Lubensky
That is an interesting approach. However, I see the problem that the functions would have to be removed when no longer needed. If that fails (broken connection etc.), they would be orphaned. Prepared statements are bound to the connection, so when the connection is closed they are gone. On Thu,

Re: [GENERAL] Prepared statements and cursors

2014-01-28 Thread Merlin Moncure
On Tue, Jan 28, 2014 at 7:53 AM, Andreas Lubensky luben...@cognitec.com wrote: That is an interesting approach. However, I see the problem that the functions would have to be removed when no longer needed. If that fails (broken connection etc.), they would be orphaned. Prepared statements are

Re: [GENERAL] PostgreSQL 9.2.4 using large amount of memory

2014-01-28 Thread Bruce Momjian
On Mon, Jan 27, 2014 at 12:12:13PM -0500, Tom Lane wrote: Bhushan Pathak bhushan.patha...@gmail.com writes: In 9.1.3, this usage was upto 25MB with the same load on the same server. With 9.2.4 it has jumped upto ~580 MB. We are monitoring the RES column from top output to get the memory

Re: [GENERAL] problem with grant all privileges

2014-01-28 Thread Bruce Momjian
On Mon, Jan 27, 2014 at 07:48:33PM -0500, Tom Lane wrote: Susan Cassidy susan.cass...@decisionsciencescorp.com writes: This is 9.2 I'd bet a very good dinner that it isn't --- maybe your psql is, but your server has to be pre-9.0. Try select version(); to see the actual version of the

Re: [GENERAL] problem with grant all privileges

2014-01-28 Thread Alvaro Herrera
Bruce Momjian escribió: On Mon, Jan 27, 2014 at 07:48:33PM -0500, Tom Lane wrote: Susan Cassidy susan.cass...@decisionsciencescorp.com writes: This is 9.2 I'd bet a very good dinner that it isn't --- maybe your psql is, but your server has to be pre-9.0. Try select version(); to

Re: [GENERAL] problem with grant all privileges

2014-01-28 Thread Bruce Momjian
On Tue, Jan 28, 2014 at 02:40:47PM -0300, Alvaro Herrera wrote: Bruce Momjian escribió: On Mon, Jan 27, 2014 at 07:48:33PM -0500, Tom Lane wrote: Susan Cassidy susan.cass...@decisionsciencescorp.com writes: This is 9.2 I'd bet a very good dinner that it isn't --- maybe your psql

Re: [GENERAL] problem with grant all privileges

2014-01-28 Thread Rob Sargent
On 01/28/2014 10:33 AM, Bruce Momjian wrote: On Mon, Jan 27, 2014 at 07:48:33PM -0500, Tom Lane wrote: Susan Cassidy susan.cass...@decisionsciencescorp.com writes: This is 9.2 I'd bet a very good dinner that it isn't --- maybe your psql is, but your server has to be pre-9.0. Try select

Re: [GENERAL] problem with grant all privileges

2014-01-28 Thread Susan Cassidy
It turns out IT screwed something up when they installed 9.2. The actual server/client running is still pointing to 8.4. Thanks, guys. Susan On Mon, Jan 27, 2014 at 4:48 PM, Tom Lane t...@sss.pgh.pa.us wrote: Susan Cassidy susan.cass...@decisionsciencescorp.com writes: This is 9.2 I'd

Re: [GENERAL] Composite type

2014-01-28 Thread Kevin Grittner
antono124 g.antonopoulos...@gmail.com wrote: Lets say that we have 2 tables. Create Table table1 Of type1 Create Table table2 Of type2 I want to refer the first table in the second. I want to reference the whole table not only one field, so something like that: CREATE TYPE type2 AS

[GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Merlin Göttlinger
Hello fellow postgres users, I am very new to postgres and databases in general. I needed a database for a project and I chose to use PostgreSQL. I googled around until I was confident enough to do the things I wanted to do. I have written two applications that both use the same database. The

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread John R Pierce
On 1/28/2014 12:11 PM, Merlin Göttlinger wrote: I don't know if this is just a beginner problem but at least in my opinion it is rather complicated to use the postgres specific types and features from JDBC and its wrappers. these issues are entirely created by the wrappers you're using. like

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Tom Lane
John R Pierce pie...@hogranch.com writes: On 1/28/2014 12:11 PM, Merlin Göttlinger wrote: I don't know if this is just a beginner problem but at least in my opinion it is rather complicated to use the postgres specific types and features from JDBC and its wrappers. these issues are

[GENERAL] PgToolkit v1.0.1 release testing

2014-01-28 Thread Sergey Konoplev
Hi all, I have completed all the planned changes for the version 1.0.1 and merged them to the v1.0testing branch. Anyone interested in testing is very welcome. You can report bugs (hope there wont be any) and make notes either directly to my email gray...@gmail.com or on GiHub's Issue page

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread John R Pierce
On 1/28/2014 1:20 PM, Tom Lane wrote: I think you can fix it by explicitly casting your placeholders, eg ?::macaddr. that might work for a wrapper that lets you roll your own SQL, but I thought he said one of these autogenerated SQL, taking it out of his control. -- john r pierce

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Mike Christensen
I've had the same problem as well with NHibernate (On .NET) with Postgres ENUM types. Luckily, NHibernate is incredibly powerful and you *can* get everything working flawlessly, however it takes some serious digging into the source code and reading the docs to figure it out. The main issue is

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread John R Pierce
On 1/28/2014 2:35 PM, Mike Christensen wrote: This works. However, to agree with the original poster's point, if Postgres could be a little more forgiving about values that could be interpreted as correct (like an implicit cast between numeric and enum and string and enum) then we wouldn't

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Mike Christensen
Interesting! I'd be curious as to what types of bugs were caused by these implicit casts.. Note 8.3 was in the days back before ORMs became popular, so just write better SQL was a perfectly decent solution to the problem back then. Now days, this requirement might make Postgres incompatible

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Andrew Sullivan
On Tue, Jan 28, 2014 at 02:55:03PM -0800, Mike Christensen wrote: I'd be curious as to what types of bugs were caused by these implicit casts.. Typically, they were cases when there was an ambiguity that the programmer didn't understand, causing applications to blow up in surprising and

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Mike Christensen
How do you create casts in Postgres? On Tue, Jan 28, 2014 at 3:24 PM, Andrew Sullivan a...@crankycanuck.cawrote: On Tue, Jan 28, 2014 at 02:55:03PM -0800, Mike Christensen wrote: I'd be curious as to what types of bugs were caused by these implicit casts.. Typically, they were cases

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Mike Christensen
Oh. The CREATE CAST command. Wow, I was totally unaware of this entire feature! On Tue, Jan 28, 2014 at 3:36 PM, Mike Christensen m...@kitchenpc.comwrote: How do you create casts in Postgres? On Tue, Jan 28, 2014 at 3:24 PM, Andrew Sullivan a...@crankycanuck.cawrote: On Tue, Jan 28,

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Andrew Sullivan
On Tue, Jan 28, 2014 at 03:38:49PM -0800, Mike Christensen wrote: Oh. The CREATE CAST command. Wow, I was totally unaware of this entire feature! See, this is why Postgres really is better than you ever think. Just when you're convinced that you have a totally impossible problem, it turns

Re: [GENERAL] PostgreSQL 9.2.4 using large amount of memory

2014-01-28 Thread Raghavendra
Thanks On 27 Jan 2014 22:35, Bhushan Pathak bhushan.patha...@gmail.com wrote: Hello, We have recently shifted to postgresql version 9.2.4 from 9.1.3. After the migration, we observed that some of our delete queries on single table [which have triggers, which in turn call other functions] have

Re: [GENERAL] Composite type

2014-01-28 Thread Chris Travers
As a note, the following also works: CREATE TYPE foo AS (bar text, baz int); CREATE TABLE table_of_foo OF foo (primary key(bar)); The one thing that doesn't work is the REF syntax and the operators that go along with that. However, you could come up with dereferencing functions and operators

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Craig Ringer
On 01/29/2014 05:20 AM, Tom Lane wrote: John R Pierce pie...@hogranch.com writes: On 1/28/2014 12:11 PM, Merlin Göttlinger wrote: I don't know if this is just a beginner problem but at least in my opinion it is rather complicated to use the postgres specific types and features from JDBC and

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Tom Lane
Mike Christensen m...@kitchenpc.com writes: Oh. The CREATE CAST command. Wow, I was totally unaware of this entire feature! Before you get too excited about inserting your own implicit casts, you really should get familiar with the reasons there aren't ones already ;-). As was mentioned

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Tom Lane
Craig Ringer cr...@2ndquadrant.com writes: I just want us to allow, by default, implicit casts FROM text (not TO text) using the input function for all PostgreSQL's validated non-standard types (and XML due to limited deployment of SQL/XML support in client drivers). Sorry, that is *just* as

[GENERAL] Re: PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread David Johnston
Tom Lane-2 wrote Craig Ringer lt; craig@ gt; writes: I just want us to allow, by default, implicit casts FROM text (not TO text) using the input function for all PostgreSQL's validated non-standard types (and XML due to limited deployment of SQL/XML support in client drivers). Sorry,

Re: [GENERAL] PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC

2014-01-28 Thread Craig Ringer
On 01/29/2014 02:01 PM, Tom Lane wrote: Craig Ringer cr...@2ndquadrant.com writes: I just want us to allow, by default, implicit casts FROM text (not TO text) using the input function for all PostgreSQL's validated non-standard types (and XML due to limited deployment of SQL/XML support in