Re: [GENERAL] [Q] string to int hash function for small range

2009-03-07 Thread Scott Marlowe
On Sat, Mar 7, 2009 at 7:33 PM, V S P wrote: > I would like to have a function > given a user id varchar(64) to get a hash number between 0 and 255. > > I first tried md5 but the number it returns is very big and cannot > be converted to an INT > > there is likely a way to simply add ascii values

Re: [GENERAL] PostgreSQL upgrade from 8.2.3 to 8.3.5 (and also data migration)

2009-03-07 Thread Scott Marlowe
On Mon, Mar 2, 2009 at 10:36 PM, leela wrote: > Hi Friends, >  This is Leela from India. > > I am working on a project that requires upgrade on PostgreSQL version from > 8.2.3 to 8.3.5 on Unix platforms. Iam trying to write a shell script to do > the same. > > I search on the forum and found that

[GENERAL] PostgreSQL upgrade from 8.2.3 to 8.3.5 (and also data migration)

2009-03-07 Thread leela
Hi Friends,  This is Leela from India. I am working on a project that requires upgrade on PostgreSQL version from 8.2.3 to 8.3.5 on Unix platforms. Iam trying to write a shell script to do the same. I search on the forum and found that I need to use pg_dump and psql utility for data migration

Re: [GENERAL] [Q] string to int hash function for small range

2009-03-07 Thread Martin Gainty
or do a mod 256 e.g. mod(get_byte(md5(id),'hex'),256) HTH Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Send

Re: [GENERAL] [Q] string to int hash function for small range

2009-03-07 Thread hubert depesz lubaczewski
On Sat, Mar 07, 2009 at 09:33:33PM -0500, V S P wrote: > I would like to have a function > given a user id varchar(64) to get a hash number between 0 and 255. > > I first tried md5 but the number it returns is very big and cannot > be converted to an INT > > there is likely a way to simply add as

Re: [GENERAL] [Q] string to int hash function for small range

2009-03-07 Thread John R Pierce
V S P wrote: I would like to have a function given a user id varchar(64) to get a hash number between 0 and 255. I first tried md5 but the number it returns is very big and cannot be converted to an INT there is likely a way to simply add ascii values of the userId together to get a small integ

[GENERAL] [Q] string to int hash function for small range

2009-03-07 Thread V S P
I would like to have a function given a user id varchar(64) to get a hash number between 0 and 255. I first tried md5 but the number it returns is very big and cannot be converted to an INT there is likely a way to simply add ascii values of the userId together to get a small integer, but wanted

Re: [GENERAL] Enable user access from remote host

2009-03-07 Thread John R Pierce
Martin Gainty wrote: postgresql.conf : change listen_address to a real ip change it to '*' or you won't be able to use localhost... alternately, youc could specify ip.of.net.iface,localhost if you wanted to be specific. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.o

[GENERAL] Random Deadlock on DROP CONSTRAINT

2009-03-07 Thread Mark Mandel
All, I seem to have a weird one here. I'm using Hibernate on my application to generate my DDL for postGres whenever it starts up, so when doing automated testing, the database tends to get tables and constrains dropped quite regularly, so as to have stable test data to work from in each test. O

Re: [GENERAL] Enable user access from remote host

2009-03-07 Thread Martin Gainty
postgresql.conf : change listen_address to a real ip pg_hba.conf : configure your host/hostssl hostnossl as: # local DATABASE USER METHOD [OPTION] # host DATABASE USER CIDR-ADDRESS METHOD [OPTION] # hostsslDATABASE USER CIDR-ADDRESS METHOD [OPTION] # hostnossl DATABASE

[GENERAL] Enable user access from remote host

2009-03-07 Thread Piotre Ugrumov
Hi, I installed postgresql (for the first time) in my xubuntu. I created an user and now I would connect, from remote host, to the db with that user. How can I enable the remote access for the user created? Thanks, bye bye. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] open up firewall from "anywhere" to postgres ports?

2009-03-07 Thread Adrian Klaver
On Saturday 07 March 2009 1:27:02 pm Willy-Bas Loos wrote: > Hi, > > I have a very basic issue that i'd like to discuss > I have just recieved a newly installed database server. > I'm wondering if i should open up the ports to my two clusters 5432 > and 5433 from "Anywhere"? > As an alternative, i

Re: [GENERAL] open up firewall from "anywhere" to postgres ports?

2009-03-07 Thread Tom Lane
Willy-Bas Loos writes: > I'm wondering if i should open up the ports to my two clusters 5432 > and 5433 from "Anywhere"? No, not unless you'd like to take the risk of anyone on the internet poking into your databases. > I feel that it's a stupid question, since there is pg_hba, which > already d

[GENERAL] open up firewall from "anywhere" to postgres ports?

2009-03-07 Thread Willy-Bas Loos
Hi, I have a very basic issue that i'd like to discuss I have just recieved a newly installed database server. I'm wondering if i should open up the ports to my two clusters 5432 and 5433 from "Anywhere"? As an alternative, i could add each ip address both in the firewall and the pg_hba.conf. I f

[GENERAL] [Q] Cluster design for geographically separated dbs

2009-03-07 Thread V S P
Hello, I am designing a db to hold often changed user data. I just wanted to write down what I am thinking and ask people on the list to comment if they have any experiences in that area. My thought is to have say west-cost and east-cost data center and each user will go to either East Coast or

Re: [GENERAL] VACUUM

2009-03-07 Thread John R Pierce
Anderson dos Santos Donda wrote: Anyone can explain this: INFO: free space map contains 5848 pages in 5000 relations DETAIL: A total of 83728 page slots are in use (including overhead). 83728 page slots are required to track all free space. Current limits are: 153600 page slots, 5000 relation

Re: [GENERAL] problem with single quote in postgres 8.3.5

2009-03-07 Thread David Fetter
On Sat, Mar 07, 2009 at 05:53:21AM -0800, hugocoolens wrote: > I have a little php-script to help me learn foreign languages > In my php-code I have the following line: > $query="update wordlist set known=true where dutch='".$preceding."'"; With this kind of line, you are inviting an SQL injectio

Re: [GENERAL] problem with single quote in postgres 8.3.5

2009-03-07 Thread Raymond O'Donnell
On 07/03/2009 13:53, hugocoolens wrote: > I have a little php-script to help me learn foreign languages > In my php-code I have the following line: > $query="update wordlist set known=true where dutch='".$preceding."'"; > > This worked fine on a system running postgres 8.1, however in version > 8

[GENERAL] problem with single quote in postgres 8.3.5

2009-03-07 Thread hugocoolens
I have a little php-script to help me learn foreign languages In my php-code I have the following line: $query="update wordlist set known=true where dutch='".$preceding."'"; This worked fine on a system running postgres 8.1, however in version 8.3.5 something changed which makes records with the

[GENERAL] VACUUM

2009-03-07 Thread Anderson dos Santos Donda
Anyone can explain this: INFO: free space map contains 5848 pages in 5000 relations DETAIL: A total of 83728 page slots are in use (including overhead). 83728 page slots are required to track all free space. Current limits are: 153600 page slots, 5000 relations, using 1228 kB. NOTICE: max_fsm_

Re: [GENERAL] Newbie questions relating to transactions

2009-03-07 Thread Tom Lane
Carl Sopchak writes: > I have written a PL/pgSQL function that performs these calculations by > reading > the needed data, calculating, and saving the results. When run over a > smaller set of data, it works fine. But when I tried to run it over this > larger set of data, I got the error mes

[GENERAL] Newbie questions relating to transactions

2009-03-07 Thread Carl Sopchak
Hi, I'm new to pgsql (but not databases in general) and I've run into a roadblock that I'm having difficulty figuring out how to get around. Any help would be greatly appreciated! I'm using the database to store the results of calculations over data in some tables. There are a lot of data re

Re: [GENERAL] Installing a module for PostgreSQL

2009-03-07 Thread Devrim GÜNDÜZ
On Fri, 2009-03-06 at 16:57 +0100, A. Kretschmer wrote: > test=*# \i /usr/share/postgresql/8.3/contrib/uuid-ossp.sql It may require uuid to be installed on the server in order to operate. -- Devrim GÜNDÜZ, RHCE devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr

Re: [GENERAL] Postgres Cookbook

2009-03-07 Thread Stefan Kaltenbrunner
Raymond O'Donnell wrote: On 07/03/2009 05:50, Artacus wrote: Stefan Kaltenbrunner wrote: Tino Wildenhain wrote: what about a cookbook section on the main wiki? That would be great. Who do we need to talk to for that? AFAIK that once you register a community account you can just go ahead and

Re: [GENERAL] Postgres Cookbook

2009-03-07 Thread Raymond O'Donnell
On 07/03/2009 05:50, Artacus wrote: > Stefan Kaltenbrunner wrote: >> Tino Wildenhain wrote: > >> what about a cookbook section on the main wiki? > > That would be great. Who do we need to talk to for that? AFAIK that once you register a community account you can just go ahead and do it - it's a wi