Re: [GENERAL] one more word about rules

2000-09-22 Thread John McKown
Abe, How do you generate your article number? If you are using a SERIAL, then you could change it to use a specific SEQUENCE and step the SEQUENCE by some value other than one. Something like: CREATE SEQUENCE article_sequence INCREMENT 100 MINVALUE 1 START 101; CREATE TABLE article ( article_num

Re: [GENERAL] replication

2000-09-22 Thread Bruce Guenter
On Fri, Sep 22, 2000 at 09:58:24AM +0200, Elmar Haneke wrote: > Adam Lang wrote: > > Are there any type of replication features in postgresql 7.0? I've been thinking that one way to emulate replication would be to run a pgsql "shim" that would redirect queries to two back-ends simultaneously, cre

Re: [GENERAL] replication

2000-09-22 Thread Tom Lane
Bruce Guenter <[EMAIL PROTECTED]> writes: > I've been thinking that one way to emulate replication would be to run a > pgsql "shim" that would redirect queries to two back-ends > simultaneously, creating transactions for update commands, and aborting > when necessary. The shim would be a long-run

[GENERAL] Re: c function

2000-09-22 Thread K Parker
> Question: Why isn't 12 printed after the second SELECT statement? It's the well-known (?) problem that if any function parameter is NULL, they are all set to NULL. IIRC someone is working on fixing this... Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at h

[GENERAL] Why does IE5 give me a "No suitable driver" error?

2000-09-22 Thread Charles Sigler
I am using PostgreSQL 7.0.2 JDBC, applet works fine with Netscape, but IE5 gives me a "java.sql.SQLException: No suitable driver" error. I am using the following mechanism: Class.forName("org.postgresql.Driver"); db = DriverManager.getConnection("jdbc:postgresql://www. What am I doing wron

Re: [GENERAL] problem with calling c functions

2000-09-22 Thread Tom Lane
Richard Harvey Chapman <[EMAIL PROTECTED]> writes: > Question: Why isn't 12 printed after the second SELECT statement? NULL arguments/results for user functions are a longstanding problem (check the list archives). This is finally fixed in current sources for 7.1, but there's no good workaround

Re: [GENERAL] replication

2000-09-22 Thread Bruce Guenter
On Fri, Sep 22, 2000 at 12:03:13PM -0400, Tom Lane wrote: > Bruce Guenter <[EMAIL PROTECTED]> writes: > > I've been thinking that one way to emulate replication would be to run a > > pgsql "shim" that would redirect queries to two back-ends > > simultaneously, creating transactions for update comm

[GENERAL] what if PQexec() result is toooooo big?

2000-09-22 Thread Aggarwal , Ajay
What happens when the PQexec(..) result is too big to return in one single response message? Say you are reading a table with millions of entries. Is there a way to write one single PQexec() request but read the result in chunks : "give me the first 500 tuples", "give me the next 500", an

Re: [GENERAL] one more word about rules

2000-09-22 Thread Adam Haberlach
On Fri, Sep 22, 2000 at 03:33:46PM +0100, Abe Asghar wrote: > Hi everyone, > > I have built a database that uses int4 as the unique identifier for a news > database. > > Therefore an article has a identifier 1, the next one has 2 etc. > > Then I order them when they are displayed on the web rev

Re: [GENERAL] Triggers

2000-09-22 Thread Stephan Szabo
On Fri, 22 Sep 2000, Enrico Comini wrote: > Question > If have a table with a primary key and another table with outer key > referenced on the primary of the first table. > If I want list the active triggers how i have to do ? select * from pg_trigger; > If I delete de first table I have the m

Re: [GENERAL] PSQL Books

2000-09-22 Thread Adam Lang
http://www.postgresql.org/docs/awbook.html Adam Lang Systems Engineer Rutgers Casualty Insurance Company - Original Message - From: "Mike" <[EMAIL PROTECTED]> To: "Adam Haberlach" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, September 22, 2000 1:28 PM Subject: [GENERAL] PSQL Boo

[GENERAL] Transactions + sequences

2000-09-22 Thread Neil Conway
Consider the following (PgSQL 7.0.2): CREATE SEQUENCE foo; SELECT nextval('foo'); -- returns 1 BEGIN WORK; SELECT nextval('foo'); -- returns 2 ABORT WORK; SELECT nextval('foo'); -- returns 3 As you can see, even though the transaction has been aborted, the sequence is still incremented. Is there

[GENERAL] PSQL Books

2000-09-22 Thread Mike
I'm looking for at least two good books on psql, are there any out ther, if so can someone suggest some to me? Mike

Re: [GENERAL] Transactions + sequences

2000-09-22 Thread Stephan Szabo
On Fri, 22 Sep 2000, Neil Conway wrote: > Consider the following (PgSQL 7.0.2): > > CREATE SEQUENCE foo; > SELECT nextval('foo'); > -- returns 1 > BEGIN WORK; > SELECT nextval('foo'); > -- returns 2 > ABORT WORK; > SELECT nextval('foo'); > -- returns 3 > > As you can see, even though the trans

Re: [GENERAL] one more word about rules (fwd)

2000-09-22 Thread John McKown
Well, how about just adding something other than 1 (such as 100) to the value in the table? As for the existing table, perhaps, before moving it to the new table, you could do something like: UPDATE table SET article_number=article_number*100; This would change all the current article numbers t

Re: [GENERAL] Re: c function

2000-09-22 Thread Richard Harvey Chapman
On Fri, 22 Sep 2000, K Parker wrote: > > Question: Why isn't 12 printed after the second SELECT statement? > > It's the well-known (?) problem that if any function parameter is > NULL, they are all set to NULL. IIRC someone is working on fixing > this... a big thanks to you and Tom for the up

[GENERAL] why pg_dump eats so much memory?

2000-09-22 Thread Cristóvão Dalla Costa
I just noticed that when I run pg_dump to backup my databases it will use enormous amounts of memory, eating over 70 MB and causing the system to trash. Then after a while it'll shrink to about 30MB, then grow again, and repeat the cycle a couple times. The database has 3 tables with araound 350,0

[GENERAL] PG Automated Backup and Failover System (long)

2000-09-22 Thread Ingram, Bryan
I'm currently testing a system I've written for Postgres that provides automatic failover to a backup database server in the event that the master db server should die. The system was designed using RedHat 6.2 and Postgres 7.0.2 in a two node cluster with two NICs in each node. The extra NIC

[GENERAL] users

2000-09-22 Thread Chris
Greetings, When ever a normal user (anyaccount besides "postgres") tries to run psql they get the following message: Connection to database 'dank' failed. FATAL 1: SetUserId: user "chrisp" is not in "pg_shadow" How do i fix this?

Re: [GENERAL] users

2000-09-22 Thread Neil Conway
On Fri, Sep 22, 2000 at 10:36:53PM +, Chris wrote: > Greetings, > > When ever a normal user (anyaccount besides "postgres") tries to > run psql they get the following message: > > Connection to database 'dank' failed. > FATAL 1: SetUserId: user "chrisp" is not in "pg_shadow" You prob

Re: [GENERAL] why pg_dump eats so much memory?

2000-09-22 Thread Tom Lane
=?iso-8859-1?Q?Crist=F3v=E3o_Dalla_Costa?= <[EMAIL PROTECTED]> writes: > I just noticed that when I run pg_dump to backup my databases it will use > enormous amounts of memory, > I would like to know the causes of that behaviour, and, hopefully, how I can > fix it. I'm running 7.0.2 on freebsd 4.1

[GENERAL] [SQL] how to store a query, that results in a table

2000-09-22 Thread Nelson
thank you jie Liang for your response, but my problems are: 1. How to store a query in the database. 2. How to give a parameter from outside of database, for example: select * from table1 where row1 = my_parameter_outside. Give me an example please. begin:vcard n:brito;nelson x-mozilla-html:F