Re: [GENERAL] PGSQL or other DB?

2009-02-01 Thread Erik Jones
On Jan 31, 2009, at 9:36 AM, Scott Marlowe wrote: On Sat, Jan 31, 2009 at 2:13 AM, Erik Jones wrote: On Jan 30, 2009, at 11:37 AM, durumdara wrote: - I can add/modify a table, or a field to a table without "full lock" on the table (like DBISAM restructure). Like in FireBird, where the

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Greg Smith
On Sat, 31 Jan 2009, Adam Rich wrote: - lack of queryable high-water marks useful for tuning What specific things would you consider important to track a high-water mark for that aren't already there? -- * Greg Smith gsm...@gregsmith.com http://www.gregsmith.com Baltimore, MD -- Sent via p

Re: [GENERAL] Full text index not being used

2009-02-01 Thread Teodor Sigaev
I tried to create an index including all of the fields I query on to see if that would work, but I get an error the the index row is too large: => create index master_index on source_listings(geo_lat, geo_lon, price, bedrooms, region, city, listing_type, to_tsvector('english', full_listing), p

Re: [GENERAL] Pet Peeves?

2009-02-01 Thread Greg Smith
On Sat, 31 Jan 2009, Reece Hart wrote: * lack of auto-tuning or tuning tools (or perhaps my lack of awareness of them?) http://pgfoundry.org/projects/pgtune/ aims to provide a tool for 8.4, that's working but still needs documentation and some loose ends cleaned up. Its suggestions aren't g

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Andreas Wenk
Scott Marlowe schrieb: On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma wrote: On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk wrote: Why does this not work: postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; ERROR: type "serial" does not exist serial is really just "short-hand" fo

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Andreas Wenk
Richard Broersma schrieb: On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk wrote: Why does this not work: postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; ERROR: type "serial" does not exist serial is really just "short-hand" for making an integer column use default incrementing fun

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Adam Rich
> On Saturday 31 January 2009 8:47:28 pm Adam Rich wrote: > > On Thu, 29 Jan 2009 13:16:17 + > > > > Gregory Stark wrote: > > > So, what do people say? Is Postgres perfect in your world or does > it > > > do some things which rub you the wrong way? > > > > I see all the major ones have alrea

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Andreas Wenk
Jasen Betts schrieb: On 2009-01-31, Andreas Wenk wrote: Hi List, I have a short question to psql. Why does this not work: postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; ERROR: type "serial" does not exist but this: postgres=# ALTER TABLE tab1 DROP COLUMN nr; ALTER TABLE postgres

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Adrian Klaver
On Saturday 31 January 2009 8:47:28 pm Adam Rich wrote: > On Thu, 29 Jan 2009 13:16:17 + > > Gregory Stark wrote: > > So, what do people say? Is Postgres perfect in your world or does it > > do some things which rub you the wrong way? > > I see all the major ones have already been mentioned, s

Re: [GENERAL] urgent request : PSQLException: FATAL: could not open relation XXX: No such file or directory

2009-02-01 Thread Adrian Klaver
On Sunday 01 February 2009 12:38:21 am Preethi Valsalan wrote: > Hi > > I am working on an application where Postgresql is used as the db. I have a > trigger and three functions running on that trigger. The data in db is > updated by a thread each 1 minute continuously. > > I kept my application r

Re: [GENERAL] Pet Peeves?

2009-02-01 Thread Octavio Alvarez
On Sat, 2009-01-31 at 15:54 -0800, Octavio Alvarez wrote: > On Sat, 2009-01-31 at 23:36 +, Gregory Stark wrote: > > Octavio Alvarez writes: > > > > What about a WHERE clause like > > > > WHERE P1 > P2 > > You could either: > > (1) do "FROM grades AS g1 INNER JOIN grades AS g2 ON g1.P1 > g2

Re: [GENERAL] Indices types, what to use. Btree, Hash, Gin or Gist

2009-02-01 Thread Mohamed
Yeah, but reply-all will still send private messages :O .. its strange because this is the only mailing list that gmail behaves like this with.. it must have to with how postgre sends messages out. But anyways. Back to topic :) Yeah, I think that a partial index is something that would be smart. T

Re: [GENERAL] Need some help converting MS SQL stored proc to postgres function

2009-02-01 Thread Mike Christensen
Thanks! You might be onto something, I see two potential problems though: 1) If the nested select returns no rows (no one has rated the recipe before), it would try to set the value to null. The Rating column is non-nullable which is the way I want it. 2) I'm not exactly 100% sure on this,

Re: [GENERAL] Indices types, what to use. Btree, Hash, Gin or Gist

2009-02-01 Thread Gregory Stark
Mohamed writes: > My Gmail(bloody gmail!) has been auto-replying to the last messager (Scott) > so I think we have been having a private discussion on this topic. There is an option in the Google Labs tab to make "Reply All" the default button -- of course then there's always a chance you'll ma

Re: [GENERAL] Full text index not being used

2009-02-01 Thread Oleg Bartunov
Alex, what text you're indexing ? I don't believe you have meaningful very long words ( > 2047 characters). Do you really need multicolumn index ? I'd recommend to separate problem - create column fts for tsvector('english',full_listing), create index on it and try full-text query. The way you'

Re: [GENERAL] Full text index not being used, even though it is in the plan

2009-02-01 Thread Gregory Stark
Alex Neth writes: > I am trying to use a full text index, but it seems to be reindexing on every > query. > > The query plan looks fine, but the queries take extremely long (hours even). > I think it is reindexing because it is notifying me that certain long "words" > won't be indexed as you c

Re: [GENERAL] Indices types, what to use. Btree, Hash, Gin or Gist

2009-02-01 Thread Martijn van Oosterhout
On Sun, Feb 01, 2009 at 06:00:02PM +0100, Mohamed wrote: > When it comes to the boolean, the content is about 70-30%. I find it strange > though that an index on a 50-50% isn't that useful. With an index the DB can > skip 50% of the table so it should be useful, but perhaps the intersection > of se

Re: [GENERAL] Indices types, what to use. Btree, Hash, Gin or Gist

2009-02-01 Thread Mohamed
My Gmail(bloody gmail!) has been auto-replying to the last messager (Scott) so I think we have been having a private discussion on this topic. Here is an update on our discussion. ME : When it comes to the boolean, the content is about 70-30%. I find it strange though that an index on a 50-50% isn

Re: [GENERAL] PGSQL or other DB?

2009-02-01 Thread Scott Marlowe
On Sun, Feb 1, 2009 at 7:33 AM, Russ Brown wrote: > Scott Marlowe wrote: >> >> On Sat, Jan 31, 2009 at 2:13 AM, Erik Jones wrote: >>> >>> On Jan 30, 2009, at 11:37 AM, durumdara wrote: >>> Looking into Firebird I couldn't >>> find how it handles (or doesn't) that at all I but I did see that it w

Re: [GENERAL] Full text index not being used

2009-02-01 Thread Alex
So this seems to be because the result size is too big. I still don't know why it is looping through every record and printing a warning, but adding a LIMIT makes the queries complete in a reasonable time (although not all that fast). However I need to sort and also have many other facets that ma

[GENERAL] Full text index not being used, even though it is in the plan

2009-02-01 Thread Alex Neth
I am trying to use a full text index, but it seems to be reindexing on every query. The query plan looks fine, but the queries take extremely long (hours even). I think it is reindexing because it is notifying me that certain long "words" won't be indexed as you can see below, which is w

Re: [GENERAL] PGSQL or other DB?

2009-02-01 Thread Russ Brown
Scott Marlowe wrote: On Sat, Jan 31, 2009 at 2:13 AM, Erik Jones wrote: On Jan 30, 2009, at 11:37 AM, durumdara wrote: - I can add/modify a table, or a field to a table without "full lock" on the table (like DBISAM restructure). Like in FireBird, where the "add field" change only the table

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Osvaldo Kussama
2009/2/1 Scott Marlowe : > On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma > wrote: >> On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk >> wrote: >> >>> Why does this not work: >>> >>> postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; >>> ERROR: type "serial" does not exist >> >> serial is

Re: [GENERAL] How to catch the id in a INSERT INTO ... RETURNING function?

2009-02-01 Thread Gerhard Heift
On Sun, Feb 01, 2009 at 11:37:52AM +0100, A B wrote: > Hi. > I have a table foo(id serial primary key, b int); and I want an insert > function > > create or replace function insert_to_foo(bvalue integer) returns integer as > declare >newindex integer; > begin > ... insert into foo (a,b)

Resp.: [GENERAL] How to catch the id in a INSERT INTO ... RETURNING function?

2009-02-01 Thread Osvaldo Kussama
2009/2/1, A B : > Hi. > I have a table foo(id serial primary key, b int); and I want an insert > function > > create or replace function insert_to_foo(bvalue integer) returns integer as > declare >newindex integer; > begin > ... insert into foo (a,b) values (default,bvalue) returning id >

[GENERAL] Warm Standby question

2009-02-01 Thread Thomas Kellerer
Hi, (Note: I have never used log shipping before, I'm just interested in the concepts, so I'm might be missing a very important aspect) I was reading the blog entry about HA and warm standby: http://scale-out-blog.blogspot.com/2009/02/simple-ha-with-postgresql-point-in-time.html The image tha

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Thomas Kellerer
Grzegorz Jaśkiewicz wrote on 01.02.2009 13:13: probably enabling triggers for views would be the only way to do it, me thinks. I don't know how oracle guys got around it. Oracle *does* have (INSTEAD OF) triggers on views. (and "simple" views are automatically updateable anyway) Regards Thomas

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Dean Rasheed
> rules are very very very very rarely useful. I wouldn't say that. There are many use cases where rules are just the thing. Plus they have an added performance benefit when dealing with multiple rows in a single statement. > yes, in general - I wouldn't mind to see postgresql implement fully

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Grzegorz Jaśkiewicz
rules are very very very very rarely useful. yes, in general - I wouldn't mind to see postgresql implement fully updatable views. There's being a very long discussion about that on -hackers, and patch was even in cvs-head for a bit, but got dropped. probably enabling triggers for views would be the

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Dean Rasheed
>> - no ability to define triggers on views >> > > maybe because you can't perform insert/delete/update on them ? > Actually I was thinking the value of triggers on views is precisely to allow you to perform insert/delete/update on them. I know you can do this with rules, but there are cases

Re: [GENERAL] Need some help converting MS SQL stored proc to postgres function

2009-02-01 Thread Tino Wildenhain
Hi, Mike Christensen wrote: Hi guys, I'm in the process of migrating my database from MS SQL 2005 to PostgreSQL and there's one final stored proc that's giving me some problems.. Perhaps someone can give me some help? Here's the sproc: SELECT RecipeId, Avg(Rating) as Rating INTO #ratin

R: [GENERAL] complex custom aggregate function

2009-02-01 Thread Paolo Saudin
>-Messaggio originale- >Da: pgsql-general-ow...@postgresql.org >[mailto:pgsql-general-ow...@postgresql.org] Per conto di Scara Maccai >Inviato: venerdì 30 gennaio 2009 9.36 >A: pgsql-general@postgresql.org >Oggetto: [GENERAL] complex custom aggregate function > >Hi all, > >I have a table l

[GENERAL] Need some help converting MS SQL stored proc to postgres function

2009-02-01 Thread Mike Christensen
Hi guys, I'm in the process of migrating my database from MS SQL 2005 to PostgreSQL and there's one final stored proc that's giving me some problems.. Perhaps someone can give me some help? Here's the sproc: SELECT RecipeId, Avg(Rating) as Rating INTO #ratings FROM RecipeRatings GROUP B

Re: [GENERAL] Need some help converting MS SQL stored proc to postgres function

2009-02-01 Thread Ivan Sergio Borgonovo
On Sun, 01 Feb 2009 00:10:52 -0800 Mike Christensen wrote: > Figured out one way to do it, perhaps I can get some feedback on > if this is the best way.. Thanks! > > CREATE TEMP TABLE temp_ratings > ( > RecipeId uuid, > Rating smallint, > CONSTRAINT id_pk PRIMARY KEY (RecipeId) > ); > >

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Grzegorz Jaśkiewicz
On Sun, Feb 1, 2009 at 10:20 AM, Dean Rasheed wrote: > - no ability to define triggers on views > maybe because you can't perform insert/delete/update on them ? -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.post

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Grzegorz Jaśkiewicz
all you have to really do is: create sequence foo_bar_new_column_tralala_seq; ALTER TABLE foo_bar ADD COLUMN tralala int NOT NULL DEFAULT nextval('foo_bar_new_column_tralala_seq'); That's all there's to it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] Serial Jumping

2009-02-01 Thread Jasen Betts
On 2009-01-27, db.subscripti...@shepherdhill.biz wrote: > Hi, > > I have a table with BIG SERIAL field as Primary KEY. During high load, > entries in the BIG SERIAL field are jumped. One could see a row with > 1367 and expecting the next INSERT to be 1368, one would end up > getting 1369. > > Ple

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Dean Rasheed
The only one I can see that hasn't already been mentioned - no ability to define triggers on views Dean. _ Windows Live Messenger just got better .Video display pics, contact updates & more. http://www.download.live.com/messenge

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Scott Marlowe
On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma wrote: > On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk > wrote: > >> Why does this not work: >> >> postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; >> ERROR: type "serial" does not exist > > serial is really just "short-hand" for making a

[GENERAL] How to catch the id in a INSERT INTO ... RETURNING function?

2009-02-01 Thread A B
Hi. I have a table foo(id serial primary key, b int); and I want an insert function create or replace function insert_to_foo(bvalue integer) returns integer as declare newindex integer; begin ... insert into foo (a,b) values (default,bvalue) returning id < THIS LINE -- do

[GENERAL] urgent request : PSQLException: FATAL: could not open relation XXX: No such file or directory

2009-02-01 Thread Preethi Valsalan
Hi I am working on an application where Postgresql is used as the db. I have a trigger and three functions running on that trigger. The data in db is updated by a thread each 1 minute continuously. I kept my application running for 2 days and on runtime Postgres stopped running. But when I r

Re: [GENERAL] Need some help converting MS SQL stored proc to postgres function

2009-02-01 Thread Mike Christensen
Figured out one way to do it, perhaps I can get some feedback on if this is the best way.. Thanks! CREATE TEMP TABLE temp_ratings ( RecipeId uuid, Rating smallint, CONSTRAINT id_pk PRIMARY KEY (RecipeId) ); INSERT INTO temp_ratings(RecipeId, Rating) SELECT RecipeId, Avg(Rating) as Rating F