Re: [GENERAL] How to find avg() of sum()?

2010-04-16 Thread Thomas Kellerer
semi-ambivalent wrote on 16.04.2010 19:57: I have some data fields that I have summed, grouped by a date field. The sums are different. How can I then calculate the average value for those sums? Everything I've tried errors out with something along the lines of using agregates where I can't, or f

[GENERAL] How to find avg() of sum()?

2010-04-16 Thread semi-ambivalent
I have some data fields that I have summed, grouped by a date field. The sums are different. How can I then calculate the average value for those sums? Everything I've tried errors out with something along the lines of using agregates where I can't, or for using multiple values where that is not al

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread Tom Lane
John R Pierce writes: > can someone confirm, the critical files that get customized by > ./configure are > $INCLUDEDIR/pg_config.h > $INCLUDEDIR/server/pg_config.h (apparently identical) > $LIBDIR/pgxs/src/Makefile.global I believe all of the files that get written at the end of c

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread John R Pierce
Greg Smith wrote: I'm not trying to criticize what you're doing, just given you a dose of my own paranoia and preferred risk management approach for this sort of thing. It may not actually be possible to fully follow the unreasonable requirements you've been given and deliver something that w

Re: [GENERAL] Specif postgres version

2010-04-16 Thread Greg Smith
Maurício Ramos wrote: List, we need to run v8.1.11 but can not find the binaries for RedHat Enterprise Linux 5 (CentOs 5). It's unlikely you specifically need 8.1.11; a later 8.1 should work fine. See http://www.postgresql.org/support/versioning for details about what changes between min

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread Greg Smith
John R Pierce wrote: so you're saying that building plugins to work with an existing system is bad? then whats the point of the whole pgxs system and including server headers in a binary release? It's fine if your package has been setup to allow it. I bundle up stuff on RHEL like that all

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread John R Pierce
Tom Lane wrote: Right. If you can get a consistent fileset from Bjorn in a timely fashion, problem solved. exactly. that is my intent. Bjorn replied to my request on hackers last night, and 'is going to look into it' can someone confirm, the critical files that get customized by ./c

[GENERAL] Specif postgres version

2010-04-16 Thread Maurício Ramos
List, we need to run v8.1.11 but can not find the binaries for RedHat Enterprise Linux 5 (CentOs 5). The sources are at ftp://ftp-archives.postgresql.org/pub/source/ but we rather install it from the binaries. Can you point to someplace we can get them? Already tried rpmfind.net, http://rpm.pbo

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread Tom Lane
John R Pierce writes: > Greg Smith wrote: >> If I were John, I'd be preparing to dig in on providing a complete >> source build with PL/Java installed. It looks like the idea that >> they'll be able to take their *existing* Solaris binaries and just add >> Java on top of them is going to end u

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread John R Pierce
Greg Smith wrote: If I were John, I'd be preparing to dig in on providing a complete source build with PL/Java installed. It looks like the idea that they'll be able to take their *existing* Solaris binaries and just add Java on top of them is going to end up more risky than doing that. The

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Merlin Moncure
On Fri, Apr 16, 2010 at 5:41 AM, Peter Bex wrote: > Hi all, > > I have a table with three columns: one integer and two doubles. > There are two indexes defined (one on the integer and one on one > of the doubles).  This table stores 70 records, which take up > 30 Mb according to pg_relation_si

Re: [GENERAL] readline library not found

2010-04-16 Thread Scott Mead
On Fri, Apr 16, 2010 at 10:36 AM, Tom Lane wrote: > Scott Mead writes: > > Huh? This I find hard to believe. Whenever I've had problems with > readline > > it was actually libtermcap that was giving me a headache. Are you sure > that > > there's nothing in there that's pointing you to your lib

Re: [GENERAL] partitioned lookup table?

2010-04-16 Thread Vick Khera
On Fri, Apr 16, 2010 at 10:48 AM, Andreas Kretschmer wrote: > is it possible to partitionate a lookup-table? What i mean is: > > test=# create table foo(i int primary key); > NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for > table "foo" > CREATE TABLE > test=*# creat

[GENERAL] partitioned lookup table?

2010-04-16 Thread Andreas Kretschmer
Hi @all, A question, found in the german PG-Forum: is it possible to partitionate a lookup-table? What i mean is: test=# create table foo(i int primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo" CREATE TABLE test=*# create table bla ( i int r

Re: [GENERAL] readline library not found

2010-04-16 Thread Tom Lane
Scott Mead writes: > Huh? This I find hard to believe. Whenever I've had problems with readline > it was actually libtermcap that was giving me a headache. Are you sure that > there's nothing in there that's pointing you to your libtermcap being > 'wonky' I think he's confusing what happen

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Tom Lane
Richard Huxton writes: > On 16/04/10 10:41, Peter Bex wrote: >> Is there a way to reduce the per-tuple storage overhead? > Short answer - no. About the only thing you could really do is rethink the table layout. If you can put more data per row, then the fractional overhead for tuple headers nat

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread Greg Smith
Tom Lane wrote: John R Pierce writes: I need to build pl/java to run against the binary release of Postgres for largely political/corporate reasons. this is to be installable as an addon to an existing large/complex database deployment. Well, in that case you'd better pester whoever

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread Tom Lane
John R Pierce writes: > Using the include files provided with the 64bit version is giving me the > wrong Float8 type, yes, as they are the 32bit include files. > I need to build pl/java to run against the binary release of Postgres > for largely political/corporate reasons. this is to be insta

Re: [GENERAL] Complete row is fetched ?

2010-04-16 Thread Greg Smith
Craig Ringer wrote: I sometimes wonder if being able to store visibility info externally to a tuple in a separate file - in condensed fixed-width form - would be useful for performance, especially where the table has quite wide tuples with types that are big-ish but not TOASTable. Sure, it'd be

Re: [GENERAL] Complete row is fetched ?

2010-04-16 Thread Craig Ringer
On 16/04/10 16:23, A. Kretschmer wrote: In response to Raymond O'Donnell : On a related note, what happens when you do something like this? - select count(*) Does any data actually get read? No, it check's only the visibility for each record -> seq-scan. ... though in practice wit

Re: [GENERAL] How to get whether user has ALL permissions on table?

2010-04-16 Thread dipti shah
Okay I got to know from http://www.postgresql.org/docs/8.4/interactive/functions-info.html that the has_table_privilege returns true if any of the listed privilege is held. Then how can I find whether user has all the specified permissions or not? >From http://www.postgresql.org/docs/8.4/interact

Re: [GENERAL] readline library not found

2010-04-16 Thread Scott Mead
On Thu, Apr 15, 2010 at 10:22 PM, zhong ming wu wrote: > Dear List > > I need to build a postgres on a linux machine that I don't have root > access. > > I built readline from source and installed it with prefix of /home/me/local > > readline library are in /home/me/local/lib and headers files ar

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Richard Huxton
On 16/04/10 10:41, Peter Bex wrote: Hi all, I have a table with three columns: one integer and two doubles. There are two indexes defined (one on the integer and one on one of the doubles). This table stores 70 records, which take up 30 Mb according to pg_relation_size(), and the total rela

Re: [GENERAL] Showing debug messages in my C function

2010-04-16 Thread Jorge Arevalo
Sorry, a mistake: > Ok, I've tested the simple example of a SRF from > http://www.postgresql.org/docs/8.4/interactive/xfunc-c.html (section > 34.9.10) and the application crash in the same way. When tries to > access SRF_IS_FIRSTCALL(), or any other PostgreSQL macro like > SRF_FIRST_CALL_INIT(), P

Re: [GENERAL] How to get whether user has ALL permissions on table?

2010-04-16 Thread dipti shah
It is strange. If I remove both SELECT and INSERT then works fine but if either of is there then it doesn't work. techdb=> SELECT has_table_privilege('user1', 'techdb.techtable', 'UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'); has_table_privilege - t (1 row) techdb=> Regard

Re: [GENERAL] How to get whether user has ALL permissions on table?

2010-04-16 Thread dipti shah
Hey Kretschemer, the has_table_privilege function returns true in following situation as well which is wrong. techdb=> select pc.relname, pc.relacl from pg_class pc, pg_namespace pn where pc.relnamespace=pn.oid and pn.nspname='techdb' and pc.relname='techtable'; relname|

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Szymon Guz
2010/4/16 Peter Bex > On Fri, Apr 16, 2010 at 11:59:38AM +0200, Szymon Guz wrote: > > File pages are not fully filled from the start as that could result in > bad > > performance of queries later. > > The manual page you linked to says something else: > "The fillfactor for a table is a percentage

Re: [GENERAL] tar error, in pg_start_backup()

2010-04-16 Thread Magnus Hagander
. On Fri, Apr 16, 2010 at 11:55 AM, raghavendra t wrote: > Hi All, > > For some setups reason, i started taking Hot backup. In this course I have > first issued pg_start_backup('backup') and went to the data directory for > backing up in OS format using the command "tar -cf backup.tar  /data" .

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Peter Bex
On Fri, Apr 16, 2010 at 11:59:38AM +0200, Szymon Guz wrote: > File pages are not fully filled from the start as that could result in bad > performance of queries later. The manual page you linked to says something else: "The fillfactor for a table is a percentage between 10 and 100. 100 (complete

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Szymon Guz
2010/4/16 Peter Bex > Hi all, > > I have a table with three columns: one integer and two doubles. > There are two indexes defined (one on the integer and one on one > of the doubles). This table stores 70 records, which take up > 30 Mb according to pg_relation_size(), and the total relation

[GENERAL] tar error, in pg_start_backup()

2010-04-16 Thread raghavendra t
Hi All, For some setups reason, i started taking Hot backup. In this course I have first issued pg_start_backup('backup') and went to the data directory for backing up in OS format using the command "tar -cf backup.tar /data" . When i issued this command , tar was generating some errors as show b

[GENERAL] Tuple storage overhead

2010-04-16 Thread Peter Bex
Hi all, I have a table with three columns: one integer and two doubles. There are two indexes defined (one on the integer and one on one of the doubles). This table stores 70 records, which take up 30 Mb according to pg_relation_size(), and the total relation size is 66 Mb. I expected the di

Re: [GENERAL] VACUUM process running for a long time

2010-04-16 Thread Scott Marlowe
On Wed, Apr 14, 2010 at 8:01 AM, Jan Krcmar wrote: > hi > > i've got the database (about 300G) and it's still growing. > > i am inserting new data (about 2G/day) into the database (there is > only one table there) and i'm also deleting about 2G/day (data older > than month). > > the documentation

Re: [GENERAL] VACUUM process running for a long time

2010-04-16 Thread Adrian von Bidder
On Thursday 15 April 2010 15.56:20 Jan Krcmar wrote: > i'm doing one big insert per day, and one big delete per day > > anyway, i've found, this article > http://www.postgresql.org/docs/8.4/interactive/ddl-partitioning.html > > could the partitioning be helpfull for this situation? Yes, I'm quit

Re: [GENERAL] Complete row is fetched ?

2010-04-16 Thread A. Kretschmer
In response to Raymond O'Donnell : > On a related note, what happens when you do something like this? - > > select count(*) > > Does any data actually get read? No, it check's only the visibility for each record -> seq-scan. > > Is there any difference internally to saying "count(1)" in

Re: [GENERAL] Complete row is fetched ?

2010-04-16 Thread Raymond O'Donnell
On 16/04/2010 07:11, John R Pierce wrote: > Satish Burnwal (sburnwal) wrote: >> I have a ques - say I have a table that has 10 columns. But in a simple >> select query from that table, I use just 3 columns. I want to know >> whether even for fetching 3 columns, read happens for all the 10 columns >

Re: [GENERAL] Complete row is fetched ?

2010-04-16 Thread Yeb Havinga
A. Kretschmer wrote: In response to Satish Burnwal (sburnwal) : I have a ques - say I have a table that has 10 columns. But in a simple select query from that table, I use just 3 columns. I want to know whether even for fetching 3 columns, read happens for all the 10 columns and out of that t