Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Tomasz Ostrowski
On Wed, 26 Jul 2006, Tom Lane wrote: Antimon [EMAIL PROTECTED] writes: As the id field is primary key, it should generate a unique violation if duplicate ids created, might be seen rarely but wanted to solve it anyway. Why don't you just use a serial generator? If I may interrupt:

Re: [GENERAL] Database corruption with Postgre 7.4.2 on FreeBSD 6.1?

2006-07-27 Thread Shoaib Mir
It shouldnt run into these problems from time to time, that kind of a scenario only happened to me once so dont know exactly how often this can happen. But a recommendation from my end will be to upgrade to the newer PostgreSQL version as you are using an old release. Also try running some disk

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Lexington Luthor
Tomasz Ostrowski wrote: On Wed, 26 Jul 2006, Tom Lane wrote: Antimon [EMAIL PROTECTED] writes: As the id field is primary key, it should generate a unique violation if duplicate ids created, might be seen rarely but wanted to solve it anyway. Why don't you just use a serial generator? If I

Re: [GENERAL] Mapping/DB Migration tool

2006-07-27 Thread Karsten Hilbert
On Wed, Jul 26, 2006 at 08:48:14AM -0700, Reece Hart wrote: In case your interested in these pgtools views, I've uploaded them to http://harts.net/reece/pgtools/ . I am looking into it. Any chance you could do a text dump with --no-owner --no-acl ? Thanks, Karsten -- GPG key ID E4071346 @

[GENERAL] PostgreSQL and Windows 2003 DFS Replication

2006-07-27 Thread Arnaud Lesauvage
Hi list ! I am currently deploying two servers (Windows 2003 R2) that will be used as file servers as well as PostgreSQL servers. One of the server will be the main server, the other one a backup server (no load-balancing, only an easy-recoverage solution). The goal is to be able to start

[GENERAL] Shared buffers

2006-07-27 Thread Christian Rengstl
Hi list, just wanted to ask what is a good/reasonable value for the shared_bufferes variable. Right now i set it to 64000 on a windows 2003 server with 1GB ram and 3.2 GHz which runs as file server (for only a small number of users) and db server. Thanks -- Christian Rengstl M.A. Klinik und

[GENERAL] Database Oid from SPI

2006-07-27 Thread Markus Schiltknecht
Hi, how can I get the database name or OID of the current backend in a SPI function (in plain C)? I tried including storage/proc.h and accessing MyProc-databaseId, but that leads to a segfault :-( (and seems like the wrong way to do it.) The SPI documentation didn't help. Thank you

Re: [GENERAL] Database Oid from SPI

2006-07-27 Thread Markus Schiltknecht
Whoops, sorry, there was another reason for the segfault. Using MyProc-databaseId works. Is it the right way to do it, though? Markus Schiltknecht wrote: Hi, how can I get the database name or OID of the current backend in a SPI function (in plain C)? I tried including storage/proc.h and

Re: [GENERAL] Database Oid from SPI

2006-07-27 Thread Alvaro Herrera
Markus Schiltknecht wrote: Whoops, sorry, there was another reason for the segfault. Using MyProc-databaseId works. Is it the right way to do it, though? I'd use MyDatabaseId ... -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication,

[GENERAL] JDBC

2006-07-27 Thread gustavo halperin
Hello I'm new with DB, I'm reading the PostgreSQL doc 8.1. I almost use the PostgreSQL from the 'psql' terminal and also I prove the Toolkit Tora, and Open Office using ODBC driver. I have problem using the JDBC driver, I always receive the error: A driver is not registered for the URL

Re: [GENERAL] Database Oid from SPI

2006-07-27 Thread Tom Lane
Markus Schiltknecht [EMAIL PROTECTED] writes: Whoops, sorry, there was another reason for the segfault. Using MyProc-databaseId works. Is it the right way to do it, though? Actually I'd recommend you use the global MyDatabaseId from miscadmin.h. It'll be the same value, but it's always best

Re: [GENERAL] JDBC

2006-07-27 Thread Adrian Klaver
On Wednesday 26 July 2006 11:54 am, gustavo halperin wrote: Hello I'm new with DB, I'm reading the PostgreSQL doc 8.1. I almost use the PostgreSQL from the 'psql' terminal and also I prove the Toolkit Tora, and Open Office using ODBC driver. I have problem using the JDBC driver, I always

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Tomasz Ostrowski
On Thu, 27 Jul 2006, Lexington Luthor wrote: Session id's for web cannot be predictable because this will create a security hole in application. Using a sequence does not mean it will be predictable. In the past I have used something similar to this: SELECT md5('secret_salt' ||

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Chris Mair
SELECT md5('secret_salt' || nextval('my_seq')::text) * When somebody knows md5('secret_salt' || '5') he will be able to easily compute md5('secret_salt' || '50') md5('secret_salt' || '51') md5('secret_salt' || '52') ... md5('secret_salt' || '59')

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Tom Lane
Tomasz Ostrowski [EMAIL PROTECTED] writes: * When somebody knows md5('secret_salt' || '5') he will be able to easily compute md5('secret_salt' || '50') md5('secret_salt' || '51') Sure, but can't you fix that by putting the secret part at the end? * PostgreSQL integers (as

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Alvaro Herrera
Tom Lane wrote: * Any database user is most of the time able to read function bodies, so anybody who is able co connect to your database will be able to get your 'secret_salt' and then predict session id's. Yeah, it's not clear where to hide the secret. In a memfrob'ed (or something

Re: [GENERAL] Database Oid from SPI

2006-07-27 Thread Markus Schiltknecht
Hi, thank you both. I first tried that, but the segfault really irritated me. It's now working fine with miscadmin.h. Sorry for the noise. Regards Markus Tom Lane wrote: Actually I'd recommend you use the global MyDatabaseId from miscadmin.h. It'll be the same value, but it's always best

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Rodrigo Gonzalez
I'm not an expert as you, but what about a small table where just one user can read and create the function with this same user and definer security? Excuse if I say something stupid Alvaro Herrera wrote: Tom Lane wrote: * Any database user is most of the time able to read function

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Tomasz Ostrowski
On Thu, 27 Jul 2006, Tom Lane wrote: Tomasz Ostrowski [EMAIL PROTECTED] writes: * When somebody knows md5('secret_salt' || '5') he will be able to easily compute md5('secret_salt' || '50') md5('secret_salt' || '51') Sure, but can't you fix that by putting the secret part at

[GENERAL] UTF-8, upper() and Chinese characters yielding blank result

2006-07-27 Thread Scott Eade
While I could see various multibyte issues in the archives and in the TODO list, I couldn't spot this exact issue: I am working with a database that uses UNICODE encoding. I have a varchar column (col_x) that includes a mix of Chinese and regular ASCII characters. On PostgreSQL 7.4.13 (on

[GENERAL] Permissions to connect to postgres database

2006-07-27 Thread Jasbinder Bali
Hi,I have a database in postgres and i've given trusted permissions to all making required changesin pg_hba.conf.Now, I'm trying to connect to the database using ECPG. Unfortunately afterEXEC SQL CONNECT dbxyz gives me error -402 that means i don't have permissions to the database.I'm running this

[GENERAL] Update entire column with new date values

2006-07-27 Thread Weiss, Kevin
Hi all, I have a simple table which contains information about our safety files: CREATE TABLE docs ( filename varchar(256) NOT NULL, filepath varchar(256) NOT NULL, version varchar(8), date timestamp NOT NULL, docid int8 NOT NULL DEFAULT nextval('docs_docid_seq'::regclass), category

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Joshua D. Drake
Alvaro Herrera wrote: Tom Lane wrote: * Any database user is most of the time able to read function bodies, so anybody who is able co connect to your database will be able to get your 'secret_salt' and then predict session id's. Yeah, it's not clear where to hide the secret. In a memfrob'ed

Re: [GENERAL] Permissions to connect to postgres database

2006-07-27 Thread Richard Huxton
Jasbinder Bali wrote: Hi, I have a database in postgres and i've given trusted permissions to all making required changes in pg_hba.conf. Now, I'm trying to connect to the database using ECPG. Unfortunately after EXEC SQL CONNECT dbxyz gives me error -402 that means i don't have permissions to

Re: [GENERAL] PostgreSQL and Windows 2003 DFS Replication

2006-07-27 Thread Merlin Moncure
On 7/27/06, Arnaud Lesauvage [EMAIL PROTECTED] wrote: Hi list ! I am currently deploying two servers (Windows 2003 R2) that will be used as file servers as well as PostgreSQL servers. One of the server will be the main server, the other one a backup server (no load-balancing, only an

Re: [GENERAL] Permissions to connect to postgres database

2006-07-27 Thread Jasbinder Bali
How do i turn on the connection logging and then how do you actually check it?On 7/27/06, Richard Huxton dev@archonet.com wrote:Jasbinder Bali wrote: Hi, I have a database in postgres and i've given trusted permissions to all making required changes in pg_hba.conf. Now, I'm trying to connect to

Re: [GENERAL] Update entire column with new date values

2006-07-27 Thread Richard Huxton
Weiss, Kevin wrote: I need to update the date for each file (the date filename columns). However, the updated values for date are not the same for each file (due to when the files were last modified). I can import the new date values from a text file containing the date and filename. What

Re: [GENERAL] Permissions to connect to postgres database

2006-07-27 Thread Richard Huxton
Jasbinder Bali wrote: How do i turn on the connection logging and then how do you actually check it? Log settings are in your postgresql.conf file and are detailed in this part of the manual: http://www.postgresql.org/docs/8.1/static/runtime-config-logging.html Where your logfiles are

Re: [GENERAL] Update entire column with new date values

2006-07-27 Thread A. Kretschmer
am 27.07.2006, um 10:17:48 -0500 mailte Weiss, Kevin folgendes: I need to update the date for each file (the date filename columns). However, the updated values for date are not the same for each file (due to when the files were last modified). I can import the new date values from a text

Re: [GENERAL] PostgreSQL and Windows 2003 DFS Replication

2006-07-27 Thread Csaba Nagy
for a cold/warm standby postgresql backup, I'd suggest using pitr. I found that PITR using WAL shipping is not protecting against all failure scenarios... it sure will help if the primary machine's hardware fails, but in one case it was useless for us: the primary had a linux kernel with buggy

Re: [GENERAL] Mapping/DB Migration tool

2006-07-27 Thread Reece Hart
On Thu, 2006-07-27 at 13:02 +0200, Karsten Hilbert wrote: Any chance you could do a text dump with --no-owner --no-acl ? The pgdump is already --no-owner, but I forgot --no-acl. I just uploaded a new tarball using both flags. BTW, you can generate this yourself with what you have using

[GENERAL] Can't start PostgreSQL

2006-07-27 Thread Ian Johnson
Hi List I want to develop an application in PostgreSQL but when starting the service I get the following message: An old version of the database format was found. You need to upgrade the data format before using PostgreSQL. See /usr/share/doc/postgresql-8.1.4/README.rpm-dist for more

[GENERAL] PostgreSQL theoretical maximums.

2006-07-27 Thread Karen Hill
How many tables and rows can PostgreSQL theoretically and then practically handle? What is the largest database size possible? What was the biggest database you've ever had on PostgreSQL? What were the challenges and what kind of hardware and OS works best? What is an effective way to predict

[GENERAL] PostgreSQL theoretical maximums.

2006-07-27 Thread Karen Hill
How many tables can PostgreSQL theoretically and then practically handle? What is the largest database size possible? What was the biggest database you've ever had on PostgreSQL? What were the challenges and what kind of hardware and OS works best? What is an effective way to predict database

Re: [GENERAL] Can't start PostgreSQL

2006-07-27 Thread Richard Huxton
Ian Johnson wrote: Hi List I want to develop an application in PostgreSQL but when starting the service I get the following message: An old version of the database format was found. You need to upgrade the data format before using PostgreSQL. See /usr/share/doc/postgresql-8.1.4/README.rpm-dist

Re: [GENERAL] PostgreSQL theoretical maximums.

2006-07-27 Thread Richard Huxton
Karen Hill wrote: How many tables can PostgreSQL theoretically and then practically handle? What is the largest database size possible? What was the biggest database you've ever had on PostgreSQL? What were the challenges and what kind of hardware and OS works best? Maximum number of tables

[GENERAL] Backslash as ordinary char vs. not; set via a connection/session variable

2006-07-27 Thread Ken Johanson
Tom and folks, Will it be possible to set this more standard backslash handling behavior -- and possibly similar conformance modes... in a way similar to how mysql allows? They allow one to issue commands on the connection like: SET SESSION sql_mode = 'NO_BACKSLASH_ESCAPES,IGNORE_SPACE,ANSI'

Re: [GENERAL] PostgreSQL theoretical maximums.

2006-07-27 Thread Peter Eisentraut
Karen Hill wrote: How many tables and rows can PostgreSQL theoretically and then practically handle? What is the largest database size possible? What was the biggest database you've ever had on PostgreSQL? What were the challenges and what kind of hardware and OS works best? What is an

[GENERAL] Using an alternate PGDATA on RHEL4 with SELinux enabled

2006-07-27 Thread David Esposito
I just tried installing Postgres 8.1.4 (RPMs from postgresql.org web site) on a clean RHEL4 Update 2 machine that had SELinux enabled. When I created a /etc/sysconfig/pgsql/postgresql config file with PGDATA=/data/pgdata I was unable to get the start script (/etc/init.d/postgresql) to populate

Re: [GENERAL] UTF-8, upper() and Chinese characters yielding blank result

2006-07-27 Thread Peter Eisentraut
Scott Eade wrote: The problem appears on PostgreSQL 8.0.7 (on WinXP) PostgreSQL 8.0 on Windows does not support UTF-8. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Can't start PostgreSQL

2006-07-27 Thread Casey Duncan
It seems you were running a pre-8.x postgresql version before, its data files are not compatible with the new version you have now. You'll need to find out the version that used to be installed by looking at the PG_VERSION file in your postgres data directory. Once you do that you will

[GENERAL] server administration problem: Database startup and permissions

2006-07-27 Thread Jasbinder Bali
Hi,I created a database cluster using the following commands as per what is given in the postgres server administration manualroot# mkdir /usr/local/pgsql/jasroot# chown jsbali /usr/local/pgsql/jasroot# su jsbali jsbali# initdb -D /usr/local/pgsql/jasAfter that i tried to start up the postmaster

Re: [GENERAL] Generating unique session ids

2006-07-27 Thread Bruno Wolff III
On Thu, Jul 27, 2006 at 15:15:32 +0200, Tomasz Ostrowski [EMAIL PROTECTED] wrote: * PostgreSQL integers (as returned by nextval()) are 4 bytes. This means only 32 bit strength - much too low for today computers. They are actually 8 bytes. Since session ids aren't valuable for very long you

Re: [GENERAL] Backslash as ordinary char vs. not; set via a connection/session variable

2006-07-27 Thread Alvaro Herrera
Ken Johanson wrote: Tom and folks, Will it be possible to set this more standard backslash handling behavior -- and possibly similar conformance modes... in a way similar to how mysql allows? They allow one to issue commands on the connection like: SET SESSION sql_mode =

Re: [GENERAL] Backslash as ordinary char vs. not; set via a connection/session

2006-07-27 Thread Stefan Kaltenbrunner
Ken Johanson wrote: Tom and folks, Will it be possible to set this more standard backslash handling behavior -- and possibly similar conformance modes... in a way similar to how mysql allows? They allow one to issue commands on the connection like: SET SESSION sql_mode =

Re: [GENERAL] Backslash as ordinary char vs. not; set via a connection/session

2006-07-27 Thread Ken Johanson
Stefan Kaltenbrunner wrote: postgresql can do that in an even more powerful way - but people tend to not notice much of it in your case that would be: ALTER ROLE foo SET standard_conforming_strings='off' or even: ALTER DATABASE bar SET standard_conforming_strings='off' you can do that for

Re: [GENERAL] Can't start PostgreSQL

2006-07-27 Thread Bruno Wolff III
On Thu, Jul 27, 2006 at 10:22:33 -0600, Ian Johnson [EMAIL PROTECTED] wrote: I want to develop an application in PostgreSQL but when starting the service I get the following message: An old version of the database format was found. You need to upgrade the data format before using

Re: [GENERAL] Shared buffers

2006-07-27 Thread Shoaib Mir
Go to http://www.powerpostgresql.com/PerfList/ and see the shared_buffers settings section there.Thanks,-- Shoaib MirEnterpriseDB ( www.enterprisedb.com)On 7/27/06, Christian Rengstl [EMAIL PROTECTED] wrote:Hi list,just wanted to ask what is a good/reasonable value for the shared_bufferes

Re: [GENERAL] PostgreSQL theoretical maximums.

2006-07-27 Thread David Gagnon
Hi, Have a look at: http://www.postgresql.org/about/ /David Karen Hill wrote: How many tables can PostgreSQL theoretically and then practically handle? What is the largest database size possible? What was the biggest database you've ever had on PostgreSQL? What were the challenges and what

Re: [GENERAL] Backslash as ordinary char vs. not; set via a connection/session

2006-07-27 Thread Stefan Kaltenbrunner
Ken Johanson wrote: Stefan Kaltenbrunner wrote: postgresql can do that in an even more powerful way - but people tend to not notice much of it in your case that would be: ALTER ROLE foo SET standard_conforming_strings='off' or even: ALTER DATABASE bar SET

Re: [GENERAL] Using an alternate PGDATA on RHEL4 with SELinux enabled

2006-07-27 Thread Tom Lane
David Esposito [EMAIL PROTECTED] writes: I just tried installing Postgres 8.1.4 (RPMs from postgresql.org web site) on a clean RHEL4 Update 2 machine that had SELinux enabled. When I created a /etc/sysconfig/pgsql/postgresql config file with PGDATA=/data/pgdata I was unable to get the start

Re: [GENERAL] Backslash as ordinary char vs. not; set via a connection/session

2006-07-27 Thread Ken Johanson
Stefan Kaltenbrunner wrote: foo=# create table backslash(baz text); CREATE TABLE foo=# set standard_conforming_strings to on; SET foo=# insert into backslash values ('\\'); INSERT 0 1 foo=# set standard_conforming_strings to off; SET foo=# insert into backslash values ('\\'); WARNING:

Re: [GENERAL] Permissions to connect to postgres database

2006-07-27 Thread Shoaib Mir
You can turn on connection logging by setting the following in postgresql.conf file:log_connections = onlog_disconnections = onand this will log all the connections and disconnections to your database server in the db server log files. Thanks,-- Shoaib MirEnterpriseDB (www.enterprisedb.com)On

Re: [GENERAL] server administration problem: Database startup and permissions

2006-07-27 Thread Shoaib Mir
This is because in the pgadmin3 server settings for PostgreSQL database you did set the user as 'postgres' (default behavior) and never changed it. Now as you did run the 'initdb' process with user 'jsbali' so that is the user which exists in the database not the 'postgres' user. So the solution

Re: [GENERAL] UTF-8, upper() and Chinese characters yielding blank result

2006-07-27 Thread Martijn van Oosterhout
On Thu, Jul 27, 2006 at 07:22:17PM +0200, Peter Eisentraut wrote: Scott Eade wrote: The problem appears on PostgreSQL 8.0.7 (on WinXP) PostgreSQL 8.0 on Windows does not support UTF-8. In addition, PostgreSQL is totally reliant on the OS for upper/lower/collation support, so there is no way

[GENERAL] automatic and randomally population

2006-07-27 Thread gustavo halperin
Hello I want try my tables with some thousands of rows. There are any manner to make automatic and randomly population ?? Thank you, Gustavo ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] copy losing information

2006-07-27 Thread Silvela, Jaime \(Exchange\)
Thanks guys, The output of select version() is PostgreSQL 8.1.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.3 Tom, how and why would INSERTs be dropped on the client side? I'll be away next week, but when I get back I'll conduct iterations to find out how often this happens and if there

Re: [GENERAL] automatic and randomally population

2006-07-27 Thread Shoaib Mir
You can use loops (http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html). Are you trying to do some performance analysis for the database server? -- Shoaib MirEnterpriseDB (www.enterprisedb.com)On 7/28/06, gustavo halperin [EMAIL PROTECTED] wrote:Hello I want try my

Re: [GENERAL] copy losing information

2006-07-27 Thread Tom Lane
Silvela, Jaime \(Exchange\) [EMAIL PROTECTED] writes: Tom, how and why would INSERTs be dropped on the client side? [ shrug... ] I don't know your code; I was thinking about garden variety bugs in your ruby script. However, if you can make it happen just through psql \copy then that theory

Re: [GENERAL] Can't start PostgreSQL

2006-07-27 Thread Ian Johnson
Thank you all Deleting the old data base cleared up the problem. Ian On Thu, 2006-07-27 at 15:59 -0500, Bruno Wolff III wrote: On Thu, Jul 27, 2006 at 10:22:33 -0600, Ian Johnson [EMAIL PROTECTED] wrote: I want to develop an application in PostgreSQL but when starting the service

[GENERAL] newbie here

2006-07-27 Thread Thiago Germano Beier
Hi all, I'm using postgresql version 8.1 on FREEBSD 6.xsome info - bash-2.05b# pkg_info | grep postpostgresql-client-8.1.4 PostgreSQL database (client)postgresql-docs-8.1.4 The PostgreSQL documentation setpostgresql-relay-1.3.1 Multiplex multiple PostgreSQL databases to one

Re: [GENERAL] automatic and randomally population

2006-07-27 Thread gustavo halperin
On 7/28/06, Shoaib Mir [EMAIL PROTECTED] wrote: You can use loops (http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html ). Thanks Are you trying to do some performance analysis for the database server? Yes I will, but first I want see how the Open Office behave with

[GENERAL] Consulta de importar o restaurar base

2006-07-27 Thread Laboratorio Tux
Muy buenas, pues estoy dando mis primeros pininos en postgres, y pues me veo en la necesidad de restaurar un backup de una base que es de SQL SERVER, pero la verdad he buscado informacion sobre pg_restore y segun la informacion que tengo lo hago asi pg_restore -f nombre.bak pero no me funciona.

Re: [GENERAL] newbie here

2006-07-27 Thread Chris
Thiago Germano Beier wrote: Hi all, I'm using postgresql version 8.1 on FREEBSD 6.x some info - bash-2.05b# pkg_info | grep post postgresql-client-8.1.4 PostgreSQL database (client) postgresql-docs-8.1.4 The PostgreSQL documentation set postgresql-relay-1.3.1 Multiplex multiple