Re: [GENERAL] index row requires 10040 bytes, maximum size is 8191

2011-09-19 Thread Scott Marlowe
On Sun, Sep 18, 2011 at 11:07 PM, Michael Shepanski michael.shepan...@netpage.com wrote: Craig Ringer writes: Thoughts, folks? Does this matter in practice, since anything you'd want to index will in practice be small enough or a candidate for full-text indexing? Here's my case: the field is

Re: [GENERAL] duplicate sequence, it is possible?

2011-09-19 Thread Alban Hertroys
On 19 Sep 2011, at 2:57, Anibal David Acosta wrote: Hi everyone. I have a table with a PK, this table has a lot of insert per second (100 ~ 150 insert /sec) Sometimes, a get a duplicate key error, but ID is generated from a function (VOLATILE). This function has just one line (select

Re: [GENERAL] Indexes not allowed on (read-only) views: Why?

2011-09-19 Thread Thomas Kellerer
Craig Ringer, 17.09.2011 02:28: On 09/17/2011 05:47 AM, Stefan Keller wrote: A (read-only) view should behave like a table, right? CREATE INDEX t1_idx ON t1 (rem); ERROR: »v1« not a table SQL state: 42809 = Why should'nt it be possible to create indexes on views in PG? It's not so much

[GENERAL] Dblink upgrade from 8.4 to 9.1

2011-09-19 Thread Rueegg Alexander
Hi all! I am upgrading databases from 8.4 to 9.1 using backup/restore. Whilst the restore procedure migrate the module uuid-ossp automatically, the module dblink is not. Executing create extension if not exists dblink from unpackaged on the database fails too! When deleting all dblink

Re: [GENERAL] Dblink upgrade from 8.4 to 9.1

2011-09-19 Thread Rueegg Alexander
Sorry, but I have to correct my first description of the failure. Indeed the uuid-ossp module was not migrated automatically. For some reasons when restoring the database I've chosen to clean before restore. And in this scenario the migration took place. Starting from a clean new db the backup

[GENERAL] Grouping by timestamp, how to return 0 when there's no record

2011-09-19 Thread Koen Van Impe
Hello, I'm trying to write a query that groups records by hour. This works fine but when there are no records for a specific hour the query does not return a result (this seems 'logic') and I'd like it to return '0'. I suspect I should play around with 'interval' or something but I can't get it

Re: [GENERAL] duplicate sequence, it is possible?

2011-09-19 Thread Vincent de Phily
On Monday 19 September 2011 08:19:18 Alban Hertroys wrote: On 19 Sep 2011, at 2:57, Anibal David Acosta wrote: Hi everyone. I have a table with a PK, this table has a lot of insert per second (100 ~ 150 insert /sec) Sometimes, a get a duplicate key error, but ID is generated from a

[GENERAL] Getting TOAST errors

2011-09-19 Thread Tim Uckun
I am occasionally getting this kind of error when attempting a SELECT statement. PGError: ERROR: missing chunk number 0 for toast value 27143 in pg_toast_2619 What does this mean? Is some sort of corruption creeping into the database? Postgres 9.0 linux. -- Sent via pgsql-general mailing

[GENERAL] postgis and pgpool

2011-09-19 Thread Szymon Guz
Hi, do you know about any problems with using pgpool and postgis together? regards Szymon

Re: [GENERAL] Clean way to insert records if they don't exist, update if they do

2011-09-19 Thread Diego Augusto Molina
Hi, first of all, I still haven't tried PG further that 8.4 2011/9/18, Mike Christensen m...@kitchenpc.com: CREATE RULE Pages_Upsert AS ON INSERT TO Pages WHERE EXISTS (SELECT 1 from Pages P where NEW.Url = P.Url) DO INSTEAD UPDATE Pages SET LastCrawled = NOW(), Html = NEW.Html

Re: [GENERAL] Grouping by timestamp, how to return 0 when there's no record

2011-09-19 Thread Alban Hertroys
On 19 September 2011 12:01, Koen Van Impe koen.vani...@belnet.be wrote: Hello, I'm trying to write a query that groups records by hour. This works fine but when there are no records for a specific hour the query does not return a result (this seems 'logic') and I'd like it to return '0'. I

Re: [GENERAL] Grouping by timestamp, how to return 0 when there's no record

2011-09-19 Thread Diego Augusto Molina
Hi, this may be a start: -- This will make our day better :) with base_query (tstmp) as ( select DATE_TRUNC('hour',timestamp) as tstmp FROM record WHERE record.timestamp BETWEEN ( CURRENT_TIMESTAMP + INTERVAL '-7 day') and (CURRENT_TIMESTAMP) -- this I don't

[GENERAL] How to pass array from .pgc to sql function

2011-09-19 Thread Siva Palanisamy
Hi All, I am using embedded Postgres 'C' file to make function calls to the sql. I have a .pgc (a 'C' file with sql statements) and .sql file. I have a pointer array that looks like this: typedef struct { char* displayName; } DisplayName; DisplayName* displayName_list =

[GENERAL] Query performs badly with materialize node

2011-09-19 Thread Ingmar Brouns
Hi, I have a query for which PostgreSQL 9.0.3 and 9.1 rc1 both come up with what seems to be a very bad plan when materialize is enabled. The plan with materialize takes 5 seconds to execute, the plan without 7 ms. Part of the plan with materialization enabled #effectively loop over all rows in

[GENERAL] General guidance if there is an in dadabase solution or should stay as excel vba solution.

2011-09-19 Thread Henry Drexler
I have no problem doing this in excel vba, though as the list grows larger obviously excel has row limits. What is being done: There is a column of data imported into the db - they are just text strings, there are about 80,000 rows of them. The goal is to do a single character elimination to

Re: [GENERAL] General guidance if there is an in dadabase solution or should stay as excel vba solution.

2011-09-19 Thread David Johnston
Look at this module for the actual comparison algorithms (found in Appendix F) fuzzystrmatch Performance would be my only concern but you have that issue either way. With plpgsql you can do most things in the database you could do in VBA. Whether you want to bog the DB down with a

Re: [GENERAL] postgis and pgpool

2011-09-19 Thread Tatsuo Ishii
Hi, do you know about any problems with using pgpool and postgis together? I personaly don't know any case study of pgpool and posgis but I guess: 1) You are using pgpool-II native replication mode 2) Some of postgis functions are doing updates/inserts/deletes then you may have problem

Re: [GENERAL] Getting TOAST errors

2011-09-19 Thread Tom Lane
Tim Uckun timuc...@gmail.com writes: I am occasionally getting this kind of error when attempting a SELECT statement. PGError: ERROR: missing chunk number 0 for toast value 27143 in pg_toast_2619 What does this mean? Is some sort of corruption creeping into the database? Hard to tell.

Re: [GENERAL] General guidance if there is an in dadabase solution or should stay as excel vba solution.

2011-09-19 Thread Henry Drexler
Thanks you that is the kind of suggestion I was looking for - I will look into plpgsql. Yes, there are several optimizations in it - though due to the actual data the first few characters cannot be tested. Some of the actual optimizations are only to reach out to the surrounding 100 rows and to

Re: [GENERAL] How to pass array from .pgc to sql function

2011-09-19 Thread Merlin Moncure
On Mon, Sep 19, 2011 at 8:20 AM, Siva Palanisamy siv...@hcl.com wrote: Hi All, I am using embedded Postgres ‘C’ file to make function calls to the sql. I have a .pgc (a ‘C’ file with sql statements) and .sql file. I have a pointer array that looks like this: typedef struct {  

Re: [GENERAL] Query performs badly with materialize node

2011-09-19 Thread Tom Lane
Ingmar Brouns swi...@gmail.com writes: What I find strange is that there is a conditionless index scan on participates, retrieving all its rows, and then a nested loop over all those rows and a materialize node. Yeah, that indexscan looks pretty odd to me too, but it's likely explained by the

Re: [GENERAL] General guidance if there is an in dadabase solution or should stay as excel vba solution.

2011-09-19 Thread David Johnston
You can probably do this without plpgsql through liberal use of CTEs (WITH) and sub-queries. Also look at arrayed types for saving matches and filtering out already tested pairs. David J. On Sep 19, 2011, at 10:37, Henry Drexler alonup...@gmail.com wrote: Thanks you that is the kind of

Re: [GENERAL] postgis and pgpool

2011-09-19 Thread Szymon Guz
On 19 September 2011 16:17, Tatsuo Ishii is...@postgresql.org wrote: Hi, do you know about any problems with using pgpool and postgis together? I personaly don't know any case study of pgpool and posgis but I guess: 1) You are using pgpool-II native replication mode 2) Some of postgis

[GENERAL] Calculate Vacuum Metrics

2011-09-19 Thread Venkat Balaji
Hello Everyone, I am in the process of scheduling a VACUUM FULL for our production databases where in downtime is extremely critical. Can someone please help me calculate the amount of free space (or free pages) in the Table and Index (even after regular autovacuum or vacuum analyze is

Re: [GENERAL] General guidance if there is an in dadabase solution or should stay as excel vba solution.

2011-09-19 Thread Henry Drexler
excellent - thank you again. On Mon, Sep 19, 2011 at 11:05 AM, David Johnston pol...@yahoo.com wrote: You can probably do this without plpgsql through liberal use of CTEs (WITH) and sub-queries. Also look at arrayed types for saving matches and filtering out already tested pairs. David J.

[GENERAL] Column Privileges: NULL instead of permission denied

2011-09-19 Thread Matthew Hawn
I have a table with privileged data that is restricted using column level permissions. I would like to have single query that returns data from the table. If the user has permission, it should return the data but return NULL if the user does not have permission. I do not want to create

Re: [GENERAL] Column Privileges: NULL instead of permission denied

2011-09-19 Thread Stephen Frost
* Matthew Hawn (matth...@donaanacounty.org) wrote: I have a table with privileged data that is restricted using column level permissions. I would like to have single query that returns data from the table. If the user has permission, it should return the data but return NULL if the user

Re: [GENERAL] Getting TOAST errors

2011-09-19 Thread Tim Uckun
Hard to tell.  We've seen enough reports like that to make it seem like there may be some bug buried there, but no one has provided anything to do any debugging work with.  Can you create a reproducible test case? Not really. I have a nightly process which downloads data and sticks it into a

Re: [GENERAL] Am I best off keeping large chunks of text in a separate table?

2011-09-19 Thread Jerry Sievers
Mike Christensen m...@kitchenpc.com writes: On Sat, Sep 17, 2011 at 6:46 PM, Mike Christensen m...@kitchenpc.com wrote: What would be really cool is if postgresql took values for body that were over a few k and compressed them and stored them out of line in another table.  Luckily for you,

Re: [GENERAL] Getting TOAST errors

2011-09-19 Thread Tom Lane
Tim Uckun timuc...@gmail.com writes: Hard to tell. We've seen enough reports like that to make it seem like there may be some bug buried there, but no one has provided anything to do any debugging work with. Can you create a reproducible test case? Not really. I have a nightly process which

[GENERAL] Pgadmin and foreign tables

2011-09-19 Thread pasman pasmański
Hi. In 9.1 is cool feature - foreign tables. But when create foreign table in pgadmin (file_fdw wrapper), strings in the OPTIONS section ignore setting standard_conforming_strings=on. I don't know if it is a bug in postgres or pgadmin. -- pasman -- Sent via pgsql-general mailing

Re: [GENERAL] Getting TOAST errors

2011-09-19 Thread Tim Uckun
Not really. I have a nightly process which downloads data and sticks it into a text field. Afterwards another process reads that text data and processes it creating rows in another table. The problem occurs in the last step and at seemingly random intervals. For example one time it might

Re: [GENERAL] Getting TOAST errors

2011-09-19 Thread Tom Lane
Tim Uckun timuc...@gmail.com writes: Well, I'm not asking for perfect reproducibility --- a test case that fails even 1% of the time would be great. What exactly do you need? A self-contained test case (code and data) that triggers the error. If it only does so probabilistically, once in

Re: [GENERAL] Getting TOAST errors

2011-09-19 Thread Tim Uckun
A self-contained test case (code and data) that triggers the error. If it only does so probabilistically, once in every-so-many runs, that's fine. I'll see what I can do. Give me a few days. Cheers. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

[GENERAL] Dynamic constraint names in ALTER TABLE

2011-09-19 Thread patrick keshishian
Hi, Where I work, we have a large deployment of software using PostgreSQL database. We have been stuck on version 7.4.16 for a while now. I am about to switch us to a 9.0.x. One problem I'm running into, and I am hoping you can help me with, given the constraints I have to work with, is our

Re: [GENERAL] Dynamic constraint names in ALTER TABLE

2011-09-19 Thread Adrian Klaver
On Monday, September 19, 2011 5:10:45 pm patrick keshishian wrote: Hi, Is there any way the .sql scripts could make use of this query to get the foreign key name from pg_constraint table, regardless of PG version (7.4.x or 9.x)? Use the information schema? As example:

Re: [GENERAL] Dynamic constraint names in ALTER TABLE

2011-09-19 Thread patrick keshishian
On Mon, Sep 19, 2011 at 6:08 PM, Adrian Klaver adrian.kla...@gmail.com wrote: On Monday, September 19, 2011 5:10:45 pm patrick keshishian wrote: Hi, Is there any way the .sql scripts could make use of this query to get the foreign key name from pg_constraint table, regardless of PG version

Re: [GENERAL] Dynamic constraint names in ALTER TABLE

2011-09-19 Thread Ondrej Ivanič
Hi, On 20 September 2011 13:09, patrick keshishian pkesh...@gmail.com wrote: e.g., ALTER TABLE sales DROP CONSTRAINT (SELECT conname FROM pg_constraint JOIN pg_class ON (conrelid=pg_class.oid) WHERE pg_class.relname='sales' AND conkey[1] = 1 AND contype='f') ; You have to build query in

Re: [GENERAL] Dynamic constraint names in ALTER TABLE

2011-09-19 Thread Tom Lane
patrick keshishian pkesh...@gmail.com writes: The question wasn't where does one find the name of the constraint. My example demonstrated that I knew how to get that value. The question, however, is how do you get that in an ALTER TABLE statement? You'd need to construct the ALTER statement as

Re: [GENERAL] Dynamic constraint names in ALTER TABLE

2011-09-19 Thread patrick keshishian
2011/9/19 Ondrej Ivanič ondrej.iva...@gmail.com: Hi, On 20 September 2011 13:09, patrick keshishian pkesh...@gmail.com wrote: e.g., ALTER TABLE sales DROP CONSTRAINT (SELECT conname FROM pg_constraint JOIN pg_class ON (conrelid=pg_class.oid) WHERE pg_class.relname='sales' AND conkey[1] = 1

Re: [GENERAL] Dynamic constraint names in ALTER TABLE

2011-09-19 Thread patrick keshishian
On Mon, Sep 19, 2011 at 8:34 PM, Tom Lane t...@sss.pgh.pa.us wrote: patrick keshishian pkesh...@gmail.com writes: The question wasn't where does one find the name of the constraint. My example demonstrated that I knew how to get that value. The question, however, is how do you get that in an