Re: [GENERAL] tsearch2 in multilingual database?

2007-07-05 Thread Hannes Dorbath
On 04.07.2007 11:20, Joshua N Pritikin wrote: Sometime in the future, I anticipate storing other languages in addition to English in my database to be indexed with tsearch2. set_curcfg() seems to be per-session. Will I need to call set_curcfg() every time I switch languages? You *should* crea

Re: [GENERAL] Problem with autovacuum and pg_autovacuum

2007-07-05 Thread Pavan Deolasee
On 7/5/07, Andreas 'ads' Scherbaum <[EMAIL PROTECTED]> wrote: Hello, On Wed, 4 Jul 2007 18:04:35 -0400 Alvaro Herrera wrote: > Most likely it is worried about XID wraparound, and those are precisely > the tables that need urgent vacuumed because they haven't been vacuumed > in a long time. N

[GENERAL] Polymorphic delete help needed

2007-07-05 Thread Perry Smith
I am doing a project using Ruby On Rails with PostgreSQL as the database. I have not seen the term polymorphic used with databases except with Rails so I will quickly describe it. Instead of holding just an id as a foreign key, the record holds a "type" field which is a string and an id.

Re: [GENERAL] Localization trouble

2007-07-05 Thread Chris Travers
Tom Lane wrote: Chris Travers <[EMAIL PROTECTED]> writes: Is there a way to accept localized numbers as input? i.e. '1,39'::numeric? See to_number(). Thanks! I somehow missed that function in the docs. Best Wishes, Chris Travers ---(end of broadcast)

Re: [GENERAL] Localization trouble

2007-07-05 Thread Tom Lane
Chris Travers <[EMAIL PROTECTED]> writes: > Is there a way to accept localized numbers as input? > i.e. '1,39'::numeric? See to_number(). regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives?

Re: [GENERAL] Localization trouble

2007-07-05 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > I think display depends on whether or not you configured Postgres > with or without --enable-nls. No, to_char understands numeric locales regardless of enable-nls. There is no provision for locale-dependent output from a plain numeric column; you

Re: [GENERAL] Localization trouble

2007-07-05 Thread Chris Travers
Michael Fuhr wrote: I think you'll need to use to_char(): test=> set lc_numeric to 'es_ES.UTF-8'; SET test=> select to_char(1.234, '9D999'); to_char - 1,234 (1 row) The file src/backend/utils/adt/pg_locale.c in the PostgreSQL source code has comments about how various LC_* sett

Re: [GENERAL] Localization trouble

2007-07-05 Thread Michael Glaesemann
On Jul 5, 2007, at 19:47 , Michael Glaesemann wrote: I don't believe you'll see numbers *as numbers* displayed with the formatting you desire unless you somehow tell your client (e.g., psql) which locale you want to use. I haven't figured out how to do this yet, though. I think display d

Re: [GENERAL] Localization trouble

2007-07-05 Thread Michael Fuhr
On Thu, Jul 05, 2007 at 05:10:57PM -0700, Chris Travers wrote: > I am trying to find a way to select the number format at runtime for > textual representation of numbers. I am currently running 8.1.4 built > from source on Fedora Linux core 5. > > I have been trying to use set lc_numeric = vari

Re: [GENERAL] Localization trouble

2007-07-05 Thread Michael Glaesemann
On Jul 5, 2007, at 19:10 , Chris Travers wrote: I have been trying to use set lc_numeric = various country codes (for example es_EC), but I am not able to get the format to change from 1.00 to 1,00. Any hints as to what I could be doing wrong? Does this correspond to what you're seeing?

[GENERAL] Localization trouble

2007-07-05 Thread Chris Travers
Hi all; I am trying to find a way to select the number format at runtime for textual representation of numbers. I am currently running 8.1.4 built from source on Fedora Linux core 5. I have been trying to use set lc_numeric = various country codes (for example es_EC), but I am not able to g

Re: [GENERAL] Nested Transactions in PL/pgSQL

2007-07-05 Thread Alvaro Herrera
John DeSoi wrote: > > On Jul 5, 2007, at 1:34 PM, Nykolyn, Andrew wrote: > > >Is it possible to nest transactions within a stored procedure? I > >have a stored procedure that calls many other stored procedures and > >what happens it that after a certain amount of time the server runs > >ou

Re: [GENERAL] Nested Transactions in PL/pgSQL

2007-07-05 Thread John DeSoi
On Jul 5, 2007, at 1:34 PM, Nykolyn, Andrew wrote: Is it possible to nest transactions within a stored procedure? I have a stored procedure that calls many other stored procedures and what happens it that after a certain amount of time the server runs out of shared memory. I know I can i

Re: [GENERAL] [pgsql-general] In memory tables/databases

2007-07-05 Thread PFC
Why not have a table type that writes no WAL and is truncated whenever postgres starts? Such a table could then be put in a ramdisk tablespace and there would be no transaction atomicity repercussions. Is there something I'm missing? Is this not in the TODO (if not already schedul

Re: [GENERAL] simple query question to use with DBI selectall_hashref

2007-07-05 Thread Martijn van Oosterhout
On Thu, Jul 05, 2007 at 01:39:31PM -0400, Kenji Morishige wrote: > I would like to create a query that returns a column with an integer > 1 through (row_count) to use as the index while used in conjunction with > DBI's selectall_hashref($sql,$key) function. In the past I'd usually just > write a w

Re: [GENERAL] Working with dates

2007-07-05 Thread Ranieri Mazili
Original Message Subject: [GENERAL] Working with dates From: Ranieri Mazili <[EMAIL PROTECTED]> To: pgsql-general@postgresql.org, [EMAIL PROTECTED] Date: 5/7/2007 16:00 Hello, I need to do the following select: Number of days of month - weekends - holydays So this query will

[GENERAL] Working with dates

2007-07-05 Thread Ranieri Mazili
Hello, I need to do the following select: Number of days of month - weekends - holydays So this query will return the number of days that people can work Look that I have the holydays in one table, it's bellow: CREATE TABLE holidays ( id_holidays serial NOT NULL, dt_holiday date, holiday_d

Re: [GENERAL] Way to determine index bloat stats?

2007-07-05 Thread Tom Lane
Jeff Amiel <[EMAIL PROTECTED]> writes: > Is there some magic way of determining the number of bytes in an index > 'row' and then comparing the size on disk of the index file? In recent releases contrib/pgstattuple/ has a function for obtaining stats about an index. regard

Re: [GENERAL] [pgsql-general] In memory tables/databases

2007-07-05 Thread Joshua D. Drake
A.M. wrote: On Jul 5, 2007, at 13:20 , Andrew Sullivan wrote: On Sun, Jul 01, 2007 at 11:11:30PM +0200, Alexander Todorov wrote: The question was is there something else that exists in PostgreSQL and will do the same job. Why not have a table type that writes no WAL and is truncated wheneve

[GENERAL] Nested Transactions in PL/pgSQL

2007-07-05 Thread Nykolyn, Andrew
Is it possible to nest transactions within a stored procedure? I have a stored procedure that calls many other stored procedures and what happens it that after a certain amount of time the server runs out of shared memory. I know I can increase the PostgreSQL shared memory. However, that would be

[GENERAL] simple query question to use with DBI selectall_hashref

2007-07-05 Thread Kenji Morishige
I would like to create a query that returns a column with an integer 1 through (row_count) to use as the index while used in conjunction with DBI's selectall_hashref($sql,$key) function. In the past I'd usually just write a wrapper around selectrow_hashref and put all those results in an array. I

Re: [GENERAL] [pgsql-general] In memory tables/databases

2007-07-05 Thread A.M.
On Jul 5, 2007, at 13:20 , Andrew Sullivan wrote: On Sun, Jul 01, 2007 at 11:11:30PM +0200, Alexander Todorov wrote: The question was is there something else that exists in PostgreSQL and will do the same job. Why re-invent the wheel, and make it square? But also, if you don't care whethe

[GENERAL] Way to determine index bloat stats?

2007-07-05 Thread Jeff Amiel
Got a bit of a rude surprise when I rebuilt a slony subscriber node from scratch and noticed the indexes for some tables using significantly less space than on their master-node counterpart. In once case, it was 2 gigabytes versus 9 gigabytes for the same table indexs on the master node. I'm as

Re: [GENERAL] [pgsql-general] In memory tables/databases

2007-07-05 Thread Andrew Sullivan
On Sun, Jul 01, 2007 at 11:11:30PM +0200, Alexander Todorov wrote: > The question was is there something else that exists in PostgreSQL and > will do the same job. Why re-invent the wheel, and make it square? But also, if you don't care whether you keep your data, why on earth are you putting it

Re: [GENERAL] Design Tool

2007-07-05 Thread Lee Keel
> -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-general- > [EMAIL PROTECTED] On Behalf Of Gabriele > Sent: Tuesday, July 03, 2007 2:43 PM > To: pgsql-general@postgresql.org > Subject: [GENERAL] Design Tool > > I need a design tool to design my database. > > Back in past I use

Re: [GENERAL] [general] [general] perpetual dump/restore problem

2007-07-05 Thread wu_zhong_min
You are right. I have now corrected that and I believe that should fix the problem. > >AFAICS it would not be issuing that unless you'd made template0 >connectable on t ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore

Re: [GENERAL] [general] perpetual dump/restore problem

2007-07-05 Thread Tom Lane
[EMAIL PROTECTED] writes: > time? Why won't pg_dump include a line to accept connection for > template0 just before it writes "\connect template0" and then remove > the permission after it is done with template0? AFAICS it would not be issuing that unless you'd made template0 connectable on the s

Re: [GENERAL] Vacuum issue

2007-07-05 Thread Michael Fuhr
On Thu, Jul 05, 2007 at 01:17:13PM +0100, E.J. Moloney wrote: > I have a database with a table that adds 3 records a day, I am > delete records older than 2 days. > I am vacuuming it once a day , I am having an issue that the disk usage > is continually rising. i.e. the space been flagged as

Re: [GENERAL] [general] perpetual dump/restore problem

2007-07-05 Thread wu_zhong_min
> OK. If you're not in a hurry, and can wait a few months 8.3 will be out. I am moving the database to a new physical server and it makes sense to move to the latest version now. >>for template0 all the >> time? Why won't pg_dump include a line to accept connection for >> template0 just before

Re: [GENERAL] How to get fast ~ operator using C locale

2007-07-05 Thread Martijn van Oosterhout
On Thu, Jul 05, 2007 at 02:11:24PM +0200, Artur Rataj wrote: > But I want the server to use the C locale. I set the locale to C and > run postmaster. I supposed it uses C locale, but -d 5 shows in log: The locale is decided when you run initdb. Once the cluster has been created you can't change it

Re: [GENERAL] How to get fast ~ operator using C locale

2007-07-05 Thread Merlin Moncure
On 7/5/07, Artur Rataj <[EMAIL PROTECTED]> wrote: But I want the server to use the C locale. I set the locale to C and run postmaster. I supposed it uses C locale, but -d 5 shows in log: The locale for indexing is set during initdb: initdb --no-locale The ~ operator does consider using btree r

[GENERAL] Vacuum issue

2007-07-05 Thread E.J. Moloney
I have a database with a table that adds 3 records a day, I am delete records older than 2 days. I am vacuuming it once a day , I am having an issue that the disk usage is continually rising. i.e. the space been flagged as free by the vacuum process isn't being reused. Please find below a

Re: [GENERAL] How to get fast ~ operator using C locale

2007-07-05 Thread Artur Rataj
But I want the server to use the C locale. I set the locale to C and run postmaster. I supposed it uses C locale, but -d 5 shows in log: DEBUG: /usr/bin/postmaster: PostmasterMain: initial environ dump: . . . DEBUG: LC_COLLATE=pl_PL.UTF-8 DEBUG: LC_CTYPE=pl_PL.UTF-8 DEBUG:

Re: [GENERAL] How to get fast ~ operator using C locale

2007-07-05 Thread Dimitri Fontaine
Hi, Le jeudi 05 juillet 2007, Artur Rataj a écrit : > Hello, I want to have pg use fast indexing for ~ operator. Is setting > C locale for this is still necessary? If yes, is it enough to > initdb/createdb with C locale? If it is not enough, why setting locale > to C and starting postmaster still

[GENERAL] How to get fast ~ operator using C locale

2007-07-05 Thread Artur Rataj
Hello, I want to have pg use fast indexing for ~ operator. Is setting C locale for this is still necessary? If yes, is it enough to initdb/createdb with C locale? If it is not enough, why setting locale to C and starting postmaster still gives other locale, for example, pl_PL, in postmaster log "i

Re: [GENERAL] Large Project, Integration with existing Oracle and MS SQL

2007-07-05 Thread Patrick Carroll
I would use Java and possibly OLEDB/ADO/ADO.Net form the public side as the consumers of this info will want it nice and easy and I dont want to spend hours developing a bespoke interface but put the onus on the consumers of the service to get what they need. Thanks for your comments, much apprec

Re: [GENERAL] Large Project, Integration with existing Oracle and MS SQL

2007-07-05 Thread Richard Huxton
Patrick Carroll wrote: There has got to be some persistence, there will be a lot of tables and metadata and it may have to handle validation requirements for other apps doing secure file transfer and a bespoke secure http proxy and it's going to be a speculative buffer against protocol based wo

Re: [GENERAL] Large Project, Integration with existing Oracle and MS SQL

2007-07-05 Thread Patrick Carroll
There has got to be some persistence, there will be a lot of tables and metadata and it may have to handle validation requirements for other apps doing secure file transfer and a bespoke secure http proxy and it's going to be a speculative buffer against protocol based worms crossing into the prod

Re: [GENERAL] Large Project, Integration with existing Oracle and MS SQL

2007-07-05 Thread Richard Huxton
Patrick Carroll wrote: I am architecting a solution for an interface between a highly secure production environment and a corporate network which involves transfer of records from Oracle and SQL Server through an intermediary "firewall DB", a Postgres Instance, to SQL Server/ Oracle. I anticipate

Re: [GENERAL] perpetual dump/restore problem

2007-07-05 Thread Richard Huxton
[EMAIL PROTECTED] wrote: Dear List, As many of you know every time one wants to upgrade to a major server version, as I want to do now, there is a need for pg_dumpall and restore. This is a huge undertaking and requires lots of testing and planning. I do hope that in the future this requiremen

Re: [GENERAL] Reasonable way to backup cluster Windows

2007-07-05 Thread Hannes Dorbath
On 04.07.2007 17:14, Andrus wrote: How to backup whole cluster so that huge temprary file containing all data in uncompressed form is not created in Windows temporary directory ( equivalent to pg_dumpall -c | gzip >backup in Linux ) ? Pipe in windows creates huge temprary file. pg_dumpall ha