Re: [GENERAL] Large index operation crashes postgres

2010-03-24 Thread Frans Hals
5 x postmaster taking memory: 93.3 % 18.7 % 0.3 % 0.2 % 0.0 % 112.5% Looks like there is someone living beyond its means? Frans 2010/3/24 Tom Lane : > Hm.  I wonder about a memory leak in there somewhere.  Have you checked > the process size while this is going on? > >            

Re: [GENERAL] How to retrive List of Tables in a Database using...

2010-03-24 Thread John R Pierce
Yogi Yang 007 wrote: 3. Retrieve list of all Group Roles 4. Retrieve list of all Login Roles there is no difference between these, except in usage. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/p

Re: [GENERAL] How to retrive List of Tables in a Database using...

2010-03-24 Thread Scott Mead
On Thu, Mar 25, 2010 at 1:26 AM, John R Pierce wrote: > Yogi Yang 007 wrote: > >> Hello, >> >> I am new to pgSQL. I would like to know if there is a way to do the >> following using pure SQL: >> 1. Retrieve list of all Tables in a database >> 2. Retrieve list of all Functions, Triggers, Sequences

Re: [GENERAL] How to retrive List of Tables in a Database using...

2010-03-24 Thread John R Pierce
Yogi Yang 007 wrote: Hello, I am new to pgSQL. I would like to know if there is a way to do the following using pure SQL: 1. Retrieve list of all Tables in a database 2. Retrieve list of all Functions, Triggers, Sequences, Views, etc. 3. Retrieve list of all Group Roles 4. Retrieve list of all

Re: [GENERAL] "\d pg_class" fails in PG 8.4

2010-03-24 Thread Tadipathri Raghu
Hi Tom, As you are best always on this Community Fourm. Thanks for your help. It got resolved. Regards Raghavendra On Thu, Mar 25, 2010 at 10:03 AM, Tom Lane wrote: > Tadipathri Raghu writes: > > Following is the error when i try to describe the catalog table. > > > postgres=# \d pg_class > >

Re: [GENERAL] How to retrive List of Tables in a Database using...

2010-03-24 Thread Tadipathri Raghu
Hi Yogi Yang, Psql is a very strong tool, and easy to use. Please find the answers for your queries >>1. Retrieve list of all Tables in a database >>2. Retrieve list of all Functions, Triggers, Sequences, Views, etc. >>3. Retrieve list of all Group Roles postgres=#\d{t|i|s|v|S|g|n} you can use a

Re: [GENERAL] "\d pg_class" fails in PG 8.4

2010-03-24 Thread Tom Lane
Tadipathri Raghu writes: > Following is the error when i try to describe the catalog table. > postgres=# \d pg_class > ERROR: column "reltriggers" does not exist at character 41 > STATEMENT: SELECT relhasindex, relkind, relchecks, reltriggers, > relhasrules, > relhasoids , reltablespace

[GENERAL] How to retrive List of Tables in a Database using...

2010-03-24 Thread Yogi Yang 007
Hello, I am new to pgSQL. I would like to know if there is a way to do the following using pure SQL: 1. Retrieve list of all Tables in a database 2. Retrieve list of all Functions, Triggers, Sequences, Views, etc. 3. Retrieve list of all Group Roles 4. Retrieve list of all Login Roles 5. Struct

[GENERAL] "\d pg_class" fails in PG 8.4

2010-03-24 Thread Tadipathri Raghu
Hi All, Following is the error when i try to describe the catalog table. Version Info postgres=# select version(); version ---

[GENERAL] boualem guechtouli

2010-03-24 Thread william wayne
http://welltrade-hydraulik.com/virginie.html _ Hotmail: Trusted email with Microsoft’s powerful SPAM protection. http://clk.atdmt.com/GBL/go/210850552/direct/01/

Re: [GENERAL] data type to store a lot of text and tables of data

2010-03-24 Thread Raymond O'Donnell
On 24/03/2010 22:39, Karina Guardado wrote: > You know I need to design a table where some attributes have a data type > that allow me to store text mixed with tables and other information. I > use PHP code to get the information and store it in to the database so I > wonder if this is posible to

Re: [GENERAL] data type to store a lot of text and tables of data

2010-03-24 Thread Karina Guardado
You know I need to design a table where some attributes have a data type that allow me to store text mixed with tables and other information. I use PHP code to get the information and store it in to the database so I wonder if this is posible to do. I found in the link you provided me that If cha

Re: [GENERAL] How to dump JUST procedures/funnctions?

2010-03-24 Thread Carlo Stonebanks
Hi Tony, Thanks VERY much! That got me on my way. I'm going to try and convert this to a PG stored function, Since you know that the script has limitations, you or othres reading might want to know the ones I've found: 1) Regardless of what you set the schema to, the only ones that are dumped a

Re: [GENERAL] data type to store a lot of text and tables of data

2010-03-24 Thread Raymond O'Donnell
On 24/03/2010 22:01, Karina Guardado wrote: > what should be the data type to store a file that can be xls, doc, pdf > for example. Sorry, I missed this bit - for binary files you can use the bytea type. Look under "Binary data types" in the docs. Ray. -- Raymond O'Donnell :: Galway :: Irelan

Re: [GENERAL] data type to store a lot of text and tables of data

2010-03-24 Thread Raymond O'Donnell
On 24/03/2010 22:01, Karina Guardado wrote: > for example something like the following : > > *Table 9-25. Date/Time Operators* > > Operator Example Result > + date '2001-09-28' + integer '7' date '2001-10-05' > + date '2001-09-28' + interval '1 hour' timestamp '2001-09-28 01:00:00'

Re: [GENERAL] data type to store a lot of text and tables of data

2010-03-24 Thread Karina Guardado
for example something like the following : *Table 9-25. Date/Time Operators* OperatorExampleResult + date '2001-09-28' + integer '7'date '2001-10-05' + date '2001-09-28' + interval '1 hour'timestamp '2001-09-28 01:00:00' + date '2001-09-28' + time '03:00'timestamp '2001-09-28 03:00:00' + interval

Re: [GENERAL] data type to store a lot of text and tables of data

2010-03-24 Thread Raymond O'Donnell
On 24/03/2010 21:48, Karina Guardado wrote: > Hi, > > Is there a special data type to use to store a lot of text and tables of > data in a column or attribute? For large amounts of text, just use the TEXT data type: http://www.postgresql.org/docs/8.4/static/datatype-character.html Not sure

Re: [GENERAL] data type to store a lot of text and tables of data

2010-03-24 Thread Szymon Guz
2010/3/24 Karina Guardado > Hi, > > Is there a special data type to use to store a lot of text and tables of > data in a column or attribute? > > thanks in advance, > > regards, > > karina > El Salvador, Centroamerica > Normally text can be stored in a type named "TEXT". Maybe there would be som

[GENERAL] data type to store a lot of text and tables of data

2010-03-24 Thread Karina Guardado
Hi, Is there a special data type to use to store a lot of text and tables of data in a column or attribute? thanks in advance, regards, karina El Salvador, Centroamerica

Re: [GENERAL] find a string contained in an attribute

2010-03-24 Thread Karina Guardado
Thanks a lot for your help that's exactly what I wanted. It worked fine. regards, karina On Wed, Mar 24, 2010 at 3:25 PM, Szymon Guz wrote: > 2010/3/24 Karina Guardado > > Hi, >> >> I want to know if it is possible to search for a string of characters >> inside an attribute for example I have

Re: [GENERAL] find a string contained in an attribute

2010-03-24 Thread Szymon Guz
2010/3/24 Karina Guardado > Hi, > > I want to know if it is possible to search for a string of characters > inside an attribute for example I have the following table and values > > cod_unidad | nombre_uni > +- > 1

[GENERAL] find a string contained in an attribute

2010-03-24 Thread Karina Guardado
Hi, I want to know if it is possible to search for a string of characters inside an attribute for example I have the following table and values cod_unidad | nombre_uni +- 1 | Facultad de Ciencias Naturales y Matemát

Re: [GENERAL] Large index operation crashes postgres

2010-03-24 Thread Paul Ramsey
Can you do? alter table placex add column geometry_sector integer; update placex set geometry_sector = geometry_sector(geometry); P. On Wed, Mar 24, 2010 at 1:15 PM, Frans Hals wrote: > Hi, > > running a geo-database from a dump restore where still one of the most > important indexes is missing

Re: [GENERAL] Large index operation crashes postgres

2010-03-24 Thread Tom Lane
Frans Hals writes: > Whenever I try to add the follwing index to the table "placex", one of > the postmaster processes dies and the server restarts. Can you provide a stack trace from the crash? > I try: > CREATE INDEX idx_placex_sector ON placex USING btree > (geometry_sector(geometry), rank_ad

[GENERAL] Large index operation crashes postgres

2010-03-24 Thread Frans Hals
Hi, running a geo-database from a dump restore where still one of the most important indexes is missing and so the search is slow. Whenever I try to add the follwing index to the table "placex", one of the postmaster processes dies and the server restarts. I try: CREATE INDEX idx_placex_sector ON

Re: Fw: [GENERAL] Clipping values

2010-03-24 Thread Ovid
- Original Message > From: Tom Lane > You could code that directly with CASE > operations, but it would probably > be easier to use GREATEST/LEAST, along the > lines of >new_percentage = LEAST(num_intervals * .1, > 1); Ah, I didn't know about the LEAST function! I love you (pla

[GENERAL] question (or feature-request): over ( partition by ... order by LIMIT N)

2010-03-24 Thread A. Kretschmer
Hello @all, I know, i can do: select * from (select ... row_number() over (...) ...) foo where row_number < N to limit the rows per group, but the inner select has to retrieve the whole set of records and in the outer select most of them discarded. Why isn't there an over ( ... LIMIT N) ? Oth

Re: [GENERAL] Revoking CREATE TABLE

2010-03-24 Thread Tony Webb
Hi Tom, Thanks for your help and the hint (off-line) to use the \dn+ command. You've hit the nail on the head sir! \dn+ WARNING: nonstandard use of \\ in a string literal at character 281 HINT: Use the escape string syntax for backslashes, e.g., E'\\'.

Re: Fw: [GENERAL] Clipping values

2010-03-24 Thread Tom Lane
Ovid writes: > I have a table with four values which are constantly lowered by user action. > These four values must rise over time, in five minute intervals. The core of > the function, in pseudo-code, would look something like this: > FOREACH row IN SELECT * FROM some_table WHERE some_perc

Re: [GENERAL] Revoking CREATE TABLE

2010-03-24 Thread Tom Lane
"Tony Webb" writes: > Thanks Tom, > I think I'm still doing something wrong. > As a superuser I run: > #revoke create on schema public from public; > REVOKE > As the read only user straight after running the above: > create table barney2(col1 integer); > CREATE TABLE It works for me: regressi

Fw: [GENERAL] Clipping values

2010-03-24 Thread Ovid
In response to a private email from someone else on this list, I thought I should send the following clarification. I have a table with four values which are constantly lowered by user action. These four values must rise over time, in five minute intervals. The core of the function, in pseudo-

Re: [GENERAL] Revoking CREATE TABLE

2010-03-24 Thread Tony Webb
Thanks Tom, I think I'm still doing something wrong. As a superuser I run: #revoke create on schema public from public; REVOKE As the read only user straight after running the above: create table barney2(col1 integer); CREATE TABLE \d barney2 Table "public.barney2" Column | Type | Modif

[GENERAL] Clipping values

2010-03-24 Thread Ovid
I have the following domain defined: CREATE DOMAIN percentage AS real CONSTRAINT percentage_check CHECK (((VALUE >= 0.0) AND (VALUE <= 1.0))); The various values (aa,bb,cc and dd) defined as "percentage" can increase over time, to a maximum value of 1.0. In fact, I have one table

Re: [GENERAL] Revoking CREATE TABLE

2010-03-24 Thread Tom Lane
"Tony Webb" writes: > I can grant table privileges to the USER and RO but how do I stop these > two users from creating new tables etc? Revoke CREATE privilege on the public schema from PUBLIC (and then grant it back to OWNER and whoever else you want to have it). If you don't want them creatin

[GENERAL] Revoking CREATE TABLE

2010-03-24 Thread Tony Webb
Hi, I would like a setup with the following: Three users - one, called OWNER, that owns the tables and can drop, alter and change data in the tables; another called USER that can edit data in the tables created by the owner but cannot create new tables or drop any tables and a third user called

Re: [GENERAL] Warm Standby Setup Documentation

2010-03-24 Thread Bryan Murphy
On Mon, Mar 22, 2010 at 9:21 AM, Ogden wrote: > I have looked all over but could not find any detailed docs on setting up a > warm standby solution using PostgreSQL 8.4. I do know of > http://www.postgresql.org/docs/8.4/static/warm-standby.html but was > wondering if there was a more detailed doc

Re: [GENERAL] Out of Memory during Insert

2010-03-24 Thread Tom Lane
yue peng writes: > I encountered an out of memory error during executing un INSERT into > table1(v1,v2,v3) SELECT c1,c2,c3 from table2 where . Most likely the OOM is because of growth of the pending-trigger-event queue --- do you have any foreign key references in that table? Possible solut

Re: [GENERAL] Concatenate [solved]

2010-03-24 Thread Frank jansen
Am 24.03.2010 14:41, schrieb Merlin Moncure: On Wed, Mar 24, 2010 at 6:22 AM, Frank jansen wrote: Hi, can you help me with this tricky concat i have? I have a function with an execute statement, one line of it doing an md5 hash of some concatenated xml paths with values. I cannot get this

Re: [GENERAL] Concatenate

2010-03-24 Thread Merlin Moncure
On Wed, Mar 24, 2010 at 6:22 AM, Frank jansen wrote: > Hi, > > > can you help me with this tricky concat i have? > I have a function with an execute statement, one line of it doing an md5 > hash of some concatenated xml paths with values. I cannot get this one work, > postgres is always complaing

Re: [GENERAL] Concatenate

2010-03-24 Thread Albe Laurenz
Frank jansen wrote: > can you help me with this tricky concat i have? > I have a function with an execute statement, one line of it doing an md5 > hash of some concatenated xml paths with values. I cannot get this one > work, postgres is always complaing about some things, like: "functions > and

Re: [GENERAL] Out of Memory during Insert

2010-03-24 Thread Thom Brown
On 24 March 2010 10:57, yue peng wrote: > Is there any other ways to still insert same amount of data and avoid this > OOM error ? > > I'd expect COPY to be the most effective way of bulk loading data into a database. http://www.postgresql.org/docs/current/static/sql-copy.html Or do inserts in

[GENERAL] Out of Memory during Insert

2010-03-24 Thread yue peng
Dear, Psqlers, I encountered an out of memory error during executing un INSERT into table1(v1,v2,v3) SELECT c1,c2,c3 from table2 where . The recordset of Select query is around 30M record. And I got following Message : --- ERROR: out of memoryDETAIL: Failed on request of size 40.' in

Re: [GENERAL] Help me with this multi-table query

2010-03-24 Thread Nilesh Govindarajan
On 03/24/2010 01:14 PM, Dean Rasheed wrote: On 24 March 2010 05:17, Nilesh Govindarajan wrote: On 03/24/2010 12:45 AM, Dean Rasheed wrote: On 23 March 2010 11:07, Nilesh Govindarajanwrote: Hi, I want to find out the userid, nodecount and comment count of the userid. I'm going wrong so

[GENERAL] Concatenate

2010-03-24 Thread Frank jansen
Hi, can you help me with this tricky concat i have? I have a function with an execute statement, one line of it doing an md5 hash of some concatenated xml paths with values. I cannot get this one work, postgres is always complaing about some things, like: "functions and operators can take at

Re: [GENERAL] PL/pgSQL & OVERLAPS operator (SOLVED!)

2010-03-24 Thread Tuo Pe
--- On Tue, 3/23/10, Tom Lane wrote: > Yeah --- that SELECT will result in no change to the > variables, ie, > they'll still be NULL.  So the OVERLAPS always fails. Tom & Andreas, I thank you for your help. Renaming the variables solved the problem. :-) Regards, Tuo -- Sent via pgsql-gener

Re: [GENERAL] Help me with this multi-table query

2010-03-24 Thread Dean Rasheed
On 24 March 2010 05:17, Nilesh Govindarajan wrote: > On 03/24/2010 12:45 AM, Dean Rasheed wrote: >> >> On 23 March 2010 11:07, Nilesh Govindarajan  wrote: >>> >>> Hi, >>> >>> I want to find out the userid, nodecount and comment count of the userid. >>> >>> I'm going wrong somewhere. >>> >>> Check