[GENERAL] [Slightly OT] data model books/resources?

2006-03-30 Thread Aaron Glenn
Anyone care to share the great books, articles, manifestos, notes, leaflets, etc on data modelling they've come across? Ideally I'd like to find a great college level book on data models, but I haven't come across one that even slightly holds definitive resource-type status. Feel free to reply

Re: [GENERAL] pgsql and streams

2006-03-30 Thread Christopher Condit
Back to this thread - I realize that in the COPY TO documentation, it states the CSV file used for loading must be on the server's disk. If I can't put files on the server's disk, I'm curious if I can use the STDIN option from my JDBC client to load the data to the server? Using psql I can

Re: [GENERAL] pgsql and streams

2006-03-30 Thread Tino Wildenhain
Christopher Condit schrieb: Back to this thread - I realize that in the COPY TO documentation, it states the CSV file used for loading must be on the server's disk. If I can't put files on the server's disk, I'm curious if I can use the STDIN option from my JDBC client to load the data to the

[GENERAL] How to detect primary key of a table

2006-03-30 Thread Sergey Karin
Hi, List!I use PG8.1Are there any abilities to detect primary key of a table?Sergey Karin

[GENERAL] converting timstamptz to local time zone

2006-03-30 Thread Peter Nixonn
How can I select ('2006-01-01 9:00:00+02' at time zone 'GMT')::timestamp; where instead of GMT it has the local time zone of the machine I am running it on (which varies between my machines)? I dont want to hard code the timezone of the machine into the query.. I want to pick it up from the

Re: [GENERAL] How to detect primary key of a table

2006-03-30 Thread Sergey Karin
Yes, it is not a problem via psql.But I want to detect primary key via libpq (e.g using select commands)2006/3/30, Michael Kleiser [EMAIL PROTECTED]:\d your_tablewill show it create table foobar ( foo int primary key, bar int ); NOTICE:CREATE TABLE / PRIMARY KEY will create implicit

Re: [GENERAL] How to detect primary key of a table

2006-03-30 Thread Tino Wildenhain
Sergey Karin schrieb: Yes, it is not a problem via psql. But I want to detect primary key via libpq (e.g using select commands) Look into informational-schema or start psql with the option -e then use \d+ and see what it prints :-) Regards Tino ---(end of

Re: [GENERAL] converting timstamptz to local time zone

2006-03-30 Thread Martijn van Oosterhout
On Thu, Mar 30, 2006 at 02:24:55PM +0300, Peter Nixonn wrote: How can I select ('2006-01-01 9:00:00+02' at time zone 'GMT')::timestamp; where instead of GMT it has the local time zone of the machine I am running it on (which varies between my machines)? I dont want to hard code the timezone of

Re: [GENERAL] How to detect primary key of a table

2006-03-30 Thread Michael Fuhr
On Thu, Mar 30, 2006 at 03:13:12PM +0400, Sergey Karin wrote: Are there any abilities to detect primary key of a table? In psql you could use \d tablename. To see the queries that psql makes, execute \set ECHO_HIDDEN and then \d tablename. Here's the documentation for the system catalogs that

[GENERAL] Chasing signal 11 issues

2006-03-30 Thread Tass Chapman
Since Monday I have been seeing terminated by signal 11 messages in my 7.4.6 + Slon 1.0.5 system,. but only on the masterI've done a dumapall, initdb and restore , which reduced the frequency but I still get them 6-8 times a day. After turning up logging it seemed to die when calling a very small

Re: [GENERAL] Chasing signal 11 issues

2006-03-30 Thread Douglas McNaught
Tass Chapman [EMAIL PROTECTED] writes: Since Monday I have been seeing terminated by signal 11 messages in my 7.4.6 + Slon 1.0.5 system,. but only on the master This kind of thing is almost always a hardware problem. 'memtest86' is probably a good first step, and see if any of your cooling

[GENERAL] Slony-I for circular replication

2006-03-30 Thread Bojidar Mihajlov
Hi All; Can Slony-I be used for circular replication (A replicates B replicates A) or there is some kind of problem with locking or anything else? If I avoid insert conflicts will the following scenario succeed for the updates : A: X.balance-= 5 B: X.balance-= 3 A receives the update

Re: [GENERAL] Slony-I for circular replication

2006-03-30 Thread Richard Huxton
Bojidar Mihajlov wrote: Hi All; Can Slony-I be used for circular replication (A replicates B replicates A) or there is some kind of problem with locking or anything else? No - Slony is an asynchronous single-master replication scheme. As such changes are only allowed at a master node.

Re: [GENERAL] Chasing signal 11 issues

2006-03-30 Thread Tom Lane
Douglas McNaught [EMAIL PROTECTED] writes: Tass Chapman [EMAIL PROTECTED] writes: Since Monday I have been seeing terminated by signal 11 messages in my 7.4.6 + Slon 1.0.5 system,. but only on the master This kind of thing is almost always a hardware problem. 'memtest86' is probably a good

Re: [GENERAL] Chasing signal 11 issues

2006-03-30 Thread Scott Marlowe
On Thu, 2006-03-30 at 07:02, Tass Chapman wrote: Since Monday I have been seeing terminated by signal 11 messages in my 7.4.6 + Slon 1.0.5 system,. but only on the master I've done a dumapall, initdb and restore , which reduced the frequency but I still get them 6-8 times a day. After

Re: [GENERAL] pgsql and streams

2006-03-30 Thread Christopher Condit
Hi Tino - thanks for your response. Do you think that's the best way to go - just use Java to launch an external load command to psql.exe? Does anyone else know of a way to accomplish this with Java? Thanks, Chris -Original Message- From: Tino Wildenhain [mailto:[EMAIL PROTECTED]

[GENERAL] How to concat strings so that trailing spaces remain

2006-03-30 Thread Andrus
I have where clause where all fields are CHAR(10) type and may have trailing spaces. SELECT ... FROM r1, r2 WHERE r1.c1 || r1.c2 || r1.c3 = r2.c1 || r2.c2 || r2.c3; This WHERE clause produces wrong result since || operator removes trailing spaces. Correct result is produced if || operator

[GENERAL] User defined data type

2006-03-30 Thread Don Y
Hi, I'll hope this is the correct list for these questions... :-/ I need to define several unique data types. As my make one to throw away exercise, I rewrote the ISBN data type in the contrib directory (hopefully bringing it up to date as well as adding stricter checks in the parser and

Re: [GENERAL] How to concat strings so that trailing spaces remain

2006-03-30 Thread Tom Lane
Andrus [EMAIL PROTECTED] writes: I have where clause where all fields are CHAR(10) type and may have trailing spaces. ... Correct result is produced if || operator does not remove trailing spaces. If you think that trailing spaces are significant data, you should probably be using VARCHAR not

Re: [GENERAL] User defined data type

2006-03-30 Thread Martijn van Oosterhout
On Thu, Mar 30, 2006 at 11:51:41AM -0700, Don Y wrote: - I assume I don't have to check the return value from palloc()? (All of the src/backend/utils datatypes seem to trust it implicitly) BTW, where is the interface to palloc() et al. documented (or, is it a case of Use the Source,

Re: [GENERAL] User defined data type

2006-03-30 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: On Thu, Mar 30, 2006 at 11:51:41AM -0700, Don Y wrote: - Can *_in() be ever invoked with a NULL argument? Or, can I safely assume that the pointer I am passed is valid? You can't get a NULL there. Yes, the pointer is valid cstring. To be sure

[GENERAL] PSQL Data Type: text vs. varchar(n)

2006-03-30 Thread kurt _
I am having a problem with Sun Java Studio Creator because the latest version of the JDBC driver returns a field length of -1 for text fields. My question: Is a text field just a varchar(Integer.MAX_VALUE)? If I want to use the data binding part of the SJSC tool I will need to convert my

Re: [GENERAL] checking data type

2006-03-30 Thread raj
Hi, Chris (great looking site, by the way)! thanks for responding. i was just practicing on postgres and encountered this problem. i am using pg admin for postgres and for some reason the commands you posted does not seem to work. i was kinda looking for an built-in function like upper() or

[GENERAL] Use functions in Pl/Perl language

2006-03-30 Thread sylsau
Hello, I would like to create a function that lets me to search in a table rows according differents parameters. I looked in the documentation of postgresql 8.1 about Pl/Perl procedures but I didn't found how to cross each row of a table with Pl/Perl. Someone would have an example of that with

[GENERAL] Slony-I for circular replication

2006-03-30 Thread Bozhidar Mihaylov
Hi All; Can Slony-I be used for circular replication (A replicates Breplicates A) or there is some kind of problem with locking or anything else? If I avoid insert conflicts will the following scenario succeed for the updates : A: X.balance-= 5 B: X.balance-=3 Areceives the update from

Re: [GENERAL] Performance Killer 'IN' ?

2006-03-30 Thread Kai Hessing
and it took about 10 Minutes to execute. So it is nearly a hundred times slower. Can this be verified? Is there anything that can be done about that? Else I would need to have a few words with our programmers... OK... I overstated a little bit. The real numbers are: 1.) 21.5 seconds 2.) 363.7

[GENERAL] Recovery with pg_xlog

2006-03-30 Thread jayati . biswas
I have two questions: 1. In Postgresql, what is the name of the exact DATAFILE under the DATA DIRECTORY ? 2. We want to prepare a backup machine (for disaster management)by passing the pg_xlog diectory.First time we have made a base backup restore the backup server by this

[GENERAL] Performance Killer 'IN' ?

2006-03-30 Thread Kai Hessing
Hossa, I just made a little test on our test-database. I have an excel sheet with about 2000 entries that should be updated with the same value. In a first try I generated an SQL-Syntax for every entry like: UPDATE xyz SET status=-6 WHERE id=xyz1 AND status-1; UPDATE xyz SET status=-6 WHERE

Re: [GENERAL] Converting a database from LATIN1 to UTF-8

2006-03-30 Thread Kai Hessing
Tormod Omholt-Jensen wrote: We are upgrading our systems to handle new languages and therefore we need to change the encoding of our postgres database from LATIN1 to UTF-8. I have pg_dumped the database and imported it into the new UTF-8 base. It seems like this worked just fine. Can

Re: [GENERAL] PostgreSQL x Sybase

2006-03-30 Thread Mark Aufflick
I'm not aware of one, but I would also be very interested. Certainly Postgres is much more standards compliant. In terms of developer features, Postgres is also much more advanced. Sybase also has some unusual limitations in wierd areas like the maximum number of bytes of index per row. Sybase

Re: [GENERAL] Performance Killer 'IN' ?

2006-03-30 Thread Joshua D. Drake
Kai Hessing wrote: and it took about 10 Minutes to execute. So it is nearly a hundred times slower. Can this be verified? Is there anything that can be done about that? Else I would need to have a few words with our programmers... OK... I overstated a little bit. The real numbers are: 1.)

Re: [GENERAL] checking data type

2006-03-30 Thread Chris
raj wrote: Hi, Chris (great looking site, by the way)! thanks for responding. i was just practicing on postgres and encountered this problem. i am using pg admin for postgres and for some reason the commands you posted does not seem to work. i was kinda looking for an built-in function like

Re: [GENERAL] PSQL Data Type: text vs. varchar(n)

2006-03-30 Thread Chris
kurt _ wrote: I am having a problem with Sun Java Studio Creator because the latest version of the JDBC driver returns a field length of -1 for text fields. My question: Is a text field just a varchar(Integer.MAX_VALUE)? If I want to use the data binding part of the SJSC tool I will need to

Re: [GENERAL] FAQ 1.1

2006-03-30 Thread Bruce Momjian
Douglas McNaught wrote: Michael Talbot-Wilson [EMAIL PROTECTED] writes: How, really, do people pronounce PostgreSQL? Postgres The first sentence of the FAQ is: PPostgreSQL is pronounced IPost-Gres-Q-L/I, and is also sometimes referred to as just IPostgres/I. Is that

Re: [GENERAL] PSQL Data Type: text vs. varchar(n)

2006-03-30 Thread Chris Travers
Chris wrote: kurt _ wrote: I am having a problem with Sun Java Studio Creator because the latest version of the JDBC driver returns a field length of -1 for text fields. My question: Is a text field just a varchar(Integer.MAX_VALUE)? If I want to use the data binding part of the SJSC

Re: [GENERAL] PSQL Data Type: text vs. varchar(n)

2006-03-30 Thread Tom Lane
Chris [EMAIL PROTECTED] writes: kurt _ wrote: My question: Is a text field just a varchar(Integer.MAX_VALUE)? varchar has a max of 255 characters, You must be using some other database ;-) The current Postgres code has a physical limit of 1G bytes for any column value (and in practice

Re: [GENERAL] PSQL Data Type: text vs. varchar(n)

2006-03-30 Thread Uwe C. Schroeder
On Thursday 30 March 2006 21:27, Tom Lane wrote: Chris [EMAIL PROTECTED] writes: kurt _ wrote: My question: Is a text field just a varchar(Integer.MAX_VALUE)? varchar has a max of 255 characters, You must be using some other database ;-) The current Postgres code has a physical limit

Re: [GENERAL] [Slightly OT] data model books/resources?

2006-03-30 Thread Christopher Browne
In the last exciting episode, [EMAIL PROTECTED] (Aaron Glenn) wrote: Anyone care to share the great books, articles, manifestos, notes, leaflets, etc on data modelling they've come across? Ideally I'd like to find a great college level book on data models, but I haven't come across one that

Re: [GENERAL] PSQL Data Type: text vs. varchar(n)

2006-03-30 Thread Tom Lane
Uwe C. Schroeder [EMAIL PROTECTED] writes: On Thursday 30 March 2006 21:27, Tom Lane wrote: My own take on this is that you should say what you mean. If you do not have a clear application-oriented reason for specifying a particular limit N in varchar(N), you have no business choosing a

Re: [GENERAL] PSQL Data Type: text vs. varchar(n)

2006-03-30 Thread Chris
Tom Lane wrote: Chris [EMAIL PROTECTED] writes: kurt _ wrote: My question: Is a text field just a varchar(Integer.MAX_VALUE)? varchar has a max of 255 characters, You must be using some other database ;-) Oops! Sorry :) -- Postgresql php tutorials http://www.designmagick.com/

[GENERAL] configure: error: file 'tclConfig.sh' is required for Tcl

2006-03-30 Thread Teresa Noviello
Hi! I'm configuring postgresql-8.1.3 with ./configure --with-perl --with-python --enable-nls --with-openssl --enable-debug --enable-cassert --with-tcl being root, in /usr/src/redhat/SOURCES/pg/postgresql-8.1.3 directory, on Fedora Core 4. I have this error: configure: error: file 'tclConfig.sh'