Re: [GENERAL] could not open process token: error code 5

2009-10-14 Thread el dorado
Hello. I had such an error but rather long ago. Unfortunately I don't remember all the details but you could try to do the followig: - check if the directory 'data' has read/write rights for your OS account (account under which you try to start postgres). - check if your OS account has the right

Re: [GENERAL] PG 8.4 and pg_autovacuum functionality

2009-10-14 Thread Alvaro Herrera
Marcelo wrote: > Hello, > > Since pg_autovacuum no longer exits on PG 8.4 and it seems that one > now needs to provide the storage parameters during CREATE TABLE or > later on with an ALTER TABLE. > Will that ALTER TABLE block anything going on that table until it's > finished ? I assume not since

[GENERAL] SFPUG: Video from "Statistics and Postgres -- How the Planner Sees Your Data" Now on Vimeo

2009-10-14 Thread Christophe Pettus
Hi, The video from "Statistics and Postgres — How the Planner Sees Your Data," the September 8, 2009 meeting of the SFPUG, is now available on Vimeo: http://vimeo.com/7051082 -- -- Christophe Pettus x...@thebuild.com -- Sent via pgsql-general mailing list (pgsql-general@postgre

Re: [GENERAL] Query to find contiguous ranges on a column

2009-10-14 Thread Peter Hunsberger
On Wed, Oct 14, 2009 at 4:50 PM, Tim Landscheidt wrote: > Peter Hunsberger wrote: > > After some tests with a data set of 7983 rows (and 1638 ran- > ges): Don't! :-) The recursive solution seems to be more > than double as slow as the iterative. I'll take it to -per- > formance. > Interesting,

[GENERAL] how to Export ALL plpgsql functions/triggers to file

2009-10-14 Thread Naoko Reeves
Hi, Could you tell me how to Export ALL plpgsql functions/triggers to file? Thank you

Re: [GENERAL] Query to find contiguous ranges on a column

2009-10-14 Thread Tim Landscheidt
Peter Hunsberger wrote: > [...] >> or a recursive query (which I always find very hard to com- >> prehend): >> | WITH RECURSIVE RecCols (LeftBoundary, Value) AS >> |   (SELECT col, col FROM t WHERE (col - 1) NOT IN (SELECT col FROM t) >> |    UNION ALL SELECT p.LeftBoundary, c.col FROM RecCols A

Re: [GENERAL] could not open process token: error code 5

2009-10-14 Thread Adrian Klaver
On Wednesday 14 October 2009 6:42:39 am Andale wrote: > Hi > > We have an Postgresql 8.2.5 installation on a Windows server 2003 that have > worked perfectly for our Mediawiki until we tried to update to 8.4. Before > the update we took a backup, stopped the service and took a copy of the > entire

Re: [GENERAL] Partitioned table question

2009-10-14 Thread Alan Hodgson
On Wednesday 14 October 2009, Reid Thompson wrote: > So we know have data in ~30 partitioned tables. > Our requirements now necessitate adding some columns to all these tables > ( done ) which will get populated via batch sql for the older tables and > by normal processing as we move forward. > >

Re: [GENERAL] Partitioned table question

2009-10-14 Thread Reid Thompson
So we know have data in ~30 partitioned tables. Our requirements now necessitate adding some columns to all these tables ( done ) which will get populated via batch sql for the older tables and by normal processing as we move forward. The batch update is going to result in dead tuples in the older

Re: [GENERAL] Cannot start the postgres service

2009-10-14 Thread Alvaro Herrera
Mitesh51 wrote: > I had 2 approach in my mind...to sync up transaction log files with specific > full backup > > 1) to keep only time relavent files in pg_xlog dir and move other files to > archive dir with code which is not a good idea as u suggest Postgres is prepared to (and assumes it can) r

Re: [GENERAL] How ad an increasing index to a query result?

2009-10-14 Thread Chris Spotts
> > SELECT a, nextval('c') as b > FROM table1 > ORDER BY a DESC LIMIT 5; > > I.e., I want to pick the 5 largest entries from table1 and show them > alongside a new index column that tells the position of the entry. For > example: > > a | b > > 82 | 5 > 79 | 4 > 34 | 3 > 12 | 2 > 11 |

Re: [GENERAL] How ad an increasing index to a query result?

2009-10-14 Thread Andrew Bailey
I found an article that should help you with the answer: http://explainextended.com/2009/05/05/postgresql-row-numbers/ ROWNUM is a very useful pseudocolumn in Oracle that returns the position of each row in a final dataset. Upcoming PostgreSQL 8.4 will have this pseudocolumn, but as for now will

Re: [GENERAL] 3d Vector Types and operators

2009-10-14 Thread Sam Mason
On Wed, Oct 14, 2009 at 12:04:26PM -0500, Andrew Bailey wrote: > I cant find in the documentation support for a 3 dimensional vector, > I have only seen the array type, I am interested in doing vector dot > products and vector cross products, also summing vectors and > multiplying by a scalar quant

[GENERAL] How ad an increasing index to a query result?

2009-10-14 Thread Josip
Hello, Could somebody please try to help me with this problem? So, let’s say that I have the query: CREATE SEQUENCE c START 1; SELECT a, nextval('c') as b FROM table1 ORDER BY a DESC LIMIT 5; I.e., I want to pick the 5 largest entries from table1 and show them alongside a new index column that

[GENERAL] 3d Vector Types and operators

2009-10-14 Thread Andrew Bailey
Hi, I cant find in the documentation support for a 3 dimensional vector, I have only seen the array type, I am interested in doing vector dot products and vector cross products, also summing vectors and multiplying by a scalar quantity select array[1,2,3]+array[2,4,5]; select 2*array[1,2,3]; The

Re: [GENERAL] Query to find contiguous ranges on a column

2009-10-14 Thread Peter Hunsberger
On Tue, Oct 13, 2009 at 5:12 PM, Tim Landscheidt wrote: > Peter Hunsberger wrote: > > You can either use a PL/pgSQL function ("SETOF TEXT" just > for the convenience of the example): That works well, takes about 20 seconds to do the 6M+ rows > > or a recursive query (which I always find very h

Re: [GENERAL] What does "INSERT 0 1" mean?

2009-10-14 Thread Terry Lee Tucker
On Wednesday 14 October 2009 11:05, [.::MDT::.] wrote: > Hi, > I can't find what does > INSERT 0 1 > mean. > > "1" stands for the number of the records added to the table, as far as I > understood, but what about the "0"? > > Thank you very much. > -- > View this message in context: > http://www.na

Re: [GENERAL] What does "INSERT 0 1" mean?

2009-10-14 Thread Raymond O'Donnell
On 14/10/2009 16:05, [.::MDT::.] wrote: > Hi, > I can't find what does > INSERT 0 1 > mean. > > "1" stands for the number of the records added to the table, as far as I > understood, but what about the "0"? It stands for the OID of the row that was inserted, if the table was created to use them (

[GENERAL] What does "INSERT 0 1" mean?

2009-10-14 Thread [.::MDT::.]
Hi, I can't find what does INSERT 0 1 mean. "1" stands for the number of the records added to the table, as far as I understood, but what about the "0"? Thank you very much. -- View this message in context: http://www.nabble.com/What-does-%22INSERT-0-1%22-mean--tp25892901p25892901.html Sent fr

[GENERAL] could not open process token: error code 5

2009-10-14 Thread Andale
Hi We have an Postgresql 8.2.5 installation on a Windows server 2003 that have worked perfectly for our Mediawiki until we tried to update to 8.4. Before the update we took a backup, stopped the service and took a copy of the entire database catalog. We could not make the 8.4 (installed in a diff

Re: [GENERAL] COPY BINARY 8.3 to 8.4 timestamp incorrect

2009-10-14 Thread Raymond O'Donnell
On 14/10/2009 15:28, Chase, John wrote: > That makes sense, of course. I'm guessing this is because I formally > used the pgInstaller and since 8.4 is not supported yet by pgInstaller I > moved to the EnterpriseDB installer. The man behind the current must As I understand it, pgInstaller is going

Re: [GENERAL] COPY BINARY 8.3 to 8.4 timestamp incorrect

2009-10-14 Thread Chase, John
Wow, quick response from Dave Page. For those who may be interested, here's his answer: "pgInstaller used floating point, whilst the one-click installers use (and will continue to use) the more accurate integer timestamps." -Original Message- From: Chase, John Sent: Wednesday, October 14

Re: [GENERAL] COPY BINARY 8.3 to 8.4 timestamp incorrect

2009-10-14 Thread Tom Lane
"Chase, John" writes: > That makes sense, of course. I'm guessing this is because I formally > used the pgInstaller and since 8.4 is not supported yet by pgInstaller I > moved to the EnterpriseDB installer. The man behind the current must > have done the build with different options. Would you con

Re: [GENERAL] different sort order for primary key index

2009-10-14 Thread Grzegorz Jaśkiewicz
On Wed, Oct 14, 2009 at 3:37 PM, Sam Mason wrote: > On Wed, Oct 14, 2009 at 10:29:56AM -0400, Tom Lane wrote: > > Paul Hartley writes: > > > ... I'm unclear > > > if PostgreSQL treats primary keys differently from unique, non-null > > > constraints. > > > > The *only* thing that the system does

Re: [GENERAL] different sort order for primary key index

2009-10-14 Thread Sam Mason
On Wed, Oct 14, 2009 at 10:29:56AM -0400, Tom Lane wrote: > Paul Hartley writes: > > ... I'm unclear > > if PostgreSQL treats primary keys differently from unique, non-null > > constraints. > > The *only* thing that the system does specially with a primary key > constraint is that a PK creates a

Re: [GENERAL] different sort order for primary key index

2009-10-14 Thread Tom Lane
Paul Hartley writes: > ... I'm unclear > if PostgreSQL treats primary keys differently from unique, non-null > constraints. The *only* thing that the system does specially with a primary key constraint is that a PK creates a default column target for foreign key references. For example, create

Re: [GENERAL] COPY BINARY 8.3 to 8.4 timestamp incorrect

2009-10-14 Thread Chase, John
That makes sense, of course. I'm guessing this is because I formally used the pgInstaller and since 8.4 is not supported yet by pgInstaller I moved to the EnterpriseDB installer. The man behind the current must have done the build with different options. Would you concur? Maybe I should ask the man

Re: [GENERAL] COPY BINARY 8.3 to 8.4 timestamp incorrect

2009-10-14 Thread Tom Lane
"Chase, John" writes: > I am working on upgrading from 8.3.7 to 8.4.1. One of the functions of > our application is to "export" and "import" data, and to accomplish this > I've written some functions that use COPY ... TO ... BINARY and COPY ... > FROM ... BINARY. In testing the upgrade to 8.4.1 I

Re: [GENERAL] COPY BINARY 8.3 to 8.4 timestamp incorrect

2009-10-14 Thread Grzegorz Jaśkiewicz
that's because by default 8.4 uses integer timestamps, instead of whatever 8.3 was using. and you pretty much use something, that is suppose to be only used within the scope of the same version and hardware type (and potentially even build).

[GENERAL] COPY BINARY 8.3 to 8.4 timestamp incorrect

2009-10-14 Thread Chase, John
Hello, I am working on upgrading from 8.3.7 to 8.4.1. One of the functions of our application is to "export" and "import" data, and to accomplish this I've written some functions that use COPY ... TO ... BINARY and COPY ... FROM ... BINARY. In testing the upgrade to 8.4.1 I noticed that when I

[GENERAL] Test for optimizer

2009-10-14 Thread 纪晓曦
I want to test the optimizer of postgresql. Can anyone give me any idea about which kinds of query I should test? large query for path an geqo? subquery?

Re: [GENERAL] different sort order for primary key index

2009-10-14 Thread Grzegorz Jaśkiewicz
there are certain conditions where PK is required, but apart from that it is pretty much equivalent of unique not null. Obviously index is created, in order to keep things unique. the (col1, col2 DESC) type of index is useful, when you have query that uses it that way. For example, if your query i

Re: [GENERAL] different sort order for primary key index

2009-10-14 Thread Albe Laurenz
Paul Hartley wrote: > I have a composite primary key for a table, let's call it > (col1, col2). When this table is created, obviously an > implicit index is created for this key. I would like the > sort order of this index to be different for the two columns > -- if I were to create the index

Re: [GENERAL] Cannot start the postgres service

2009-10-14 Thread Craig Ringer
On 14/10/2009 2:29 PM, Scott Marlowe wrote: > On Tue, Oct 13, 2009 at 11:24 PM, Craig Ringer > wrote: >> >> A better question might by "why on earth are you messing about with the >> data directory when you don't understand what it does and how it works?". > > Not that anyone wants to discourage

Re: [GENERAL] Procedure for feature requests?

2009-10-14 Thread Sam Mason
On Tue, Oct 13, 2009 at 10:22:04PM +, Tim Landscheidt wrote: > Sam Mason wrote: > > Calculating "(C - B) / C" isn't easy for timestamps, whereas it's easy > > for dates. I believe this is why there's a specific version for the > > former but not the latter. > > (I obviously meant "(B - A) /

Re: [GENERAL] Case statement with different data types

2009-10-14 Thread Pavel Stehule
Hello try to explicit cast select 't'::boolean; regards Pavel Stehule 2009/10/14 Gus Waddell : > Hi everyone, > > I am currently working on an app that is split into several databases with > the same table but a column with differing data type. > > eg. Database 1 > tablename: gp > column:  avai

[GENERAL] Case statement with different data types

2009-10-14 Thread Gus Waddell
Hi everyone, I am currently working on an app that is split into several databases with the same table but a column with differing data type. eg. Database 1 tablename: gp column:  available - data type boolean Database 2 tablename: gp column:  available - data type character(1) I would lik

Re: [GENERAL] Cannot start the postgres service

2009-10-14 Thread Scott Marlowe
On Tue, Oct 13, 2009 at 11:40 PM, Mitesh51 wrote: > > I like that "why on earth are you messing about with the > data directory when you don't understand what it does and how it works?" > > Actully I am not a DB person and having almost ZERO knowledge abt it but I > am working on an application wh

Re: [GENERAL] Cannot start the postgres service

2009-10-14 Thread Mitesh51
Hi, I like that "why on earth are you messing about with the data directory when you don't understand what it does and how it works?" Actully I am not a DB person and having almost ZERO knowledge abt it but I am working on an application which takes backup(full & incremental) of diff DB like mys

[GENERAL] subscribe

2009-10-14 Thread Oleg Shalnev
subscribe -- Oleg Shalnev (Kalpa Project) -- mailto: o...@kalpa.ru skype: oleg_shalnev sip: 17474845...@gizmo5.com jabber: oleg.shal...@gmail.com icq:366619571 http://kalpa.ru

[GENERAL] different sort order for primary key index

2009-10-14 Thread Paul Hartley
I have a composite primary key for a table, let's call it (col1, col2). When this table is created, obviously an implicit index is created for this key. I would like the sort order of this index to be different for the two columns -- if I were to create the index myself, I would pass on (col1, co