[GENERAL] Complete row is fetched ?

2010-04-16 Thread 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 the required 3 columns are returned ? ie Does the complete row with

Re: [GENERAL] Complete row is fetched ?

2010-04-16 Thread John R Pierce
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 and out of that the required 3 columns are returned

Re: [GENERAL] Complete row is fetched ?

2010-04-16 Thread A. Kretschmer
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 the required 3 columns

[GENERAL] modification time transaction synchronisation problem

2010-04-16 Thread Ostrovsky Eugene
Hi. I need to export data from the database to external file. The difficulty is that only data modified or added since previous export should be written to the file. I consider adding "modification_time" timestamp field to all the tables that should be exported. Then I can set this field to

Re: [GENERAL] optimalisation with EXCEPT clause

2010-04-16 Thread Kincel, Martin
Thank you for the answer Grzegorz. if you have a primary key on the table, and you should, you might get better performance using LEFT JOIN. Well as far as I know, the result of such JOIN is a cartezian product, which is not exactly what I need. I need the same structure as table 'data' has.

Re: [GENERAL] readline library not found

2010-04-16 Thread Greg Smith
zhong ming wu wrote: After explicitly specfying these paths with --with-libs and with-includes postgres configure is still choking on readline. Doing this is painful, but one hack you can try is pointing: export LD_LIBRARY_PATH=/home/me/local/lib I've used that combined with setting

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

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 and

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) instead?

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 quite

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 honza...@gmail.com 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

[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

[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

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Szymon Guz
2010/4/16 Peter Bex peter@xs4all.nl 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

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] tar error, in pg_start_backup()

2010-04-16 Thread Magnus Hagander
. On Fri, Apr 16, 2010 at 11:55 AM, raghavendra t raagavendra@gmail.com 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

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Szymon Guz
2010/4/16 Peter Bex peter@xs4all.nl 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

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] 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=

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(),

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

Re: [GENERAL] readline library not found

2010-04-16 Thread Scott Mead
On Thu, Apr 15, 2010 at 10:22 PM, zhong ming wu mr.z.m...@gmail.com 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

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

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

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

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread Tom Lane
John R Pierce pie...@hogranch.com 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.

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread Greg Smith
Tom Lane wrote: John R Pierce pie...@hogranch.com 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

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Tom Lane
Richard Huxton d...@archonet.com 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

Re: [GENERAL] readline library not found

2010-04-16 Thread Tom Lane
Scott Mead scott.li...@enterprisedb.com 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

[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

Re: [GENERAL] partitioned lookup table?

2010-04-16 Thread Vick Khera
On Fri, Apr 16, 2010 at 10:48 AM, Andreas Kretschmer akretsch...@spamfence.net 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

Re: [GENERAL] readline library not found

2010-04-16 Thread Scott Mead
On Fri, Apr 16, 2010 at 10:36 AM, Tom Lane t...@sss.pgh.pa.us wrote: Scott Mead scott.li...@enterprisedb.com 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

Re: [GENERAL] Tuple storage overhead

2010-04-16 Thread Merlin Moncure
On Fri, Apr 16, 2010 at 5:41 AM, Peter Bex peter@xs4all.nl 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

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] Int64GetDatum

2010-04-16 Thread Tom Lane
John R Pierce pie...@hogranch.com 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

[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,

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

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] 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

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

Re: [GENERAL] Int64GetDatum

2010-04-16 Thread Tom Lane
John R Pierce pie...@hogranch.com 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

[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

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