[SQL] pguuid for windows

2007-06-03 Thread Karthikeyan Sundaram
Hi team, Again the same old question. I have a Linux version of postgres where I installed the tsearch2 and the pguuid (from the pguuid.tar.gz from the gborg project). Now, I want to install the same postgres 8.2.3 into windows version, when I installed, I installed the contrib ver

[SQL] quesion on functions calling from php

2007-04-16 Thread Karthikeyan Sundaram
Hi, I have written a plpgsql function media_format_func(p_in overlay_format_type) which returns int $sql='select * from media_format_func((200,400,'640*481','jpg')::overlay_format_type)'; $result = $this->objDB->query($sql); print_r($result,1); I should get a value as 10, instead I

[SQL] 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

[SQL] 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

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

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 -

[SQL] 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 --

[SQL] 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

[SQL] 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

[SQL] 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

[SQL] 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

Re: [SQL] plpgsql function question

2007-04-03 Thread Karthikeyan Sundaram
Date: Tue, 3 Apr 2007 20:18:43 +0200> From: [EMAIL PROTECTED]> To: > pgsql-sql@postgresql.org> Subject: Re: [SQL] plpgsql function question> > > Karthikeyan Sundaram <[EMAIL PROTECTED]> schrieb:> > > > > Hi,> > > > I am > having a requireme

[SQL] 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

[SQL] 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

[SQL] 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. Is it possible to return an array from the function? Please guide me. Regards skarth __

Re: [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

[SQL] 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

[SQL] 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 _

[SQL] 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

Re: [SQL] [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

[SQL] 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

[SQL] 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

[SQL] 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

Re: [SQL] [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

[SQL] 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

[SQL] 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

[SQL] 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

[SQL] 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: [SQL] sql

2007-02-05 Thread Karthikeyan Sundaram
try this: select entry_user_id, sum(decode(entry_user_id,'VC',1,0) as vc, sum(decode(entry_user_id,'VE',1,0) as ve, sum(decode(entry_user_id,'CV',1,0) as cv, sum(decode(entry_user_id,'SC',1,0) as SC from vigilance_master group where entry_user_id=78 group by en

[SQL] 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

Re: [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

[SQL] Question regarding multibyte.

2007-02-02 Thread Karthikeyan Sundaram
Hi, I am new to postgres. We are using 8.2 release of postgres. Recently we converted our database to multibyte on our dev machine. we want to test the following. 1) How will I insert multibyte from our php? Do we need to use any special encoding? 2) I am using psql command line t