Re: [GENERAL] How to realize ROW_NUMBER() in 8.3?

2011-04-29 Thread Wappler, Robert
On 2011-04-20, Emi Lu wrote: > Hello, > > ROW_NUMBER() is only ready in 8.4. For 8.3, is there a simple > way to get > row_number > > select row_number(), col1, col2... > FROM tableName > You definitely want to skim through the SQL Cookbook (http://www.oreilly.de/catalog/9780596009762/) for

Re: [GENERAL] GUC configuration

2011-02-10 Thread Wappler, Robert
On %D, %SN wrote: %Q %C -- Robert... > -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of T ?apap?t??? > Sent: Thursday, February 10, 2011 2:18 PM > To: pgsql-general@postgresql.org > Subject: [GENERAL] GUC c

Re: [GENERAL] set theory question

2011-02-03 Thread Wappler, Robert
On 2011-02-02, matty jones wrote: > I am looking for a good book on the math and/or theory behind > relational databases and associated topics.. I am looking > some works on set theory, algebra, or any other books/papers > on the mechanics that databases are built on. I found one > book online,

[GENERAL] How to indicate failure of a shell script to pgagent

2010-11-30 Thread Wappler, Robert
Hi, I'm using postgresql 8.4.5 and pgagent 1.8.4 on debian lenny. I set up a pgagent job, which executes every 15 minutes. In one step, there is a shell script executed. For testing purposes, the script is simply a one-liner containing "exit 1". Nevertheless, pgAdmin tells me, the job executed

Re: [GENERAL] Optimizing queries that use multiple tables and many order by columns

2010-08-26 Thread Wappler, Robert
On 2010-08-25, Joshua Berry wrote: > --Here's what explain analyze says for the query > explain analyze > declare "SQL_CUR0453D910" cursor with hold for > select Anl.Priority, Anl.Lab, Anl.Job, JOB.DateIn, > JOB.CompanyCode, Anl.SampleName > from analysis anl join job on anl.job = job.job > order

Re: [GENERAL] Optimizing queries that use multiple tables and many order by columns

2010-08-25 Thread Wappler, Robert
On 2010-08-25, Joshua Berry wrote: > Hi Group, > > I've never really learned how to optimize queries that join > several tables and have order by clauses that specify columns > from each table. Is there documentation that could help me > optimize and have the proper indexes in place? I've read >

Re: [GENERAL] Feature proposal

2010-08-25 Thread Wappler, Robert
On 2010-08-25, wstrzalka wrote: > I'm currently playing with very large data import using COPY from file. > > As this can be extremely long operation (hours in my case) the nice > feature would be some option to show operation progress - how many > rows were already imported. > > Or maybe there

[GENERAL] Planner decisions

2010-07-16 Thread Wappler, Robert
Hi, Attached is a query and its corresponding plan, where sorting of the CTE acts seems to be the bottle neck. It is a real execution plan captured with the auto_explain module. The query is recursive. In each iteration CTE acts is sorted again, which is obviously quite expensive for about 24000

Re: [GENERAL] Uncable to commit: transaction marked for rollback

2010-07-02 Thread Wappler, Robert
On 2010-07-01, David Kerr wrote: > I'm intermittantly getting this error message in a java app. > using Geronimo / Hibernate / Postgres 8.3.9 > > javax.transaction.RollbackException: Unable to commit: > transaction marked for > rollback > > Can someone give me a scenario where this would happen

[GENERAL] Nested function invocation, but parameter does not exist

2010-05-31 Thread Wappler, Robert
Hi list, I want to create an install script for a database. First a schema and its elements are created in a second approach, some adjustments are done, e.g. create rows, which can be referenced as defaults instead of having NULL in the referenced column. Below is a minimum non-working example. Th

Re: [GENERAL] vulnerability of COPY command

2010-05-31 Thread Wappler, Robert
On 2010-05-30, Martin Gainty wrote: > i have mixed feelings about parameterised statements. > > On the one hand a parameterised statement would be more > difficult for a Wireshark criminal to insert their own c**p > into a database because they would have to know the schema > a-priori for exampl

Re: [GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread Wappler, Robert
On 2010-04-22, John Gage wrote: > Well, well, well. Guess who the culprit is... > > I edited the file both in Vim and in pgAdmin3 (1.10.2, Mar 9 > 2010, rev > 8217), and the BOM shows up after saving the file with pgAdmin3. > > I don't know if pgAdmin3 wants to keep this feature... > > Thank

Re: [GENERAL] one null value in array isnt allowed???

2010-03-29 Thread Wappler, Robert
On 2010-03-29, Armand Turpel wrote: > Hi, > > Updating an array field with one null value isnt possible: > > UPDATE table SET integer_array = ARRAY[NULL] > Try to specify an explicit type, e.g. ARRAY[NULL]::int[] > But those queries are working: > > UPDATE table SET integer_array = ARRAY[NU

Re: [GENERAL] Connection Pooling

2010-03-29 Thread Wappler, Robert
On 2010-03-29, David Kerr wrote: > On 3/27/2010 12:46 AM, John R Pierce wrote: >> Allan Kamau wrote: >>> You may also have a look at Commons DBCP from Apache software >>> foundation, "http://commons.apache.org/dbcp/";. I have used it for a >>> few projects and have had no problems. >> >> for tha

Re: [GENERAL] Restricting the CREATEROLE privilege

2010-02-25 Thread Wappler, Robert
On 2010-02-25, Alex Hunsaker wrote: > You could create a base role that does not have connect privileges on > the other databases. Then just inherit from that role. Something like: > CREATE ROLE base_user; REVOKE CONNECT ON database from base_user; ... > > CREATE ROLE my_user inherit base_user

Re: [GENERAL] helo

2010-02-25 Thread Wappler, Robert
On 2010-02-22, beulah prasanthi wrote: > Helo > I am working on spring project with postgres 8.4 > i wrote a function in postgrees which i am passing the > argument email email[] array > From front end we need to insesrt data into that emailarray > .so i used java.arraylist.util > while i am

[GENERAL] Restricting the CREATEROLE privilege

2010-02-25 Thread Wappler, Robert
Good Morning, is there a way to limit the CREATEROLE privilege to a specific database? I currently set up an automated integration test environment. This includes a database owned by a specific user which should have all degrees of freedom for installing whatever database schemas are in the current

Re: [GENERAL] Attribute a value to a record

2010-02-03 Thread Wappler, Robert
On 2010-02-03, Florent THOMAS wrote: > Dear laurenz Albe, > > Thank you for answering so fast. for me, the variable ventilation_local > is defined as a record type. So as I wrote on the other mail, I made > some additionnal test because the doc precise that the syntax above is > allowed : http:

Re: [GENERAL] How to generate unique hash-type id?

2010-01-29 Thread Wappler, Robert
On 2010-01-29, Joe Kramer wrote: > Thanks for the answer, > > I am unable to use ossp_uuid due to package install and/or server > rebuild requirement. > > So I am trying to roll my own, and > digest(quote_literal(random()+random()), 'sha256'), 'hex') doesn't work: > Your input value is a rand

[GENERAL] Return Next and Return Query

2009-12-23 Thread Wappler, Robert
Hello, I'm not quite sure, what's the difference between RETURN NEXT and RETURN QUERY. >From the documentation (Sec. 38.6) RETURN NEXT returns a table and in my understanding with each execution a different table. RETURN QUERY appends a result set of a query to the function's result set, i.e.

Re: [GENERAL] table-valued arguments for functions

2009-12-22 Thread Wappler, Robert
> -Original Message- > From: Filip RembiaƂkowski [mailto:plk.zu...@gmail.com] > Sent: Monday, December 21, 2009 6:51 PM > To: Wappler, Robert > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] > > > 2009/12/21 Wappler, Robert > > >

[GENERAL]

2009-12-21 Thread Wappler, Robert
Hello, when defining functions, why can't they take table-valued arguments? I do not see the sense of this restriction. When a function takes a table as an argument, whole tables could be transformed in an obvious way. Currently functions must operate row-wise (at least I haven't found another way