Re: [GENERAL] Counting elements of an array

2001-03-02 Thread Renaud Tthonnart
Tom Lane wrote: Renaud Tthonnart [EMAIL PROTECTED] writes: I would like to know how I can get the number of elements of an array. There is a function that returns an array's dimensions as a text string: regression=# select array_dims( '{1,2,3}'::int[] ); array_dims [1:3]

[GENERAL] Triggered data change violation

2001-03-02 Thread Peter Vazsonyi
Hello! I have a table, with an update trigger (it change the value of 'last_modify' field to current timestamp) Sometimes if i try delete rows in this table (before delete, there are some inserts after a 'begin') i get this change violation error. I don't now why. Can somebody help me? Thank's

Re: [GENERAL] serial properties

2001-03-02 Thread Eric G. Miller
On Thu, Mar 01, 2001 at 04:49:25PM -0300, Martin A. Marques wrote: Hi, I would like to know which are the properties of the SERIAL type. Is a column defined SERIAL a primary key? Saludos... :-) create table foo ( id serial primary key, data text not null check(char_length(data) 0) );

Re: [GENERAL] showing rules/triggers with psql

2001-03-02 Thread Richard Huxton
From: "Metzidis, Anthony" [EMAIL PROTECTED] hey, kind of a simple question. How can you show the rules/triggers on a database using psql. Even better: how can you show all rules/triggers/constrains/etc that pertain to a given table? as always...thanks. --tony The 7.1 docs have some

[GENERAL] how to examin the database structure with an sql command

2001-03-02 Thread Hans Jeuken
I am busy writing a table editor in Perl, using the module Pg.pm as interface to Postgresql. When opening a table in that editor I would like to find out how the tables in the database are defined. So far I have considered doing a pg_dump to a file and then examine the content, but it is so

Re: [GENERAL] Re: vacuum and backup

2001-03-02 Thread Ian Harding
Lincoln Yeoh wrote: At 01:52 PM 27-02-2001 -0500, Mitch Vincent wrote: I agree 100% that a shell script is probably the best way to go.. All you're doing is running a few utilities, there is hardly any processing on the part of the script that calls the utilities so there isn't much of a

Re: [GENERAL] Is this a bug?

2001-03-02 Thread Ian Harding
Limin Liu wrote: Hi, Can anyone please tell me whether this is a bug or not? I used the following SQL to create my table and view with some data. === create table tbl (no int, cnt int); create view tbl_view as select no, count(cnt) as count from tbl group by

[GENERAL] Re: Find out when a table was last changed ?

2001-03-02 Thread Jonathan Ellis
Better yet, define a trigger so you and/or other programmers don't have to worry about including that field in every update. -Jonathan - Original Message - From: Anand Raman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 27, 2001 8:28 PM Subject: Re: Find out when a

[GENERAL] platforms

2001-03-02 Thread WG4- Verma, Ashish
Hi, I have an urgent question to ask. Can PostgreSQL run on Windows 95, 98, NT, 2000 platforms? If not, what is an alternative to using PostgreSQL in Windows? A quick response will be appreciated. Thanks Ash ---(end of broadcast)--- TIP 2: you

[GENERAL] If this isn't too crassly commercial ... looking for tech editors

2001-03-02 Thread Patricia . Barnes
I'm assured that this message won't be greeted with universal condemnation from the Postgres community - I'm an editor at Sams Publishing who is looking for a technical editor for a PostgreSQL developer's handbook. Interested? Send resume to [EMAIL PROTECTED] Thanks. Patricia G. Barnes

Re: [GENERAL] Re: Help with pq++

2001-03-02 Thread Aristide Aragon
On Tue, Feb 27, 2001 at 10:09:49AM +0100, Jose Manuel Lorenzo Lopez wrote: Aristide Aragon schrieb: On Mon, Feb 26, 2001 at 01:53:18PM -0500, Belcher, Jim wrote: Hello OK, I got the problem sorted out. The error message I received was "Error Message: FATAL 1: Database "mydb" does not exist

[GENERAL] trouble with some characters

2001-03-02 Thread Steff
I'm using PostgreSQL 7.0.3 undr Mandrake and have the following problem : have columns with varchar or text in, some characters cannot be recognized, as è or à for examples. I got ) instead of è for example. How can I do to have them recognized ?? Thanks in advance Stephane

Re: [GENERAL] Migrate from MS SQL 6.5 to postgres??

2001-03-02 Thread Gordon A. Runkle
In article [EMAIL PROTECTED], "Unknown" [EMAIL PROTECTED] wrote: I have an idea that might help I found ODBC to be very slow for importing data So I wrote a program in C that reads in dump files of SQL text on the Linux server itself E.G. first line is a create table, next lines are all the

RE: [GENERAL] Slowdown problem when writing 1.7million records

2001-03-02 Thread Stephen Livesey
No, it's not. Do you have any triggers or rules on this table that you haven't shown us? How about other tables referencing this one as foreign keys? (Probably not, if you're running an identical test on MySQL, but I just want to be sure that I'm not missing something.) I have no

Re: [GENERAL] postgresql upgrades - where's the dump go?

2001-03-02 Thread Fabrice Scemama
Why don't you read the INSTALL file, included in any pg distribution ? On Tue, 27 Feb 2001, will trillich wrote: when upgrading from version X to version Y of postgres, the install appears to dump the data and schema, and then suck it back in with the new binaries. [i just tried going

[GENERAL] Want to learn the Postgresql database system

2001-03-02 Thread Jonny Deng
Hi, I want to learn the Postgresql database system as part of my study. What I need to know whether there is documentation that explain the source codes. Anyone can help me. I am really eager to understand the underlying Postgresql database system. Any help would be appreciated. Thanks Jonny

[GENERAL] PG_PWD and PG_SHADOW

2001-03-02 Thread Anthony Metzidis
Hi, When I 'CREATE USER testuser WITH PASSWORD 'mypassword'; I see an entry in PG_PWD with the password 'mypassword' in plaintext. In my pg_hba.conf I have all hosts using 'password' authentication with no file argument. Is there any way to keep postgres from saving the passwords in PG_PWD? I

Re: [GENERAL] store procedure in pl/pgsql

2001-03-02 Thread Raymond Chui
Juan Ramn Cortabitarte wrote: Hello, I'm trying to do some store procedure in pl/pgsql but the sql server says me: Error: ERROR: Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'. Recognized languages are sql, C, internal and the created procedural languages. Im using

Re: [GENERAL] Re: SERIAL values

2001-03-02 Thread Michael Fork
This is an incorrect statement (as pointed out in the FAQ) 4.16.3) Don't currval() and nextval() lead to a race condition with other users? No. This is handled by the backends. More info: http://www.postgresql.org/users-lounge/docs/7.0/user/sql-createsequence.htm When calling currval, you

Re: [GENERAL] Re: Want to learn the Postgresql database system

2001-03-02 Thread Bruce Momjian
[ Charset ISO-8859-1 unsupported, converting... ] Lots of documentation here : http://www.postgresql.org/devel-corner/index.html I have just added a section on MVCC. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 +

Re: [GENERAL] Convert to upper

2001-03-02 Thread Peter Schindler
Matthias, the easiest way is to use CHECK constraints. see example below. Servus, Peter Matthias Teege wrote: is there any way to limit values to upper case strings? Somthing like: name char(15) DEFAULT (upper(name)) or must I use triggers? test=# create table bla(bb char(10) CHECK

Re: [GENERAL] Perl DBI/DBD::Pg confusion with finish

2001-03-02 Thread David Lynn
What are the consequences of not calling -finish()? I have several apps using DBD::Pg, and I don't think I've used it at all... There don't appear to be any fatal consequences - all queries appear to work fine. However, certain things such as the $sth-{'Active'} attribute cannot be relied

Re: [GENERAL] Perl DBI/DBD::Pg confusion with finish

2001-03-02 Thread David Wheeler
On Fri, 2 Mar 2001, John Madden wrote: What are the consequences of not calling -finish()? I have several apps using DBD::Pg, and I don't think I've used it at all... It just means that the statement handle is marked finished, and if you use it again, it won't issue a warning saying that

[GENERAL] Re: Re: Convert to upper

2001-03-02 Thread Mitch Vincent
Oh, I misunderstood.. I read his post that he wanted anything inserted to be converted to upper case.. If you're just looking to throw an error if it's not upper case, the check constraint is the way to go.. My apologies, I'll try and read more carefully.. -Mitch - Original Message -

RE: [GENERAL] Convert to upper

2001-03-02 Thread Trewern, Ben
Title: RE: [GENERAL] Convert to upper It may be better using a trigger. You don't then get the error message (from the constraint) the record is just updated with the uppercase version of what was inserted. Regards Ben -Original Message- From: Peter Schindler [mailto:[EMAIL

RE: [GENERAL] Does PostgreSQL support Constant Expression (Alias Name)?

2001-03-02 Thread Trewern, Ben
Title: RE: [GENERAL] Does PostgreSQL support Constant Expression (Alias Name)? Try SELECT fname as First Name, lname as Last Name FROM aTable; Regards Ben -Original Message- From: Raymond Chui [mailto:[EMAIL PROTECTED]] Sent: 02 March 2001 14:30 To: [EMAIL PROTECTED]

Re: [GENERAL] Does PostgreSQL support Constant Expression (Alias Name)?

2001-03-02 Thread Oliver Elphick
Raymond Chui wrote: This is a multi-part message in MIME format. --CDE89E33286CEE4876F664CE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit If a table has columns fname, lname. I want to do query like SELECT fname "First Name", lname

Re: [GENERAL] Convert to upper

2001-03-02 Thread Rod Taylor
Title: RE: [GENERAL] Convert to upper Why not just do: INSERT INTO TABLE (uppercase_value) VALUES (upper('value')); Leave in the check, and all problems are solved without overhead of a trigger. Simple checks like the one shown don't have any noticeable speed loss. Trigger overhead does no

Re: [GENERAL] Re: Thought on OIDs

2001-03-02 Thread Rod Taylor
I use XID's regularly now for historical purposes (delayed reversion of entire operations -- handled by an interface of course where appropriate) but OID's I could certainly live without. However, PHP currently returns the OID in from pg_getlastoid() which I use to select from the table the last

Re: [GENERAL] Re: serial properties

2001-03-02 Thread adb
I agree that they are very handy. They become a major pain in the butt when you start doing replication between servers. For instance if you fail over to a standby server and you forget to update it's sequence first, merging data later becomes a nightmare. I'd like to have int8 sequences and

Re: [GENERAL] Re: Thought on OIDs

2001-03-02 Thread adb
I personally would like to see 8byte OIDs or at least int8 sequences, I'm a little worried about the pain of managing a potential rollover when I'm using sequences as a replication key between servers. Alex. On Fri, 2 Mar 2001, Peter Eisentraut wrote: Rod Taylor writes: Someones bound

RE: [GENERAL] Slowdown problem when writing 1.7million records

2001-03-02 Thread Creager, Robert S
I just joined this list, so pardon if this has been suggested. Have you tried 'COPY expafh FROM stdin', rather than inserting each record? I'm managing a 2.5 million record import, creating a btree index on two columns, and then vacuuming the db in 36 minutes (on an Ultra 5 - similar to a AMD

Re: [GENERAL] Re: serial properties

2001-03-02 Thread Rod Taylor
Currently there's a method that an individual backend can cache 1 number from a sequence. Would it be practical to have a master control the sequences and let the replicated backends (different networks potentially) cache a 'slew' of numbers for use? Standard cache of 1, and inter-server cache

Re: [GENERAL] Re: pgsql for Python

2001-03-02 Thread Shaw Terwilliger
Joel Burton wrote: PyGreSQL is more commonly used, and has (IMHO) a simpler, more dict-like interface, but isn't (AFAIK) thread-safe, nor DB API compliant. I wrote a small web application server in python (www.lloop.com) using Python and PyGreSQL. PyGreSQL was (mostly) thread safe, in

Re: [GENERAL] Re: serial properties

2001-03-02 Thread adb
The caching of sequence numbers is one of the reasons you can end up wrapping around. A while back I was working with sybase and our dba had set the precache for some identity columns (same as postgres serial) pretty high and we ran into a sybase bug that caused the server to reboot a large

[GENERAL] What are your settings for SHMMAX and max files?

2001-03-02 Thread adb
Hi, I'm trying to figure out what some reasonable settings would be for kernel parameters like shared memory and max open files. I've read the section of the manual but it doesn't seem to give any rule of thumb based on number of users or frequency of queries. With my load testing I definitely

Re: [GENERAL] how to examin the database structure with an sql command

2001-03-02 Thread will trillich
On Tue, Feb 27, 2001 at 05:11:07PM +0100, Hans Jeuken wrote: I am busy writing a table editor in Perl, using the module Pg.pm as interface to Postgresql. When opening a table in that editor I would like to find out how the tables in the database are defined. So far I have considered