Re: [SQL] [ADMIN] Fw: postgres logging

2004-01-23 Thread A.Bhuvaneswaran
w which sql comes from which connection. Regards, A.Bhuvaneswaran signature.asc Description: This is a digitally signed message part

Re: [SQL] Multiple DB servers on a single machine

2003-12-26 Thread A.Bhuvaneswaran
> I am having an RH Linux 7.3 box which is already running an Postgres > 7.3.4 server. I want to install Postgres 7.4 on the same machine. Is > it possible to install different versions of Postgres in a single RH > Linux 7.3 box and the postmaster up and running for both (7.3.4 & 7.4 > database ser

Re: [SQL]

2003-12-22 Thread A.Bhuvaneswaran
> I am new of postgre sql.im using cursors in pgsql and > getting tuples successfully returns in c++, but how > can i raise exception in the stored function?.pl > anyone help me. You can use 'raise exception' for this purpose. Refer this link for details: http://www.postgresql.org/docs/current/int

Re: [SQL] migration between databases and versions

2003-12-18 Thread A.Bhuvaneswaran
> I would like to upgrade it to the newest version of postgres. > 1) Is there a version for redhat 7.3. Yes. You can run postgresql 7.2.x, 7.3.x & 7.4 on redhat 7.3. > 2) How stable is postgres 7.4 ? 7.4 is stable. If i am in your position, i would rather wait for 7.4.3 or 7.4.4 for that matter.

Re: [SQL] Question regarding triggers

2003-10-20 Thread A.Bhuvaneswaran
> Why dont you try to write your trigger in C? Hi, one cannot write triggered procedures in C. Currently, it can only be written in plpsgql. > > CREATE FUNCTION "public"."check_shipment" () RETURNS trigger AS' > > begin > > If new.shipment_type_id = 4 then > > --do something > > e

Re: [SQL] Using sql statements in file

2003-09-22 Thread A.Bhuvaneswaran
> 1. put create database, create tables sql statements in a file and > execute through prompt > 2. insert or update data that is put in a file Place your commands in a file & execute them either from the prompt or from psql. Remember to create your file in the below order: 1) create database 2) c

Re: [SQL] Datafiles for Databases

2003-09-19 Thread A.Bhuvaneswaran
> Will the postgres create individual data file for databases? Yes. > How to get the datafile path of a database? /var/lib/pgsql/data/base/, database directory name = pg_database.oid. You can also use oid2name contrib module for finer detail. regards, bhuvaneswaran ---

Re: [SQL] Automated Backup

2003-09-19 Thread A.Bhuvaneswaran
> Is there a way to automate the backup databases using pg_dump (like in > SQL server)? You can use cron to automate your backup process with pg_dump. regards, bhuvaneswaran ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] SET database TO ...?

2003-09-15 Thread A.Bhuvaneswaran
> Suppose, one server/postmaster is running several databases. Is there > something like "SET database TO whatever" (and I mean *database* not > schema). I need this to ensure that a script runs only against db for > which it was desinged. You can use PG* environment variables if you wish to write

Re: [SQL] change a field

2003-09-14 Thread A.Bhuvaneswaran
> I want to change a field of a record after the modification of another > field of the same record or during an insert of a new record. You can easily accomplish this in a BEFORE trigger. It is applicable for both insert & update. regards, bhuvaneswaran ---(end of bro

Re: [SQL] MINUS & ROWNUM in PostGres

2003-09-10 Thread A.Bhuvaneswaran
> Anyway, you'll need to write your own replace() if you stick with that > release. > You can use this replace function, if you stick with that release. regards, bhuvaneswaran create or replace function replace (varchar, varchar, varchar) returns varchar as ' declare string alias for

Re: [SQL] Efficient deletions?

2003-08-02 Thread A.Bhuvaneswaran
> DELETE FROM foo WHERE (col1, col2) IN (SELECT...) DELETE FROM foo WHERE col1 = sub_select_table.col1 and col2 = sub_select_table.col2; regards, bhuvaneswaran ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] rule causes nextval() to be invoked twice

2003-07-23 Thread A.Bhuvaneswaran
> Nevermind- that doesn't work either! Here's the new sample code: Rules are triggered before the event. You must do it in AFTER trigger. regards, bhuvaneswaran ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] vacuum all but system tables

2003-03-19 Thread A.Bhuvaneswaran
> I'd like to make a script to automatically vacuum all my DBs nightly. And > I'd like to skip system tables, starting with pg_*. If you run the process as non-super user, it must skip your system tables. On the other hand, if you run it as a super user, it must be done table wise from your scr