Re: [GENERAL] PostgreSQL Cache

2008-09-29 Thread Greg Smith
On Mon, 29 Sep 2008, Matthew Pulis wrote: I need to perform some timed testing, thus need to make sure that disk cache does not affect me. Is clearing the OS (Ubuntu) disk cache, ( by running: sudo echo 3 | sudo tee /proc/sys/vm/drop_caches ) enough to do this? What you should do is: 1)

Re: [GENERAL] PostgreSQL Cache

2008-09-29 Thread Joris Dobbelsteen
Matthew Pulis wrote: Hi, I need to perform some timed testing, thus need to make sure that disk cache does not affect me. Is clearing the OS (Ubuntu) disk cache, ( by running: sudo echo 3 | sudo tee /proc/sys/vm/drop_caches ) enough to do this? If not can you please point me to some site

Re: [GENERAL] Replication using slony-I

2008-09-29 Thread Richard Huxton
Abdul Rahman wrote: Hi all, I am following the steps present in this link: http://people.planetpostgresql.org/dpage/index.php?/archives/51-Setting-up-Slony-I-with-pgAdmin.html But failed to complete step # 13. Here I am unable to get CREATE NEW SUBSCRIPTION. Can any body guide me plz.

Re: [GENERAL] Replication using slony-I

2008-09-29 Thread Abdul Rahman
I am not getting the New Subscription option when do right click on subscription (0) on the master node.

Re: [GENERAL] PostgreSQL Cache

2008-09-29 Thread Oleg Bartunov
A while ago I wrote a script based on Dave Plonka work http://net.doit.wisc.edu/~plonka/fincore/ My script monitors system buffers and shared buffers (if pg_buffercache installed) and I found it's almost useless to check system buffers, since I got rather ridiculous numbers. I use it to

Re: [GENERAL] pg_start_backup() takes too long

2008-09-29 Thread Ivan Zolotukhin
Guys, This is all not about checkpoints. As I've mentioned in the first message, even right after manual run of CHECKPOINT command in psql pg_start_backup() takes same time (~10 minutes). Regards, Ivan On Sun, Sep 28, 2008 at 8:18 PM, Simon Riggs [EMAIL PROTECTED] wrote: On Sun, 2008-09-28

Re: [GENERAL] NULL values seem to short-circuit my unique index

2008-09-29 Thread Tom Allison
You can always add a constraint that these columns cannot be NULL themselves. That removes this problem. On Sep 28, 2008, at 11:17 PM, Klint Gore [EMAIL PROTECTED] wrote: Matthew Wilson wrote: I'm trying to comprehend how NULL values interact with unique indexes. It seems like I can insert

Re: [GENERAL] pg_start_backup() takes too long

2008-09-29 Thread Simon Riggs
On Mon, 2008-09-29 at 13:39 +0400, Ivan Zolotukhin wrote: This is all not about checkpoints. As I've mentioned in the first message, even right after manual run of CHECKPOINT command in psql pg_start_backup() takes same time (~10 minutes). As explained, there's not very much going on apart

Re: [GENERAL] Replication using slony-I

2008-09-29 Thread Raymond O'Donnell
On 29/09/2008 08:49, Abdul Rahman wrote: I am not getting the New Subscription option when do right click on subscription (0) on the master node. It sounds like you're using pgAdmin - IIRC you need to have some parts at least of Slony installed on the machine on which pgAdmin is running. There

Re: [GENERAL] PostgreSQL Cache

2008-09-29 Thread Sam Mason
On Mon, Sep 29, 2008 at 02:55:52AM -0400, Greg Smith wrote: On Mon, 29 Sep 2008, Matthew Pulis wrote: I need to perform some timed testing, thus need to make sure that disk cache does not affect me. Is clearing the OS (Ubuntu) disk cache, (by running: sudo echo 3 | sudo tee

[GENERAL] access public relation from a private database

2008-09-29 Thread Joey K.
Hello, I've created a table in public schema, CREATE TABLE public.foo (fooid SERIAL); When I try to create a table in database nowhere that references public.foo table, CREATE DATABASE nowhere; \c nowhere; CREATE TABLE bar (bar integer REFERENCES public.foo(fooid)); I get, ERROR: relation

Re: [GENERAL] access public relation from a private database

2008-09-29 Thread Tino Wildenhain
Joey K. wrote: Hello, I've created a table in public schema, CREATE TABLE public.foo (fooid SERIAL); When I try to create a table in database nowhere that references public.foo table, CREATE DATABASE nowhere; \c nowhere; CREATE TABLE bar (bar integer REFERENCES public.foo(fooid)); I get,

Re: [GENERAL] access public relation from a private database

2008-09-29 Thread A. Kretschmer
am Mon, dem 29.09.2008, um 17:43:21 +0530 mailte Joey K. folgendes: When I try to create a table in database nowhere that references public.foo table, CREATE DATABASE nowhere; \c nowhere; CREATE TABLE bar (bar integer REFERENCES public.foo(fooid)); I get, ERROR: relation public.foo

Re: [GENERAL] pg_start_backup() takes too long

2008-09-29 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: I'm surprised that checkpoint smoothing moves slowly even when it has so little to do. AFAIK that's operating as designed. The point being that we shouldn't create any more I/O load than we absolutely have to. It's not clear to me that it's a bug for

Re: [GENERAL] Replication using slony-I

2008-09-29 Thread Glyn Astill
I am not getting the New Subscription option when do right click on subscription (0) on the master node. It sounds like you're using pgAdmin - IIRC you need to have some parts at least of Slony installed on the machine on which pgAdmin is running. Personally I prefer to use slonik,

Re: [GENERAL] Replication using slony-I

2008-09-29 Thread Raymond O'Donnell
On 29/09/2008 14:23, Glyn Astill wrote: The whole problem with having clicky menus is that it allows you do do things without full knowledge of what's going off, and that can never be the case with slony. I agree, and I prefer to use Slonik as well. The example given in the docs was good

[GENERAL] error:

2008-09-29 Thread chetan N
Hi, I am trying to pass array of elements to store procedure, as follows CREATE TYPE emptype as( name text, id integer, dob date); Function

Re: [GENERAL] error:

2008-09-29 Thread Tom Lane
chetan N [EMAIL PROTECTED] writes: CREATE TYPE emptype as( name text, id integer, dob date); SELECT * from

Re: [GENERAL] pg_start_backup() takes too long

2008-09-29 Thread Simon Riggs
On Mon, 2008-09-29 at 08:35 -0400, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: I'm surprised that checkpoint smoothing moves slowly even when it has so little to do. AFAIK that's operating as designed. The point being that we shouldn't create any more I/O load than we

[GENERAL] pl-pgsql, recursion and cursor contexting

2008-09-29 Thread Gauthier, Dave
Hi: I'm in the business of writting recursive PL-Pgsql functions. I need to know what happens to the data stream from a select cursor inside of which the recursive call is made. For example create table int_stream (num integer); insert into int_stream (num) values (1); insert

Re: [GENERAL] pl-pgsql, recursion and cursor contexting

2008-09-29 Thread Tom Lane
Gauthier, Dave [EMAIL PROTECTED] writes: I'm in the business of writting recursive PL-Pgsql functions. I need to know what happens to the data stream from a select cursor inside of which the recursive call is made. For example Nothing, unless you use explicitly-named cursors and force a

Re: [GENERAL] pl-pgsql, recursion and cursor contexting

2008-09-29 Thread Pavel Stehule
Hello every call of plpgsql function has own result, there are not any shared result, so you need forward result from deeper call to up. http://www.pgsql.cz/index.php/PL/pgSQL_(en)#Recursive_call_of_SRF_functions regards Pavel Stehule 2008/9/29 Gauthier, Dave [EMAIL PROTECTED]: Hi: I'm in

Re: [GENERAL] pl-pgsql, recursion and cursor contexting

2008-09-29 Thread Gauthier, Dave
In all fairness, I believe in Oracle I was declaring explicit cursors (by name) and recursive calls would fail outright with complaints that the cursor was already open. There was (to the best of my knowledge) nothing like the for select... in loop... construct in Oracle's PLSQL language. -dave

[GENERAL] West: Second call for lightning talks

2008-09-29 Thread Joshua Drake
The PostgreSQL Conference: West is being held at Portland State University on October 10th - 12th. The West Coast PostgreSQL conference is currently seeking more Lightning Talks. Lightning talks are an exciting way to get involved in the conference with very little commitment on the speakers end.

[GENERAL] Multiple querys

2008-09-29 Thread x asasaxax
Hi everyone, I have multiple query´s, and i´m trying to optimize my queries by creating a temporary table x(contains the field id_product). The queries that utilize the temp table x, must use the order of the rows at x. My problem: I have a query that do a limit and offset on table x. I

Re: [GENERAL] inserting to a multi-table view

2008-09-29 Thread Richard Broersma
On Sun, Sep 28, 2008 at 9:57 PM, Seb [EMAIL PROTECTED] wrote: Well, I was able to get PostgreSQL Update-able views to work nearly as well as the update-able queries did in Access. Would you mind sharing a sample schema? I'll see what I can do. I did post some sample schema a while back but I

[GENERAL] Can't cast from char to integer...

2008-09-29 Thread Mike Diehl
Hi all. I'm trying to cut data from one table and put it in another table. The problem comes from the fact that the first table has a field that is a char(x) and the destination table needs that data in an integer. For example, I'm trying to do this: insert into data select

[GENERAL] Counting unique rows as an aggregate.

2008-09-29 Thread r_musta
My current solution is to issue a bunch of queries: SELECT make, count(*) FROM table WHERE criteria GROUP BY make ORDER BY count(*) DESC LIMIT 3; make count --+- audi | 50 bmw | 40 vw | 30 SELECT color, count(*) FROM table WHERE criteria GROUP BY color ORDER BY

[GENERAL] database question

2008-09-29 Thread john . crawford
Hi all I have been experiencing some strange behaviour on my postgres DB. I am VERY new to PG so bear with me as what I am going to ask is all probably very basic to you guys. First off over the last couple of weeks we have been seeing in the dir /var/lib/pgsql/data/base/16450 some large file

[GENERAL] Re: Is there a parameter to tell postgresql to not attempt to open an IPv6 socket?

2008-09-29 Thread yann . dubost
On 16 sep, 23:04, [EMAIL PROTECTED] (Andrew Sullivan) wrote: On Tue, Sep 16, 2008 at 04:46:37PM -0400, Reid.Thompson wrote: PostgreSQL appears to all intents to startup fine on the UNIX and IPv4 sockets.  Is there a parameter to tell postgresql tonotattempt to open anIPv6socket? Specify

[GENERAL] Slony Problem

2008-09-29 Thread furlani . francesco
Hi, i have 1 master and one slave db. when in the master i run this sql : update wspet00 set datamf=20080925 where numcar = 7123123123 in the slave slon process i have an error with this log: update only public.wspet00 set datamf='20080925' where ; ERROR: syntax error at or near ; LINE 1:

Re: [GENERAL] problem with custom_variable_classes

2008-09-29 Thread Malcolm Studd
Taras Kopets wrote: now you have to initialize this variable once per session before usage: SELECT set_config('olap.rownum_name', false); Ok, thanks. That has fixed my problem. Malcolm -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

[GENERAL] need help of getting PK after insertRow in JDBC

2008-09-29 Thread Chen, Dongdong (GE Healthcare, consultant)
Hi: I am a software engineer from GE. I am using JDBC to operate PostgreSQL8.3 in Ubuntu8.04. The develop environment is Eclipse3.2 My problem is: There is a PostgreSQL table XX containing 5 fields: AA, BB, CC, DD, EE, AA is primary key and auto-generated type, BB, CC, DD and EE is string

Re: [GENERAL] The planner hates me.

2008-09-29 Thread Hoover, Jeffrey
change t.date2 dates.date to t.date2+0dates.date, this will prevent the query from trying to use the index on date2 because the where clause now references an expression and not the column itself: explain analyze select sum(amount), dates.date as date from transaction t join (select get_dates

Re: [GENERAL] Re: Is there a parameter to tell postgresql to not attempt to open an IPv6 socket?

2008-09-29 Thread Scott Marlowe
On Mon, Sep 29, 2008 at 7:41 AM, [EMAIL PROTECTED] wrote: On 16 sep, 23:04, [EMAIL PROTECTED] (Andrew Sullivan) wrote: On Tue, Sep 16, 2008 at 04:46:37PM -0400, Reid.Thompson wrote: PostgreSQL appears to all intents to startup fine on the UNIX and IPv4 sockets. Is there a parameter to tell

Re: [GENERAL] need help of getting PK after insertRow in JDBC

2008-09-29 Thread Martin Gainty
Good Afternoon add the CLOSE_CURSORS_AT_COMMIT Option to the Statements capabilities e.g. Statement st = db.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE.ResultSet.CLOSE_CURSORS_AT_COMMIT); //then tell the connection handle to commit the DML to the DB

Re: [GENERAL] database question

2008-09-29 Thread Scott Marlowe
On Mon, Sep 29, 2008 at 8:21 AM, [EMAIL PROTECTED] wrote: Hi all I have been experiencing some strange behaviour on my postgres DB. I am VERY new to PG so bear with me as what I am going to ask is all probably very basic to you guys. First off over the last couple of weeks we have been

Re: [GENERAL] Counting unique rows as an aggregate.

2008-09-29 Thread Scott Marlowe
On Mon, Sep 29, 2008 at 12:12 PM, r_musta [EMAIL PROTECTED] wrote: However, this is starting to become too slow (as there are about 10 of these queries), and therefore I need to write an aggregate function which lets me do: SELECT count_unique(make), count_unique(color) from table WHERE

Re: [GENERAL] [HACKERS] PostgreSQL future ideas

2008-09-29 Thread postgres Emanuel CALVO FRANCO
2008/9/27 Douglas McNaught [EMAIL PROTECTED]: On Sat, Sep 27, 2008 at 12:13 PM, Mark Mielke [EMAIL PROTECTED] wrote: If some parts of PostgreSQL are not performance bottlenecks, and they are extremely complicated to write in C, and very easy to write in something else common and simple (I've

Re: [GENERAL] pg_start_backup() takes too long

2008-09-29 Thread Greg Smith
On Mon, 29 Sep 2008, Simon Riggs wrote: I'm surprised that checkpoint smoothing moves slowly even when it has so little to do. ISTM checkpoint completion target should set its write rate according to the thought that if shared_buffers were all dirty it would write them out in

Re: [GENERAL] PostgreSQL Cache

2008-09-29 Thread Greg Smith
On Mon, 29 Sep 2008, Sam Mason wrote: On Mon, Sep 29, 2008 at 02:55:52AM -0400, Greg Smith wrote: 3) sudo echo 3 /proc/sys/vm/drop_caches I'm not sure about the rest, but shouldn't this be: echo 3 | sudo tee /proc/sys/vm/drop_caches I couldn't think of any reason to actually include the

Re: [GENERAL] subquery in FROM must have an alias

2008-09-29 Thread Ashutosh Chauhan
Thanks to Stephan and Hubert for their replies. Using your answers I was able to solve the problem. It turned out that its a natural join that I wanted. Thanks for quick help, Ashutosh On Sun, Sep 28, 2008 at 10:18, Stephan Szabo [EMAIL PROTECTED] wrote: On Sun, 28 Sep 2008, Ashutosh Chauhan

[GENERAL] Sample databases

2008-09-29 Thread Tommy Gibbons
Hi, I would like some pointers as to how to install the dbsamples so that I can use them in Postgres. These .tar.qz files seem to contain *.sql files. These seem to be text files but I do not understand how to import to postgres or if there is some command line command to run. These samples are

Re: [GENERAL] Sample databases

2008-09-29 Thread Raymond O'Donnell
On 29/09/2008 23:03, Tommy Gibbons wrote: I would like some pointers as to how to install the dbsamples so that I can use them in Postgres. These .tar.qz files seem to contain *.sql files. These seem to be text files but I do not understand how to import to postgres or if there is some

Re: [GENERAL] Sample databases

2008-09-29 Thread David Rowley
Tommy Gibbons wrote: I would like some pointers as to how to install the dbsamples so that I can use them in Postgres. These .tar.qz files seem to contain *.sql files. These seem to be text files but I do not understand how to import to postgres or if there is some command line command to run.

Re: [GENERAL] database question

2008-09-29 Thread Greg Smith
On Mon, 29 Sep 2008, [EMAIL PROTECTED] wrote: What are these files and why have they suddenly started to be created and why so large? They're the contents of the database and they get created every time there is another 1GB worth of data in there. Note that the database will use more space

Re: [GENERAL] pg_start_backup() takes too long

2008-09-29 Thread Bruce Momjian
Simon Riggs wrote: If it is a bug then I'd vote for just making it do an immediate checkpoint --- that might cause big I/O load but it's hardly likely to be worse than what will happen when you start taking the subsequent filesystem backup. It was a clear intention for it to *not*

Re: [GENERAL] pg_start_backup() takes too long

2008-09-29 Thread Joshua Drake
On Mon, 29 Sep 2008 19:06:46 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: I agree with Tom; either we make the pg_start_backup() checkpoint immediate or leave the behavior unchanged. Personally I think immediate makes more sense because issuing pg_start_backup() seems like it should

Re: [GENERAL] Can't cast from char to integer...

2008-09-29 Thread Tom Lane
Mike Diehl [EMAIL PROTECTED] writes: For example, I'm trying to do this: insert into data select cast('666' as integer) as block_number, phone as phone_number, name from demo_q; When I run this query, I get: ERROR: column block_number is of type integer but

Re: [GENERAL] database question

2008-09-29 Thread Tom Lane
Scott Marlowe [EMAIL PROTECTED] writes: On Mon, Sep 29, 2008 at 8:21 AM, [EMAIL PROTECTED] wrote: -rw--- 1 postgres root 1073741824 Sep 29 15:15 2613.77 -rw--- 1 postgres root 1073741824 Sep 29 15:15 2613.83 What are these files and why have they suddenly started to be

Re: [GENERAL] Counting unique rows as an aggregate.

2008-09-29 Thread Tom Lane
r_musta [EMAIL PROTECTED] writes: However, this is starting to become too slow (as there are about 10 of these queries), and therefore I need to write an aggregate function which lets me do: SELECT count_unique(make), count_unique(color) from table WHERE criteria; I must be missing

Re: [GENERAL] Can't cast from char to integer...

2008-09-29 Thread Mike Diehl
That fixed it. If you are ever in Albuquerque, NM., let me know. I'll be happy to buy you a beer. Mike. On Monday 29 September 2008 05:26:43 pm Tom Lane wrote: Mike Diehl [EMAIL PROTECTED] writes: For example, I'm trying to do this: insert into data select cast('666' as integer)

[GENERAL] Announcing PostgreSQL Certification Project Job Task Analysis Survey

2008-09-29 Thread Gregory S. Youngblood
Hello! The PostgreSQL Community is working to create a community driven and endorsed PostgreSQL Certification. This effort is spearheaded by the PostgreSQL Certification Project (http://www.postgresqlcertification.org). The primary focus of the project is the development and support of a

Re: [GENERAL] Replication using slony-I

2008-09-29 Thread Abdul Rahman
Thanks a lot for replying! Here is complete information for consideration: In order to perform replication. I am following the steps present in http://people.planetpostgresql.org/dpage/index.php?/archives/51-Setting-up-Slony-I-with-pgAdmin.html and successfully reached to step # 13. I have

Re: [GENERAL] Counting unique rows as an aggregate.

2008-09-29 Thread Richard Broersma
On Mon, Sep 29, 2008 at 4:36 PM, Tom Lane [EMAIL PROTECTED] wrote: SELECT count(distinct make), count(distinct color) from table WHERE criteria; Is this in the SQL spec? I didn't know Agg functions could do this? -- Regards, Richard Broersma Jr. Visit the Los Angeles PostgreSQL Users

Re: [GENERAL] Counting unique rows as an aggregate.

2008-09-29 Thread Klint Gore
Richard Broersma wrote: On Mon, Sep 29, 2008 at 4:36 PM, Tom Lane [EMAIL PROTECTED] wrote: SELECT count(distinct make), count(distinct color) from table WHERE criteria; Is this in the SQL spec? I didn't know Agg functions could do this? Yes. SQL92 6.5 set function specification ::=

[GENERAL] ODBC driver crash

2008-09-29 Thread Craig Ringer
Hi I'm currently encountering an interesting issue with the PostgreSQL ODBC driver on Windows. I'm unlucky enough to have to use MS Access 2007 for a project at the moment, with PostgreSQL providing the storage through ODBC. It all works as well as can be expected from Access, except that the