Re: [GENERAL] ISO week dates

2006-11-23 Thread Alban Hertroys
Bruce Momjian wrote: Peter Eisentraut wrote: Brendan Jurd wrote: * add an ISO day format pattern to to_char() called 'ID', which starts at Monday = 1, and * add an ISO year field to extract() called 'isoyear'? That seems reasonable. Do you volunteer? Added to TODO: * Add ISO

Re: [GENERAL] MSSQL to PostgreSQL : Encoding problem

2006-11-23 Thread Arnaud Lesauvage
Brandon Aiken a écrit : It also might be a big/little endian problem, although I always thought that was platform specific, not locale specific. Try the UCS-2-INTERNAL and UCS-4-INTERNAL codepages in iconv, which should use the two-byte or four-byte versions of UCS encoding using the system's

Re: [GENERAL] log database changes - a design problem?

2006-11-23 Thread Martijn van Oosterhout
On Thu, Nov 23, 2006 at 08:53:28AM +0100, Luca Ferrari wrote: Hi all, I've got my database on which I'm building a Java application. Since I'd like to store information about who inserted and updated a specified record, I placed in my main tables a few additional fields to store such

Re: [GENERAL] log database changes - a design problem?

2006-11-23 Thread Andreas Kretschmer
Luca Ferrari [EMAIL PROTECTED] schrieb: Here comes my question: how can I catch user changes to each record in the database without be bored with user/date details? Anyone can suggest me a smart solution and/or database design? Anyone has already found such kind of problem? Perhaps is

Re: [GENERAL] 2 problems of my postgresql

2006-11-23 Thread Albe Laurenz
zenith siea wrote: see my operations first: [EMAIL PROTECTED] postgresql-8.0.8]# su postgres bash-2.05b$ initdb -D /usr/local/pgsql/data initdb: error while loading shared libraries: libssl.so.4: cannot open shared object file: No such file or directory bash-2.05b$ service postgresql status

Re: [GENERAL] URL Decoding

2006-11-23 Thread Arnaud Lesauvage
Tino Wildenhain a écrit : Arnaud Lesauvage schrieb: Hi List ! I am looking for an easy URL decoding function. I thought about using regexp_replace, but I cna't get it to work : SELECT regexp_replace('foo%B5bar', '%(..)', '\x\\1' , 'g'); 'fooxB5bar' I wanted to replace %BE with the

Re: [GENERAL] Trapping PL/Perl spi_query_exec errors

2006-11-23 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Worky Workerson [EMAIL PROTECTED] wrote: This is probably a really basic question, but how do I trap when spi_query_exec returns an error in PL/Perl? Tom Lane replied: I think you don't, without using plperlu :-(. Unless perhaps recent Perls

Re: [GENERAL] ISO week dates

2006-11-23 Thread Brendan Jurd
On 11/23/06, Alban Hertroys [EMAIL PROTECTED] wrote: Bruce Momjian wrote: Peter Eisentraut wrote: Brendan Jurd wrote: * add an ISO day format pattern to to_char() called 'ID', which starts at Monday = 1, and * add an ISO year field to extract() called 'isoyear'? That seems reasonable.

Re: [GENERAL] URL Decoding

2006-11-23 Thread Tino Wildenhain
Arnaud Lesauvage schrieb: Tino Wildenhain a écrit : Arnaud Lesauvage schrieb: Hi List ! I am looking for an easy URL decoding function. I thought about using regexp_replace, but I cna't get it to work : SELECT regexp_replace('foo%B5bar', '%(..)', '\x\\1' , 'g'); 'fooxB5bar' I wanted to

Re: [GENERAL] ISO week dates

2006-11-23 Thread Alban Hertroys
Brendan Jurd wrote: On 11/23/06, Alban Hertroys [EMAIL PROTECTED] wrote: Bruce Momjian wrote: Peter Eisentraut wrote: Brendan Jurd wrote: * add an ISO day format pattern to to_char() called 'ID', which starts at Monday = 1, and * add an ISO year field to extract() called 'isoyear'?

[GENERAL] Stuck in DELETE waiting

2006-11-23 Thread Alexander Staubo
My application's connections against PostgreSQL 8.1.4 seem to get stuck in deletion operations. Some sample ps output: postgres 18198 10.5 20.7 1072088 863040 ? S11:59 14:23 postgres: [...] DELETE waiting postgres 18204 11.5 20.8 1072692 867708 ? S11:59 15:43 postgres:

Re: [GENERAL] IS it a good practice to use SERIAL as Primary Key?

2006-11-23 Thread Jorge Godoy
Richard Broersma Jr [EMAIL PROTECTED] writes: The type names serial and serial4 are equivalent: both create integer columns. The type names bigserial and serial8 work just the same way, except that they create a bigint column. bigserial should be used if you anticipate the use of more than

Re: [GENERAL] OID Perfomance - Object-Relational databases

2006-11-23 Thread Kevin Field
Hi everyone, I just came across a thread in the pgsql archives from October 2000, and found this post particularly interesting: http://archives.postgresql.org/pgsql-sql/2000-10/msg00044.php ...because I had already been designing something similar but on a larger scale, for an integrated

Re: [GENERAL] IS it a good practice to use SERIAL as Primary Key?

2006-11-23 Thread Richard Broersma Jr
The type names serial and serial4 are equivalent: both create integer columns. The type names bigserial and serial8 work just the same way, except that they create a bigint column. bigserial should be used if you anticipate the use of more than 231 identifiers over the lifetime of the

Re: [GENERAL] ISO week dates

2006-11-23 Thread Brendan Jurd
On 11/24/06, Alban Hertroys [EMAIL PROTECTED] wrote: Brendan Jurd wrote: On 11/23/06, Alban Hertroys [EMAIL PROTECTED] wrote: Just verifying, but aren't both formats ISO? In that case maybe it'd be better to have a (per database) setting that specifies which one? The term ISO is broad and

Re: [GENERAL] Stuck in DELETE waiting

2006-11-23 Thread Tom Lane
Alexander Staubo [EMAIL PROTECTED] writes: My application's connections against PostgreSQL 8.1.4 seem to get stuck in deletion operations. ... # select * from pg_locks where pid in (18198, 18204, 18208, 18214, 18216); You really need to show all of pg_locks, not a subset. In this

[GENERAL] xx000:No connection could be made because the target machine actively refused it

2006-11-23 Thread chuanying
Hi, I've developed an application using Nhibernate with postgresql version 8.1.4. I have encountered an adhoc application shut down with the following error message in postgresql/data/pg_log: LOG: XX000: could not receive data from client: No connection could be made because the target machine

[GENERAL] Connecting to another postgres DB from pg/SQL

2006-11-23 Thread Szymanski, Michal (GE Money)
During execution of PL/pgSQL procedure I have to send somehow few date to another Postgress database. Is to possible to connect to other database , if yes what is performance of such solution? Is it possible to create DB link between two Postgres application? Michał Szymański

[GENERAL] Question about PG cache selection strategy

2006-11-23 Thread Sefer Tov
Hi, I'm running a very large and frequently updated database on a machine with relatively limited memory (you can safely assume that the database disk usage to available memory has a ratio of 10:1 - so clearly not all the pages can be retained in memory). The naive approach would presume

Re: [GENERAL] Postgres Team: Thank You All

2006-11-23 Thread Benjamin Smith
On Wednesday 20 September 2006 18:59, Brian Maguire wrote: I justed wanted to let you know how impressed and pleased I have been with postgres over the past 5 years . The timeliness and quality of the releases are always robust and stable. Every release has a very nice mix of admin,

[GENERAL] COPY FROM : out of memory

2006-11-23 Thread Arnaud Lesauvage
Hi list ! When trying to import a 20M rows csv file into PostgreSQL, I get : ERROR: out of memory État SQL :53200 Détail :Failed on request of size 1073741823. Contexte : COPY tmp, line 1 The table has no index, no trigger, ... : CREATE TABLE tmp ( c1 bigint, c2 character varying, c3

Re: [GENERAL] OID Perfomance - Object-Relational databases

2006-11-23 Thread Tom Lane
Kevin Field [EMAIL PROTECTED] writes: Either way, are 64-bit OIDs planned within the next couple years? No, they're not planned at all. That line of thought has pretty much died off, to the point where OIDs in user tables are not just deprecated but not there at all by default. There are

Re: [GENERAL] Connecting to another postgres DB from pg/SQL

2006-11-23 Thread Shoaib Mir
You can use the dblink ( http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/dblink/) contrib module for that purpose. Thanks, Shoaib Mir EnterpriseDB (www.enterprisedb.com) On 11/22/06, Szymanski, Michal (GE Money) [EMAIL PROTECTED] wrote: During execution of PL/pgSQL

Re: [GENERAL] Stuck in DELETE waiting

2006-11-23 Thread Alexander Staubo
On Nov 23, 2006, at 16:27 , Tom Lane wrote: Alexander Staubo [EMAIL PROTECTED] writes: My application's connections against PostgreSQL 8.1.4 seem to get stuck in deletion operations. ... # select * from pg_locks where pid in (18198, 18204, 18208, 18214, 18216); You really need to show all of

Re: [GENERAL] Stuck in DELETE waiting

2006-11-23 Thread Tom Lane
Alexander Staubo [EMAIL PROTECTED] writes: See below. Seems 18204 is waiting for a process that is idle in transaction; makes me wish that PostgreSQL could export more information about the age of in-progress transactions. I am turning on logging so I can determine what a future hanging

Re: [GENERAL] COPY FROM : out of memory

2006-11-23 Thread Tom Lane
Arnaud Lesauvage [EMAIL PROTECTED] writes: When trying to import a 20M rows csv file into PostgreSQL, I get : ERROR: out of memory État SQL :53200 Détail :Failed on request of size 1073741823. Contexte : COPY tmp, line 1 Can you put together a self-contained example? The reference to

[GENERAL] A generic trigger to log chanes on database tables

2006-11-23 Thread Charles Ambrose
Hi! Is there a way that I could create a trigger that logs the changes (updates, deletes) of a table? I mean, I want to put in a table the changes to any table in a database and also put in the table the column that was modified and the corresponding value. My audit table looks like this:

Re: [GENERAL] IS it a good practice to use SERIAL as Primary Key?

2006-11-23 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/22/06 20:23, carter ck wrote: Hi all, I am wonderring if it is a good practice to use SERIAL index as primary key, as it is only available up to 999? Currently i am dealing with storing LDAP users into Postgres and i am looking for

Re: [GENERAL] IS it a good practice to use SERIAL as Primary Key?

2006-11-23 Thread Martijn van Oosterhout
On Thu, Nov 23, 2006 at 10:23:55AM -0600, Ron Johnson wrote: For those times when and that when numeric sequences *are* needed (employee_id and account_number for example) they should include a check digit, to ensure that you don't mis-type a number and charge the wrong account. Sure, but the

Re: [GENERAL] COPY FROM : out of memory

2006-11-23 Thread Martijn van Oosterhout
On Thu, Nov 23, 2006 at 11:27:06AM -0500, Tom Lane wrote: Arnaud Lesauvage [EMAIL PROTECTED] writes: When trying to import a 20M rows csv file into PostgreSQL, I get : ERROR: out of memory État SQL :53200 Détail :Failed on request of size 1073741823. Contexte : COPY tmp, line 1

Re: [GENERAL] A generic trigger to log chanes on database tables

2006-11-23 Thread A. Kretschmer
am Fri, dem 24.11.2006, um 0:32:30 +0800 mailte Charles Ambrose folgendes: Hi! Is there a way that I could create a trigger that logs the changes (updates, deletes) of a table? I mean, I want to put in a table the changes to any table in a database and also put in the table the column that

Re: [GENERAL] COPY FROM : out of memory

2006-11-23 Thread Terry Fielder
Tom Lane wrote: Arnaud Lesauvage [EMAIL PROTECTED] writes: When trying to import a 20M rows csv file into PostgreSQL, I get : ERROR: out of memory État SQL :53200 Détail :Failed on request of size 1073741823. Contexte : COPY tmp, line 1 Can you put together a self-contained

Re: [GENERAL] Why overlaps is not working

2006-11-23 Thread Richard Broersma Jr
If my database contains dates greater than DATE '-12-31' then this check fails. This is why I'm searching for a real MAX_DATE value in Postgres. It would be nice if there will be MAX_DATE constant in Postgres or some one row system table contains MAX_DATE value. through

Re: [GENERAL] COPY FROM : out of memory

2006-11-23 Thread Arnaud Lesauvage
Martijn van Oosterhout a écrit : On Thu, Nov 23, 2006 at 11:27:06AM -0500, Tom Lane wrote: Arnaud Lesauvage [EMAIL PROTECTED] writes: When trying to import a 20M rows csv file into PostgreSQL, I get : ERROR: out of memory État SQL :53200 Détail :Failed on request of size 1073741823.

Re: [GENERAL] MSSQL to PostgreSQL : Encoding problem

2006-11-23 Thread Arnaud Lesauvage
Arnaud Lesauvage a écrit : Brandon Aiken a écrit : It also might be a big/little endian problem, although I always thought that was platform specific, not locale specific. Try the UCS-2-INTERNAL and UCS-4-INTERNAL codepages in iconv, which should use the two-byte or four-byte versions of UCS

Re: [GENERAL] MSSQL to PostgreSQL : Encoding problem

2006-11-23 Thread Tomi NA
2006/11/23, Arnaud Lesauvage [EMAIL PROTECTED]: Arnaud Lesauvage a écrit : Brandon Aiken a écrit : It also might be a big/little endian problem, although I always thought that was platform specific, not locale specific. Try the UCS-2-INTERNAL and UCS-4-INTERNAL codepages in iconv, which

Re: [GENERAL] IS it a good practice to use SERIAL as Primary Key?

2006-11-23 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/23/06 10:49, Martijn van Oosterhout wrote: On Thu, Nov 23, 2006 at 10:23:55AM -0600, Ron Johnson wrote: For those times when and that when numeric sequences *are* needed (employee_id and account_number for example) they should include a

Re: [GENERAL] IS it a good practice to use SERIAL as Primary Key?

2006-11-23 Thread Sander Steffann
Hi, Sure, but the check digit does not need to be stored, as it can be regenerated on demand. The user interface just verifies the check digit, then throws it away. $ SET GEEZER $ WRITE SYS$OUTPUT THAT'S JUST EXTRA CYCLES WASTED BY THE $ WRITE SYS$OUTPUT CLIENT. BETTER TO USE THEM FOR SOME

Re: [GENERAL] COPY FROM : out of memory

2006-11-23 Thread Alvaro Herrera
Arnaud Lesauvage wrote: Martijn van Oosterhout a écrit : On Thu, Nov 23, 2006 at 11:27:06AM -0500, Tom Lane wrote: Arnaud Lesauvage [EMAIL PROTECTED] writes: When trying to import a 20M rows csv file into PostgreSQL, I get : ERROR: out of memory État SQL :53200 Détail :Failed on

[GENERAL] pg_dump

2006-11-23 Thread Bob Pawley
This is the example found in the documentation to dump a database. Examples To dump a database: $ pg_dump mydb db.outThe following - $ pg_dump aurel aurel.out - gives me ERROR: syntax error at or near $ at character 1What am I missing???Bob

Re: [GENERAL] pg_dump

2006-11-23 Thread Konrad Neuwirth
To dump a database: $ pg_dump mydb db.out The following - $ pg_dump aurel aurel.out - gives me ERROR: syntax error at or near $ at character 1 What am I missing??? The $ character is there to indicate the prompt your shell gives you. If you leave it off at the beginning of your command,

Re: [GENERAL] pg_dump

2006-11-23 Thread Richard Broersma Jr
Examples To dump a database: $ pg_dump mydb db.outThe following - $ pg_dump aurel aurel.out - gives me ERROR: syntax error at or near $ at character 1What am I missing???Bob The $ isn't part of the command, it just just part of the shell's command-line prompt. My shell command

Re: [GENERAL] pg_dump

2006-11-23 Thread Bricklen Anderson
Bob Pawley wrote: This is the example found in the documentation to dump a database. Examples To dump a database: $ pg_dump mydb db.out The following - $ pg_dump aurel aurel.out - gives me ERROR: syntax error at or near $ at character 1 What am I missing??? Bob The $ is part

Re: [GENERAL] pg_dump

2006-11-23 Thread Bob Pawley
No joy pg_dump aurel aurel.out Returns - ERROR: syntax error at or near pg_dump at character 8 I've had a bit of trouble with the PostgreSQL system if that helps. (access violation with a reinstall) Bob - Original Message - From: Konrad Neuwirth [EMAIL PROTECTED] To: Bob Pawley

Re: [GENERAL] pg_dump

2006-11-23 Thread Richard Broersma Jr
No joy pg_dump aurel aurel.out Returns - ERROR: syntax error at or near pg_dump at character 8 I've had a bit of trouble with the PostgreSQL system if that helps. (access violation with a reinstall) that is a psql error message isn't it. pg_dump is a shell command that you would

Re: [GENERAL] pg_dump

2006-11-23 Thread jcradock
Bob, This command: pg_dump aurel ...should output the structure and contents of your aurel database to your screen SQL with comments. What version of PostgreSQL are you running and on what operating system? Jim No joy pg_dump aurel aurel.out Returns - ERROR: syntax error at or near

Re: [GENERAL] pg_dump

2006-11-23 Thread jcradock
Sorry. The command will output ... *AS* SQL with comments. Bob, This command: pg_dump aurel ...should output the structure and contents of your aurel database to your screen SQL with comments. What version of PostgreSQL are you running and on what operating system? Jim No joy

[GENERAL] Postgres scalability and performance on windows

2006-11-23 Thread Gopal
Hi all, I have a postgres installation thats running under 70-80% CPU usage while an MSSQL7 installation did 'roughly' the same thing with 1-2% CPU load. Here's the scenario, 300 queries/second Server: Postgres 8.1.4 on win2k server CPU: Dual Xeon 3.6 Ghz, Memory: 4GB RAM Disks: 3 x

Re: [GENERAL] pg_dump

2006-11-23 Thread Peter Wilson
Bob Pawley wrote: No joy pg_dump aurel aurel.out Returns - ERROR: syntax error at or near pg_dump at character 8 Looks like you're trying to run it from psql. pg_dump is a command line utility. Run it directly from the shell command prompt (or cmd window on windows). Pete I've had a

Re: [GENERAL] Postgres scalability and performance on windows

2006-11-23 Thread Thomas H.
i'm seeing the opposite here on our win32 pgsql instance. while mssql server used ~50% cpu constantly (AND consuming lots of memory, pgsql runs at a low 1-5% and gives better performance even under relatively high load. is the high cpu load coming from one particular postgres.exe process or is

Re: [GENERAL] pg_dump

2006-11-23 Thread Richard P. Welty
Bob Pawley wrote: No joy pg_dump aurel aurel.out Returns - ERROR: syntax error at or near pg_dump at character 8 I've had a bit of trouble with the PostgreSQL system if that helps. (access violation with a reinstall) how about giving the pg_dump command to a shell instead of inside psql?

Re: [GENERAL] IS it a good practice to use SERIAL as Primary Key?

2006-11-23 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/23/06 12:38, Sander Steffann wrote: Hi, Sure, but the check digit does not need to be stored, as it can be regenerated on demand. The user interface just verifies the check digit, then throws it away. $ SET GEEZER $ WRITE SYS$OUTPUT

Re: [GENERAL] Postgres scalability and performance on windows

2006-11-23 Thread Bill Moran
On Thu, 23 Nov 2006 22:31:40 - Gopal [EMAIL PROTECTED] wrote: Hi all, I have a postgres installation thats running under 70-80% CPU usage while an MSSQL7 installation did 'roughly' the same thing with 1-2% CPU load. Here's the scenario, 300 queries/second Server:

[GENERAL] tsearch to spellcheck

2006-11-23 Thread SunWuKung
Is it possible to use tsearch2 to check spelling? Something like a function that takes a single word (and a language id) and returns true if spelled correctly false otherwise. Thanks. Balazs ---(end of broadcast)--- TIP 3: Have you checked our

Re: [GENERAL] Stuck in DELETE waiting

2006-11-23 Thread Jerry Sievers
Alexander Staubo [EMAIL PROTECTED] writes: On Nov 23, 2006, at 16:27 , Tom Lane wrote: Alexander Staubo [EMAIL PROTECTED] writes: My application's connections against PostgreSQL 8.1.4 seem to get stuck in deletion operations. ... # select * from pg_locks where pid in (18198, 18204,

Re: [GENERAL] Postgres scalability and performance on windows

2006-11-23 Thread Merlin Moncure
On 11/23/06, Gopal [EMAIL PROTECTED] wrote: I have a postgres installation thats running under 70-80% CPU usage while an MSSQL7 installation did 'roughly' the same thing with 1-2% CPU load. i somehow doubt ms sql server is 35x faster than postgresql in production environments, even on