Re: [ADMIN] psql shell return codes - checking if database exists

2011-06-15 Thread sundaram
Perhaps the grep solution will only provide an accurate response if the database name is not a substring of some other database name. In other words, if one were to attempt to confirm that database prod10 exists- they might execute (per the suggestion): psql --list | grep prod10 But, the result c

[ADMIN] questions on multibyte

2007-02-01 Thread Karthikeyan Sundaram
Hi all, I am new to postgres. I have converted my current db from sql_ascii to unicode. I followed the instructions give by some site called moodle and it worked. I have some basic questions. 1) How will I insert multibyte from insert statement? I figured out a way to insert multib

[ADMIN] questions on multibyte

2007-02-01 Thread Karthikeyan Sundaram
As I am new to postgres, I don't know much command. Eventhough I have good experience in oracle, In oracle, we say NLS_LANG, UTF-8 will put them in one line. Is there a similar command in postgres. I am learning postgres. Please help Regards skarthi From: Michael Fuhr <[EMAIL

Re: [ADMIN] [SQL] Question regarding multibyte.

2007-02-04 Thread Karthikeyan Sundaram
Hi, I am new to postgres. I asked a question regarding multibyte display. I got only one response. Hence, I am re-iterating the question again to a larger audience. We are using 8.2 release of postgres. Recently we converted our database to multibyte on our dev machine. we want to test t

[ADMIN] Question relating to database space and adding partition

2007-02-05 Thread Karthikeyan Sundaram
Hi all, We are using postgres 8.0.1 on our production and 8.2 on our development. The linuix partition is getting full where the database resides. In few weeks our partition will ran out of space so the database will also run out of space. We are added another partition of 300GB. Now my q

[ADMIN] Symbol lookup error

2007-02-05 Thread Karthikeyan Sundaram
Hi Gurus, I hae installed postgres 8.2 recently and when I open the psql command line prompt and say \d . The psql abort abruptly with an error message given below. What is the cause and how to rectify it? Error Message = Welcome to psql 8.2.1, the PostgreSQL interactive termin

[ADMIN] how to add a new data partition

2007-02-06 Thread Karthikeyan Sundaram
Hi all, We are using postgres 8.0.1 on our production and 8.2 on our development. The linuix partition is getting full where the database resides. In few weeks our partition will ran out of space so the database will also run out of space. We have added another HDD of 300GB. Now my questio

Re: [ADMIN] how to add a new data partition

2007-02-06 Thread Karthikeyan Sundaram
e new partition. In Oracle, we can tell the alter database add data file '/new partition' so the the new partition will take into effect along with the old one. Is there a similar way in postgres? Regards skarthi From: "Phillip Smith" <[EMAIL PROTECTED]> To: &q

Re: [ADMIN] how to add a new data partition

2007-02-06 Thread Karthikeyan Sundaram
7; then if /local partition is full, we can add another data file such as alter database add data file '/local1/data2' Is there a similar way or equivalent way to do in postgres? Regards skarthi From: Scott Marlowe <[EMAIL PROTECTED]> To: Karthikeyan Sundaram <[EMAIL PR

[ADMIN] question on passing parameter in sql query

2007-02-07 Thread Karthikeyan Sundaram
Hi, I don't want to compare with Oracle and postgres. But I have a situation. I am using psql command line tool supplied by postgres. In Oracle I can say select * from emp where emp_id = &1 Oracle will ask: Enter a value for 1: If I enter 10, then Oracle will get the empid=10

Re: [ADMIN] tsearch feature

2007-02-07 Thread Karthikeyan Sundaram
In Oracle there is something similar to tsearch2. It's called as Oracle Text. I vaguely remember the syntax. In Oracle. Select * from table where contains column = (text search) Regards skarthi From: "Alexander B." <[EMAIL PROTECTED]> To: "pgsql-admin@postgresql.org" Subject: [ADMIN] tsear

Re: [ADMIN] tsearch feature

2007-02-07 Thread Karthikeyan Sundaram
here is the link on oracle text http://www.oracle.com/technology/products/text/index.html From: "Alexander B." <[EMAIL PROTECTED]> To: "pgsql-admin@postgresql.org" Subject: [ADMIN] tsearch feature Date: Wed, 07 Feb 2007 14:27:48 -0200 Hi, Sorry for my question, but what's the feature on Ora

[ADMIN] How to analyse the indexes in postgres?

2007-02-18 Thread Karthikeyan Sundaram
Hi, I am new to postgres. I need some kind of template script or advise on how to analyse the indexes. In our database, we do delete, insert, update tons of rows. Regards skarthi _ Refi Now: Rates near 39yr lows! $430,000

[ADMIN] Online archiving

2007-02-22 Thread Karthikeyan Sundaram
Hi, My database is very big and would like to perform an online archiving. I haven't done this before. Can you please throw some lite on this (i.e., how to do this and the steps if anybody has done this). Regards skarthi _

[ADMIN] system tables inquiry & db Link inquiry

2007-02-28 Thread Karthikeyan Sundaram
Hi, We are using Postgres 8.1.0 Question No 1: = There are lots of system tables that are available in postgres. For example pg_tables will have all the information about the tables that are present in a given schema. pg_views will have all the information about the views for

[ADMIN] pg_dump error

2007-02-28 Thread Karthikeyan Sundaram
Hi, I am using 8.2.1 on my dev server. When I do a pg_dump, I am getting an error message. pg_dump -U postgres podcast -t channel pg_dump: symbol lookup error: pg_dump: undefined symbol: PQescapeStringConn How can I resolved this? What may be the problem? Because of this, I am no

Re: [ADMIN] pg_dump error

2007-02-28 Thread Karthikeyan Sundaram
Hi Joshua, Thanks for your reply. No, I recently installed (fresh installation) from scratch. Regards skarthi From: "Joshua D. Drake" <[EMAIL PROTECTED]> To: Karthikeyan Sundaram <[EMAIL PROTECTED]> CC: pgsql-admin@postgresql.org, pgsql-sql@postgresql.org Subjec

[ADMIN] pg_dump inquiry

2007-02-28 Thread Karthikeyan Sundaram
Hi, I have to dump only 10 tables out of 100 tables. In the pg_dump utility given by postgres there is an option called -t followed by table name. In that option, if I give more than 1 table, it's not accepting. How can I get the dump in one stroke for all the 10 tables? Please advi

[ADMIN] pg_dump and pg_dumpall is hanging

2007-03-06 Thread Karthikeyan Sundaram
Hi, I am using 8.1.0 for my production. The pg_dumpall was working fine on all these days. Suddenly from yesterday, the pg_dumpall command fails. Fails means, it hangs (no dump) is taking place. What may be the problem? Regards skarthi _

[ADMIN] Running in single instance mode

2007-03-09 Thread Karthikeyan Sundaram
Hi Everybody, We are using postgres 8.1.0. I want to do some maintenance work. Hence, I want to run postgres in single user mode so that external people won't be able to access the database. How can I run the postgres in single user mode?. Any idea? Regards skarthi

[ADMIN] create view with check option

2007-03-18 Thread Karthikeyan Sundaram
Hi Everybody, I have 2 versions of postgres 8.1.0 is my production version and 8.2.1 is my development version. I am trying to create a view in my development version (8.2.3) create view chnl_vw as select * from channel with check option; I am getting an error message: [Error] Scrip

Re: [ADMIN] create view with check option

2007-03-19 Thread Karthikeyan Sundaram
(3,4); create or replace rule test_rule_upd as on update to test_vw do instead update test_tbl set a=new.a, b=new.b, c=new.c where a=new.a; update test_vw set c='good' where a=1; select * from test_vw; regards skarthi From: "Karthikeyan Sundaram" <[EMAIL

[ADMIN] ERROR: invalid byte sequence for encoding "UTF8": 0x92

2007-03-20 Thread Karthikeyan Sundaram
Hi, I am using postgres 8.2.3. I have recently converted my database from sql-ascii to UTF8. I have a portal which calls a perl program to insert the data into the database. While inserting, I am getting an error message DBD::Pg::st execute failed: ERROR: invalid byte sequence for en

[ADMIN] growth of the database

2007-03-21 Thread Karthikeyan Sundaram
Hi, Our database is growing fast. I want to create a cronjob that should tell me what is the current size of the database on each day. How can I find this from the database? Is there any pre-written scripts written by somebody to share? Regards skarthi _

Re: [ADMIN] Read-only access to a database

2007-03-21 Thread Karthikeyan Sundaram
when you create a role, you can specify, nocreate option. Then when you grant the tables to this user give only select privilege. Regards skarthi From: "Brian A. Seklecki" <[EMAIL PROTECTED]> To: "Morten W. Petersen" <[EMAIL PROTECTED]> CC: pgsql-admin@postgresql.org Subject: Re: [ADMIN] Rea

[ADMIN] Monitor what command is executing at the backend

2007-03-21 Thread Karthikeyan Sundaram
Hi everybody, Is there a way to see from the log files on what sql statement is currently by which user? In other words, I want to monitor the DB activity. How can I find it? Regards skarthi _ Get a FREE Web site, company

Re: [ADMIN] [SQL] Monitor what command is executing at the backend

2007-03-21 Thread Karthikeyan Sundaram
George, How will I enable command string to see the commands? Regards skarthi From: "George Pavlov" <[EMAIL PROTECTED]> To: "Karthikeyan Sundaram" <[EMAIL PROTECTED]>,, Subject: Re: [SQL] Monitor what command is executing at the backend Date: Wed, 21 Mar 20

Re: [ADMIN] How to get the DML Commands exceuted from functions

2007-03-22 Thread Karthikeyan Sundaram
CREATE OR REPLACE FUNCTION xyz() returns int4 as $body$ DECLARE BEGIN IF (TG_OP = 'DELETE') THEN n_id = OLD.campaign_id; EXECUTE 'DELETE FROM cn_mapping WHERE campaign_id = '||quote_literal(n_id); RETURN 0; END IF; END; $body$ LANGUAGE 'plpgsql' VOLATILE;

[ADMIN] What is the difference between rule and triggers

2007-03-23 Thread Karthikeyan Sundaram
Hi Everybody, What is the difference between creating a rule and a trigger? Regards skarthi _ i'm making a difference. Make every IM count for the cause of your choice. Join Now. http://clk.atdmt.com/MSN/go/msnnkwme00800

[ADMIN] plpgsql function return array

2007-03-30 Thread Karthikeyan Sundaram
Hi, I am using Postgres 8.1.0. I have a requirement. I will create a function accepting few parameters. This will check into various tables and give back an array of values. I want to use the pgpsql block. I know that we can create using language sql. Is it possible to return an ar

[ADMIN] plpgsql function question

2007-04-03 Thread Karthikeyan Sundaram
Hi, I am having a requirement here. 1) I need to write a plpgsql function where it takes the input parameter of a structure of a table. 2) The table has 15 columns 3) It does lots of validation based on the parameter and finally returns an integer as output parameters Q) Ho

[ADMIN] exception handling in postgres plpgsql

2007-04-03 Thread Karthikeyan Sundaram
Hi, I am having a function like this create or replace function audio_format_func (in p_bitrate audio_format.audio_bitrate%TYPE,in p_sampling_rate audio_format.sampling_rate%type,in p_bit_per_sample audio_format.bit_per_sample%type,in p_audio_codec audio_format.audio_code

[ADMIN] rowcount function in postgres???

2007-04-07 Thread Karthikeyan Sundaram
Hi, I am using 8.1.0 postgres and trying to write a plpgsql block. In that I am inserting a row. I want to check to see if the row has been inserted or not. In oracle we can say like this begin insert into table_a values (1); if sql%rowcount > 0 then dbms.out

[ADMIN] Question on pgpsql function

2007-04-08 Thread Karthikeyan Sundaram
Hi Everybody, I am using Postgres 8.1.0 and I have a requirement. I have a table create table weekly_tbl (id int, week_flag bit(7) not null default '111'); I want to create a function like this create function week_func (int) returns weekly_tbl as $$ select id, s

[ADMIN] Another question in functions

2007-04-08 Thread Karthikeyan Sundaram
Hi team, I have a requirement like this. create table valid_lovs (code_id int not null,lov_value int not null ,description varchar(256),status bit(1) not null default '1',constraint lov_pk primary key (code_id,lov_value)); insert into valid_lovs (code_id,lov_value,description) values (1

[ADMIN] Urgent help in bit_string data type

2007-04-11 Thread Karthikeyan Sundaram
Hi Gurus, I have a table with datatype as bitstrings create table test_a (b bit(3)); insert into test_a values ('111'); This will convert a bit to a number == select to_number((substring(b,1,1)::int),9)+3 from test_a; How will I convert a Number to a bit --

Re: [ADMIN] [SQL] Urgent help in bit_string data type

2007-04-11 Thread Karthikeyan Sundaram
; Date: Wed, 11 Apr 2007 17:44:01 -0400> From: [EMAIL PROTECTED]> Subject: Re: > [ADMIN] [SQL] Urgent help in bit_string data type> To: [EMAIL PROTECTED]> CC: > pgsql-admin@postgresql.org; pgsql-sql@postgresql.org> > Hi skarthi,> > On > Wed, 2007-04-11 at 13:30 -

Re: [ADMIN] [SQL] Urgent help in bit_string data type

2007-04-11 Thread Karthikeyan Sundaram
Regards skarthi> Date: Wed, 11 Apr 2007 19:00:23 -0400> From: [EMAIL PROTECTED]> Subject: Re: [ADMIN] [SQL] Urgent help in bit_string data type> To: [EMAIL PROTECTED]> CC: pgsql-admin@postgresql.org; pgsql-sql@postgresql.org> > Hi skarthi,> > On Wed, 2007-04-11 at 15

[ADMIN] question on plpgsql block

2007-04-12 Thread Karthikeyan Sundaram
Hi Gurus, I tried a plpgsql block from the php. example a='begin insert into table a values (); insert into table b values () insert into table c values (...) select into p_var ... from table where condtion update a set column = where conditio

[ADMIN] setting up a mirroring or replication database

2007-04-12 Thread Karthikeyan Sundaram
Hi Team, We are using Postgres 8.1.0 and in the plans to migrate to 8.2.3. Ours is a OLTP application. Publishers, advertisers and consumers use our system world wide. Right now it's not a very big database. But we are expanding our operations to Europe and US where we are expecting a

[ADMIN] question about installing perl module

2007-04-25 Thread Karthikeyan Sundaram
Hi, We are using postgres 8.1.0. While installation we can tell ./configure --with-perl. In our case, we didn't do it and we just did a ./configure. Now we want to add perl, python and tcl module. How will I add it. Please advise. Regards skarthi _

[ADMIN] Postgresql shared_buffer and SHMMAX configuration.

2010-07-09 Thread Ezhil Sundaram
Hi, Recently we upgraded our production server from 7.5GB RAM to 15GB RAM. 1. To solve performance issue. 2. Also the number of concurrent users increased from 150 to 300. Our production server is not dedicated server. We have also 1. Tomcat 2. Apache 3. Cron based sch