Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Alvaro Herrera
Tom Lane wrote: > "Karen Hill" <[EMAIL PROTECTED]> writes: > > I did a quick google and someone mentioned that input and output > > functions need to be written in C. Is that still the case? > > Yeah, pretty much. The main problem is that such functions need to deal > with whatever physical on-d

Re: [GENERAL] A function which returns all rolname from pg_roles.

2006-07-10 Thread A. Kretschmer
am 10.07.2006, um 19:27:38 -0700 mailte Karen Hill folgendes: > How do I make this function work? I am trying to get all the rolnames > from pg_roles. > > CREATE OR REPLACE FUNCTION test() SETOF name AS $$ > DECLARE > rrol name; > BEGIN > SELECT rolname INTO rrol FROM pg_roles; > RETURN setof r

Re: [GENERAL] A function which returns all rolname from pg_roles.

2006-07-10 Thread Joe Conway
Karen Hill wrote: How do I make this function work? I am trying to get all the rolnames from pg_roles. Why not just do "SELECT rolname FROM pg_roles;"? Anyway, in PL/pgSQL: CREATE OR REPLACE FUNCTION test() RETURNS SETOF name AS $$ DECLARE rec record; BEGIN FOR rec IN SELECT ro

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Tom Lane
"Karen Hill" <[EMAIL PROTECTED]> writes: > I did a quick google and someone mentioned that input and output > functions need to be written in C. Is that still the case? Yeah, pretty much. The main problem is that such functions need to deal with whatever physical on-disk format you've chosen for

[GENERAL] A function which returns all rolname from pg_roles.

2006-07-10 Thread Karen Hill
How do I make this function work? I am trying to get all the rolnames from pg_roles. CREATE OR REPLACE FUNCTION test() SETOF name AS $$ DECLARE rrol name; BEGIN SELECT rolname INTO rrol FROM pg_roles; RETURN setof rrol; END; $$ LANGUAGE plpgsql; regards, ---(end of br

Re: [GENERAL] Notes on converting from MySQL 5.0.x to PostgreSQL

2006-07-10 Thread Alex Turner
http://dev.mysql.com/doc/refman/5.1/en/replication-row-based.html5.1AlexOn 7/10/06, Jan Wieck <[EMAIL PROTECTED]> wrote: On 6/30/2006 11:12 AM, Scott Marlowe wrote:> I agree with Tom, nice notes.  I noted a few minor issues that seem to> derive from a familiarity with MySQL.  I'll put my correctio

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Chris Browne
[EMAIL PROTECTED] writes: > In California, we definitely care about the area code, as there are several > area codes (at least 4) in San Diego County. I have to use 1+area code to > dial home from work, and vice-versa. In what way do you care about them? The area code is NOT an accurate way of d

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Chris Browne
[EMAIL PROTECTED] (Richard Broersma Jr) writes: >> > Is the difficulty of creating a telephone type the reason it is not in >> > postgresql already? >> > >> > Should the telephone type be able to do something such as: >> > >> > SELECT * from tableFOO where telephone.areacode = 555; >> > >> > Or wou

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Browne wrote: > kleptog@svana.org (Martijn van Oosterhout) writes: [snip] > Attempts to evaluate terribly much based on area codes are > increasingly likely to fail... Especially with VoIP and number portability. - -- Ron Johnson, Jr. Jefferso

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Chris Browne
kleptog@svana.org (Martijn van Oosterhout) writes: > What makes it tricky is that people don't agree on how numbers > should be formatted. There is a relevant standard, E.164b, where US/Canadian telnos are formatted like: +1.4166734124 It should be quite clear how *any* phone number in those c

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Karen Hill
Tom Lane wrote: > It doesn't seem particularly hard to make a type that stores just the > digits (applying whatever amount of error-checking seems appropriate > on the non-digit stuff it's throwing away) and on output regurgitates > a standardized format. Minimum support would just be an input f

Re: [GENERAL] Notes on converting from MySQL 5.0.x to PostgreSQL

2006-07-10 Thread Jan Wieck
On 6/30/2006 11:12 AM, Scott Marlowe wrote: I agree with Tom, nice notes. I noted a few minor issues that seem to derive from a familiarity with MySQL. I'll put my corrections below... On Fri, 2006-06-30 at 08:17, Jason McManus wrote: On Converting from MySQL 5.0.x to PostgreSQL 8.1.x ---

Re: [GENERAL] encoding bug or feature?

2006-07-10 Thread Jorge Godoy
marcelo Cortez <[EMAIL PROTECTED]> writes: > Jorge > > > the postgreslq.conf say > > > lc_messages = 'es_AR' # locale for > system error message > # strings > lc_monetary = 'es_AR' # locale for > monetary formatting > lc_

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Steve Crawford
Steve Atkins wrote: ... Should the telephone type be able to do something such as: SELECT * from tableFOO where telephone.areacode = 555; Maybe, but is that useful? Maybe America is different, but my experience in NL and AU is that you rarely care about the areacode anyway, so why would you w

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread SCassidy
In California, we definitely care about the area code, as there are several area codes (at least 4) in San Diego County. I have to use 1+area code to dial home from work, and vice-versa. Susan Martijn van

Re: [GENERAL] Getting Primary Key Value After Insert

2006-07-10 Thread Nikolay Samokhvalov
As a alternative way, you may forget about sequence name and create rule for you table - simple rule that will make 'SELECT idColumnName' on every INSERT action. After trying several approaches I've chosen this way in my projects. It's better way if you have some framework (R2O layer or smth). On

Re: [GENERAL] Procedural language functions across servers

2006-07-10 Thread Mark Morgan Lloyd
Michael Fuhr wrote: > dbi-link is an alternative to dblink that uses Perl/DBI: > > http://pgfoundry.org/projects/dbi-link/ > > > is this the only way available if additional procedural languages > > are installed? > > With the untrusted version of a language you can do essentially > anything th

Re: [GENERAL] encoding bug or feature?

2006-07-10 Thread marcelo Cortez
Jorge the postgreslq.conf say lc_messages = 'es_AR' # locale for system error message # strings lc_monetary = 'es_AR' # locale for monetary formatting lc_numeric = 'es_AR'# locale for number formatt

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Steve Atkins
On Jul 10, 2006, at 11:07 AM, Martijn van Oosterhout wrote: On Mon, Jul 10, 2006 at 10:33:52AM -0700, Karen Hill wrote: Hello, How would one go about creating a US telephone type in the format of "(555)-555-" ? I am at a loss on how it could be accomplished in the most correct way possib

timestamp with definable accuracy, was: Re: [GENERAL] empty text fields

2006-07-10 Thread Karsten Hilbert
On Thu, Jun 29, 2006 at 12:02:40PM +0200, Alban Hertroys wrote: > This kind of reeks like a begin/end date and an accuracy quantifier, > though that wouldn't account for option 6. > > Your cases 0 to 5 and 7 would be transformed into something like: ... > Where I defined '5' as being accurate, a

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Tom Lane
"Karen Hill" <[EMAIL PROTECTED]> writes: > How would one go about creating a US telephone type in the format of > "(555)-555-" ? Are you sure that's what you want? Even within the US there's the issue of extension numbers; I'm not sure how useful it is to have a datatype that refuses anything

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Vivek Khera
On Jul 10, 2006, at 3:46 PM, Richard Broersma Jr wrote: Also, due to the problem of keeping area codes segregated in large growing population centers, there is strong talk about allowing overlapping area codes. Dialing locally will require 11 digits instead of the usual 7. around here

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Richard Broersma Jr
> > Is the difficulty of creating a telephone type the reason it is not in > > postgresql already? > > > > Should the telephone type be able to do something such as: > > > > SELECT * from tableFOO where telephone.areacode = 555; > > > > Or would regex be better? > > makes more sense to store them

[GENERAL] unsubscribe

2006-07-10 Thread Harshal Shah
-- Harshal Shah

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Jorge Godoy
"Karen Hill" <[EMAIL PROTECTED]> writes: > Hello, > > How would one go about creating a US telephone type in the format of > "(555)-555-" ? I am at a loss on how it could be accomplished in > the most correct way possible while not going into the various > different country styles e.g. +01 (5

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Vivek Khera
On Jul 10, 2006, at 1:33 PM, Karen Hill wrote: Is the difficulty of creating a telephone type the reason it is not in postgresql already? Should the telephone type be able to do something such as: SELECT * from tableFOO where telephone.areacode = 555; Or would regex be better? makes more s

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Martijn van Oosterhout
On Mon, Jul 10, 2006 at 10:33:52AM -0700, Karen Hill wrote: > Hello, > > How would one go about creating a US telephone type in the format of > "(555)-555-" ? I am at a loss on how it could be accomplished in > the most correct way possible while not going into the various > different country

Re: [GENERAL] encoding bug or feature?

2006-07-10 Thread Jorge Godoy
marcelo Cortez <[EMAIL PROTECTED]> writes: > folks > > > select ucase( 'ñ'); -> 'ñ' > i want this statemen return 'Ñ' > any ideas? test=# select upper( 'ñ'); upper --- Ñ (1 record) test=# Maybe your locale settings are wrong... -- Jorge Godoy <[EMAIL PROTECTED]>

Re: [GENERAL] Aim of --enable-thread-safety ?

2006-07-10 Thread Martijn van Oosterhout
On Mon, Jul 10, 2006 at 01:39:44PM -0400, Bruce Momjian wrote: > Uh, the documentation is very clear on the purpose of this option: > >--enable-thread-safety > > > Make the client libraries thread-safe. This allows > concurrent threads in libpq and >

[GENERAL] encoding bug or feature?

2006-07-10 Thread marcelo Cortez
folks select ucase( 'ñ'); -> 'ñ' i want this statemen return 'Ñ' any ideas? best regards mdc _ Horóscopos, Salud y belleza, Chistes, Consejos de amor: el contenido más divertido para tu celular está en Yahoo! M

[GENERAL] US Telephone Number Type

2006-07-10 Thread Karen Hill
Hello, How would one go about creating a US telephone type in the format of "(555)-555-" ? I am at a loss on how it could be accomplished in the most correct way possible while not going into the various different country styles e.g. +01 (555) 555-. Is the difficulty of creating a teleph

Re: [GENERAL] Aim of --enable-thread-safety ?

2006-07-10 Thread Bruce Momjian
Christopher Browne wrote: > [EMAIL PROTECTED] (DANTE Alexandra) wrote: > > I wonder if this compilation option is really taken into account as > > PostgreSQL is not multi-threading but multi-processing. > > I have read that without this option, the libpq won't know anything > > about threads and ma

Re: [GENERAL] VACUUM FULL versus CLUSTER ON

2006-07-10 Thread Lincoln Yeoh
At 10:50 AM 7/10/2006 -0500, Scott Marlowe wrote: On Sat, 2006-07-08 at 10:20, Joshua D. Drake wrote: > > > > Unfortunately it would appear that I cannot vacuum full either as I get an > > out of memory error: Also, this kind of points out that you might not have enough swap space. On most d

Re: [GENERAL] VACUUM FULL versus CLUSTER ON

2006-07-10 Thread Joshua D. Drake
> The box has 8G of RAM and 10G swap space available to it (almost none of > which touched). The problem was that the VACUUM FULL process never > released any memory. With maintenance work mem set to 512MB, I would > think that it would be enforced such that any given connection would > only be al

Re: [GENERAL] VACUUM FULL versus CLUSTER ON

2006-07-10 Thread Sven Willenberger
On Mon, 2006-07-10 at 10:50 -0500, Scott Marlowe wrote: > On Sat, 2006-07-08 at 10:20, Joshua D. Drake wrote: > > > > > > Unfortunately it would appear that I cannot vacuum full either as I get an > > > out of memory error: > > > > > > > > > # - Memory - > > > > > > shared_buffers = 5000

Re: [GENERAL] VACUUM FULL versus CLUSTER ON

2006-07-10 Thread Scott Marlowe
On Sat, 2006-07-08 at 10:20, Joshua D. Drake wrote: > > > > Unfortunately it would appear that I cannot vacuum full either as I get an > > out of memory error: > > > > > > # - Memory - > > > > shared_buffers = 5000 # min 16, at least max_connections*2, 8KB > > each work_mem = 131072

Re: [GENERAL] Background Writer and performances

2006-07-10 Thread DANTE Alexandra
These graphs represent traffic to the disks, and have been generated from a "home-made" tool based on "top", "vmstat" and "iostat". Only PostgreSQL accesses to them, a JVM is launched via BenchmarkSQL but does not access to the disks on which are stored the data. BenchmarkSQL stores its reports

Re: [GENERAL] Background Writer and performances

2006-07-10 Thread DANTE Alexandra
Hello List, I have uploaded charts on a ftp server. You can access to these 6 graphs by doing ftp visibull.frec.bull.fr login : ftp password : ftp You are under the "/" directory and with "ls" command you see the directory "PGS_bgwriter". In this directory, the 3 charts joined to this e-mail a

Re: [GENERAL] Background Writer and performances

2006-07-10 Thread Martijn van Oosterhout
On Mon, Jul 10, 2006 at 05:06:56PM +0200, DANTE Alexandra wrote: > Hello List, > > I have uploaded charts on a ftp server. > You can access to these 6 graphs by doing > ftp visibull.frec.bull.fr Or more easily, by putting this in your web-browser: ftp://visibull.frec.bull.fr/PGS_bgwriter/ I'm p

Re: [GENERAL] Background Writer and performances

2006-07-10 Thread Martijn van Oosterhout
On Mon, Jul 10, 2006 at 02:56:48PM +0200, DANTE Alexandra wrote: > ** > I would like to send charts to show you exactly what happens on the > server but, with the pictures, this e-mail is not posted on the mailing > list. > I can send charts to a personal e-mail ad

Re: [GENERAL] Aim of --enable-thread-safety ?

2006-07-10 Thread Christopher Browne
[EMAIL PROTECTED] (DANTE Alexandra) wrote: > I wonder if this compilation option is really taken into account as > PostgreSQL is not multi-threading but multi-processing. > I have read that without this option, the libpq won't know anything > about threads and may indeed have problems, but could yo

[GENERAL] Background Writer and performances

2006-07-10 Thread DANTE Alexandra
Hello List, I’m using BenchmarkSQL to evaluate, characterize and optimize PostgreSQL in transaction processing. I work with PostgreSQL 8.1.3 on RHEL4-AS, Itanium-2 processor, 8GB RAM. The database, generated via BenchmarkSQL and used, is a 200-warehouses database and its size is about 20GB.

Re: [GENERAL] Aim of --enable-thread-safety ?

2006-07-10 Thread DANTE Alexandra
Hello Martijn, Thank you for your answer. Just to be sure, the "--enable-thread-safety" option allows client libraries, which connect via libpq to a PostgreSQL database, to be multi-threaded, but each "postgres" process launched to etablish the connection is not multi-threaded. Consequently, P

Re: [GENERAL] Version/Change Management of functions?

2006-07-10 Thread Stephane Bortzmeyer
On Fri, Jul 07, 2006 at 02:08:08PM -0600, Michael Loftis <[EMAIL PROTECTED]> wrote a message of 28 lines which said: > Since there's no way to directly control whats in the DB via a VCS, > further, how do you verify that what is in the DB is also in the > VCS, etc? This is not a PostgreSQL-spe

Re: [GENERAL] Is OpenFTS dead?

2006-07-10 Thread Michael Glaesemann
On Jul 9, 2006, at 23:43 , Joshua D. Drake wrote: OpenFTS sits on top of Tsearch2. All it is is some high level apis (perl/python) to create a search engine using PostgreSQL and Tsearch2. Thanks for the clarification, Joshua. In response to the OT's question, do you know if OpenFTS is still

[GENERAL] How to restrict select from table with external validation?

2006-07-10 Thread Vladimir A. Petrov
Hello! I have table like CREATE TABLE stats ( username varchar(256) NOT NULL, "time" int8 NOT NULL, duration int4 NOT NULL, phonenumber varchar(20) NOT NULL, and so on ... ) I have function like CREATE OR REPLACE FUNCTION auth("varchar", "varchar") RETURNS bool AS ' ... ' LANGUAGE

Re: [GENERAL] Aim of --enable-thread-safety ?

2006-07-10 Thread Martijn van Oosterhout
On Mon, Jul 10, 2006 at 11:47:06AM +0200, DANTE Alexandra wrote: > Hello List, > > I wonder if this compilation option is really taken into account as > PostgreSQL is not multi-threading but multi-processing. > I have read that without this option, the libpq won't know anything > about threads a

[GENERAL] Aim of --enable-thread-safety ?

2006-07-10 Thread DANTE Alexandra
Hello List, I wonder if this compilation option is really taken into account as PostgreSQL is not multi-threading but multi-processing. I have read that without this option, the libpq won't know anything about threads and may indeed have problems, but could you explain me how this option runs

Re: [GENERAL] Problem with COPY

2006-07-10 Thread A. Kretschmer
am 10.07.2006, um 10:21:59 +0200 mailte Christian Rengstl folgendes: > Hi everyone, > > I have a table with a surrogate key which is an integer sequence. Is > there a way to load a file using COPY and tell postgresql not to > insert into the primary key column? Yes: test=# create table foobar (

Re: [GENERAL] VACUUM and fsm_max_pages

2006-07-10 Thread DANTE Alexandra
Hi Scott, hi List Thank you for your answer. I will try to launch one VACUUM FULL the next time, and I will continue to execute VACUUM between two tests. I increased max_fsm_pages until 100, but I think it's not a good solution... Regards, Alexandra Scott Marlowe wrote: On Fri, 2006

[GENERAL] Problem with COPY

2006-07-10 Thread Christian Rengstl
Hi everyone, I have a table with a surrogate key which is an integer sequence. Is there a way to load a file using COPY and tell postgresql not to insert into the primary key column? Thanks! Chris -- Christian Rengstl M.A. Klinik und Poliklinik für Innere Medizin II Kardiologie - Forschung Uni