Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Craig Ringer
On Fri, 2009-06-12 at 09:07 -0700, Alan Hodgson wrote: > On Friday 12 June 2009, Scott Ribe wrote: > > > It's far easier to backup and restore a database than millions of small > > > files. Small files = random disk I/O. That depends on how you're backing up. If you want to back a file system u

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Craig Ringer
On Fri, 2009-06-12 at 19:53 +1000, Yaroslav Tykhiy wrote: > DimitryASuplatov wrote: > > > > My task is to store a lot (10^5) of small ( <10 MB) text files in the > > database with the ability to restore them back to the hard drive on > > demand. > > I cannot but ask the community a related questi

Re: [GENERAL] Very slow searching in a table with more than 10 millions recovered records from a backup file...

2009-06-12 Thread Craig Ringer
On Sat, 2009-06-13 at 09:31 +0800, zxo102 ouyang wrote: > Grzegorz, > > > Thank you very much. I will do that. > I have another question: if I do the following steps, does it "hurt" > pgsql? > step 1. stop the pgsql in the old version of the application; the > whole application is installed in

Re: [GENERAL] Very slow searching in a table with more than 10 millions recovered records from a backup file...

2009-06-12 Thread zxo102 ouyang
Grzegorz, Thank you very much. I will do that. I have another question: if I do the following steps, does it "hurt" pgsql? step 1. stop the pgsql in the old version of the application; the whole application is installed in c:/xbop and pgsql is located in c:/xbop/pgsql; step 2. rename c:/xbop to

[GENERAL] Maintenance database SQL_ASCII

2009-06-12 Thread Brad Schick
After a new pgsql installation the "postgres" maintenance database has an encoding of SQL_ASCII. pgAdmin III gave me a warning about that, and I may want to create users or databases that are not restricted 7bit ASCII. I was going to backup and recreate this table, but it can't be dropped. I guess

Re: [GENERAL] String Manipulation

2009-06-12 Thread Sam Mason
On Fri, Jun 12, 2009 at 04:07:11PM -0700, Christine Penner wrote: > I get nothing. I just updated recently but the only version number I > can find is 8.3. I know its at least 8.3.4 but should be more. OK, the main thing is that you're running a copy of PG from the 8.3 series. I've just tried it

Re: [GENERAL] String Manipulation

2009-06-12 Thread Christine Penner
Sam, I get nothing. I just updated recently but the only version number I can find is 8.3. I know its at least 8.3.4 but should be more. Christine At 03:58 PM 12/06/2009, you wrote: On Fri, Jun 12, 2009 at 03:35:44PM -0700, Christine Penner wrote: > The problem with making it a numeric field

[GENERAL] accessing anyarray elements

2009-06-12 Thread Michael Glaesemann
I'd like to be able to access individual elements of anyarray, treating them as type anyelement to take advantage of the polymorphism. Using pg_stats.histogram_bounds as a convenient example of an anyelement array, here's an example of the issue I'm running into. test_anyarray=# select ve

Re: [GENERAL] String Manipulation

2009-06-12 Thread Sam Mason
On Fri, Jun 12, 2009 at 03:35:44PM -0700, Christine Penner wrote: > The problem with making it a numeric field is that I have seen things > like A123, #123a or 23-233. This is only here to make most sorting > work better, not perfect. It all depends on how they enter the data. > Wont the differe

Re: [GENERAL] WITH RECURSIVE clause -- all full and partial paths

2009-06-12 Thread David Fetter
On Fri, Jun 12, 2009 at 10:14:21PM +0200, Harald Fuchs wrote: > In article , > aryoo writes: > > > Dear list, > > In reference to the message below posted on the 'pgsql-hackers' list > > regarding > > 'iterative' queries, > > could anyone help me write the queries that return all full and all pa

Re: [GENERAL] String Manipulation

2009-06-12 Thread Christine Penner
Sam, The problem with making it a numeric field is that I have seen things like A123, #123a or 23-233. This is only here to make most sorting work better, not perfect. It all depends on how they enter the data. Wont the different formats make it harder to convert to a number? I tried your su

Re: [GENERAL] String Manipulation

2009-06-12 Thread Sam Mason
On Fri, Jun 12, 2009 at 12:36:27PM -0700, Christine Penner wrote: > I want to calculate a new field I added to a table but I'm not sure > how to do it. This will be a copy of another field with any non > numeric characters stripped off the end and padded with spaces. > > This is what I was tryin

[GENERAL] String Manipulation

2009-06-12 Thread Christine Penner
Hi, I want to calculate a new field I added to a table but I'm not sure how to do it. This will be a copy of another field with any non numeric characters stripped off the end and padded with spaces. This is what I was trying to do Update Buildings SET B_LOT_SORT=lpad(substr(lot,1,??),7) in

Re: [GENERAL] search for partial dates

2009-06-12 Thread Scott Marlowe
On Fri, Jun 12, 2009 at 7:58 AM, James B. Byrne wrote: > > On Thu, June 11, 2009 17:37, Andy Colson wrote: > >> That's a little vague, so how about: >> >> select * from somethine where (extract(year from idate) = $1) or >> (extract(year from idate) = $2 and extract(month from idate) = $3) >> or (ex

Re: [GENERAL] WITH RECURSIVE clause -- all full and partial paths

2009-06-12 Thread Harald Fuchs
In article , aryoo writes: > Dear list, > In reference to the message below posted on the 'pgsql-hackers' list regarding > 'iterative' queries, > could anyone help me write the queries that return all full and all partial > paths from the root? Probably you want to use the following query: WI

Re: [GENERAL] search for partial dates

2009-06-12 Thread Sam Mason
On Fri, Jun 12, 2009 at 12:47:26AM +0200, Leif B. Kristensen wrote: > CREATE OR REPLACE FUNCTION date2text(DATE) RETURNS TEXT AS $$ > -- removes hyphens from a regular date > SELECT > SUBSTR(TEXT($1),1,4) || > SUBSTR(TEXT($1),6,2) || > SUBSTR(TEXT($1),9,2) > $$ LANGUAGE sql STABLE; Why

Re: [GENERAL] Behavior of NpgsqlDataReader in NpgSql 1 and NpgSql 2

2009-06-12 Thread Francisco Figueiredo Jr.
On Fri, Jun 12, 2009 at 07:35, Nishkarsh wrote: > > Hello every one, > Hello, Nishkarsh! > I have a Vb 2005 application with postgres 8.2 as DB. > > I was trying to move from Pg 8.2 to 8.3.7, the installation went well. Once > i tried running my application i got some errors. After doing some rese

[GENERAL] Behavior of NpgsqlDataReader in NpgSql 1 and NpgSql 2

2009-06-12 Thread Nishkarsh
Hello every one, I have a Vb 2005 application with postgres 8.2 as DB. I was trying to move from Pg 8.2 to 8.3.7, the installation went well. Once i tried running my application i got some errors. After doing some research i realized that. - NpgsqlDataReader in NpgSql 1 was capable to retain th

Re: [GENERAL] Having trouble restoring our backups

2009-06-12 Thread Bryan Murphy
On Fri, Jun 12, 2009 at 11:08 AM, Bryan Murphy wrote: > I've read through the PITR documentation many times. I do not see anything > that sheds light on what I'm doing wrong, and I've restored older backups > successfully many times in the past few months using this technique. I have > no explan

Re: [GENERAL] Having trouble restoring our backups

2009-06-12 Thread Bryan Murphy
On Fri, Jun 12, 2009 at 10:48 AM, Alan Hodgson wrote: > On Friday 12 June 2009, Bryan Murphy wrote: > > What am I doing wrong? FYI, we're running 8.3.7. > > See the documentation on PITR backups for how to do this correctly. > I've read through the PITR documentation many times. I do not see

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Alan Hodgson
On Friday 12 June 2009, Scott Ribe wrote: > > It's far easier to backup and restore a database than millions of small > > files. Small files = random disk I/O. The real downside is the CPU time > > involved in storing and retrieving the files. If it isn't a show > > stopper, then putting them in t

[GENERAL] WITH RECURSIVE clause -- all full and partial paths

2009-06-12 Thread aryoo
Dear list, In reference to the message below posted on the 'pgsql-hackers' list regarding 'iterative' queries, could anyone help me write the queries that return all full and all partial paths from the root? Sincerely, Aryé. --http://archives.postgresql.org/pgsql-hackers/2008-02/msg00642.php C

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Scott Ribe
> It's far easier to backup and restore a database than millions of small > files. Small files = random disk I/O. The real downside is the CPU time > involved in storing and retrieving the files. If it isn't a show stopper, > then putting them in the database makes all kinds of sense. On the contr

Re: [GENERAL] Having trouble restoring our backups

2009-06-12 Thread Alan Hodgson
On Friday 12 June 2009, Bryan Murphy wrote: > What am I doing wrong? FYI, we're running 8.3.7. See the documentation on PITR backups for how to do this correctly. -- WARNING: Do not look into laser with remaining eye. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Alan Hodgson
On Friday 12 June 2009, Greg Stark wrote: > Also, it makes backups a pain since it's a lot easier to back up a > file system than a database. But that gets back to whether you need > transactional guarantees. The reason it's a pain to back up a database > is precisely because it needs to make thos

[GENERAL] Having trouble restoring our backups

2009-06-12 Thread Bryan Murphy
Hey guys, I'm having difficulty restoring some of our backups. Luckily, I'm only trying to do this to bring up a copy of our database for testing purposes, but this still has me freaked out because it means we currently have no valid backups and are only running with a single warm spare. Our prima

Re: [GENERAL] [HACKERS] PostgreSQL installation

2009-06-12 Thread Emanuel Calvo Franco
> I am from Cambodia. I want to use PostgreSQL. But I am poor of knowledge to > install could you please help me give some guide to install PostgreSQL on > Solaris 10, (+ to pgsql-general) Try to use the general list for these cases, you could obtain better results ;) The documentation for Sola

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Andy Colson
Scott Ribe wrote: If I had an admin roaming through my document server deleting document files out from under my database, that's a problem I would solve very quickly--with a completely non-technical "solution". After all, what's to prevent such a person from deleting pgsql data files??? Yea,

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Scott Ribe
If I had an admin roaming through my document server deleting document files out from under my database, that's a problem I would solve very quickly--with a completely non-technical "solution". After all, what's to prevent such a person from deleting pgsql data files??? -- Scott Ribe scott_r...@

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Greg Stark
This is a recurring debate and there are pros and cons for both sides. It usually comes down to whether you need transactional guarantees for these large objects. There are also practical concerns. Transfering these large objects over a single database tcp connection limits the application perform

Re: [GENERAL] search for partial dates

2009-06-12 Thread James B. Byrne
On Thu, June 11, 2009 17:37, Andy Colson wrote: > That's a little vague, so how about: > > select * from somethine where (extract(year from idate) = $1) or > (extract(year from idate) = $2 and extract(month from idate) = $3) > or (extract(year from idate) = $4 and extract(month from idate) = $5 >

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Emanuel Calvo Franco
2009/6/6 DimitryASuplatov : > Hello, > > I am very new to postgresql database. I`ve used a little of MySql > previously. > > My task is to store a lot (10^5) of small ( <10 MB) text files in the > database with the ability to restore them back to the hard drive on > demand. > > That means that I ne

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Andy Colson
Yaroslav Tykhiy wrote: DimitryASuplatov wrote: My task is to store a lot (10^5) of small ( <10 MB) text files in the database with the ability to restore them back to the hard drive on demand. I cannot but ask the community a related question here: Can such design, that is, storing quite lar

Re: [GENERAL] Finding time of last pg_stat_reset

2009-06-12 Thread Bruce Momjian
Tommy Gildseth wrote: > I'm trying to figure out if there's any way to find when statistics was > last reset. Previously when we were using 8.2, we had > stats_reset_on_server_start set to on, and then assumed > pg_stat_get_backend_start as the start time for collected stats. Is > there any way

Re: [GENERAL] Libpq on windows

2009-06-12 Thread Jasen Betts
On 2009-06-11, Phil Longstaff wrote: > --Boundary-00=_G1PMKwGIJrCuvLL > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: 7bit > > On June 10, 2009 10:00:48 pm Andy Colson wrote: >> Phil Longstaff wrote: >> > I want to develop an app which uses libpq, built with mingw

Re: [GENERAL] Libpq on windows

2009-06-12 Thread Jasen Betts
On 2009-06-11, Phil Longstaff wrote: > --Boundary-00=_SzPMK0I3TQhQuQd > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: 7bit > > On June 11, 2009 01:21:09 am Albe Laurenz wrote: >> Phil wrote: >> > I want to develop an app which uses libpq, built with mingw. >> > Is

Re: [GENERAL] help with data recovery from injected UPDATE

2009-06-12 Thread Chris Spotts
> >> It's a classic story.  I'm volunteering about one day per month for > >> this project, learning SQL as I go.  Priority was always given to > the > >> "get it working" tasks and never the "make it safe" tasks.  I > had/have > >> grandiose plans to rewrite the whole system properly after I > gra

Re: [GENERAL] Libpq on windows

2009-06-12 Thread Jasen Betts
On 2009-06-11, Phil Longstaff wrote: > --Boundary-00=_kTFMK/PsAPB2oua > Content-Type: text/plain; > charset="us-ascii" > Content-Transfer-Encoding: 7bit > > I want to develop an app which uses libpq, built with mingw. Is there a > download package which contains just the include files/dlls? I

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Yaroslav Tykhiy
DimitryASuplatov wrote: My task is to store a lot (10^5) of small ( <10 MB) text files in the database with the ability to restore them back to the hard drive on demand. I cannot but ask the community a related question here: Can such design, that is, storing quite large objects of varying si

Re: [GENERAL] Very slow searching in a table with more than 10 millions recovered records from a backup file...

2009-06-12 Thread Grzegorz Jaśkiewicz
On Fri, Jun 12, 2009 at 9:56 AM, zxo102 ouyang wrote: > Hi there, >     I have an application with a database (pgsql) which has a big table (> > 10 millions records) in windows 2003. Some times, I need to install the new > version of the application.  Here is what I did: 1. back up the big table >

[GENERAL] Very slow searching in a table with more than 10 millions recovered records from a backup file...

2009-06-12 Thread zxo102 ouyang
Hi there, I have an application with a database (pgsql) which has a big table (> 10 millions records) in windows 2003. Some times, I need to install the new version of the application. Here is what I did: 1. back up the big table via pgadmin III, 2. stop the pgsql in the old version of the app

[GENERAL] Finding time of last pg_stat_reset

2009-06-12 Thread Tommy Gildseth
I'm trying to figure out if there's any way to find when statistics was last reset. Previously when we were using 8.2, we had stats_reset_on_server_start set to on, and then assumed pg_stat_get_backend_start as the start time for collected stats. Is there any way to do this in 8.3, without f.ex