[SQL] ConnecDB() -- couldn't send SSL negotiation packet:

2001-07-03 Thread Bhuvan A
hi, While i am trying to connect pgsql from a perl program, i am getting the error message as ConnectDB() -- couldn't send SSL negotiation packet: errno=9 Bad file descriptor Why i am getting this error? How can i rectify this problem? Remember, i am socksifying my application for some neces

Re: [SQL] problem with date/time constants

2001-07-03 Thread Bhuvan A
Hi, 'now' is a function... so try 'select now();' On Tue, 3 Jul 2001, datactrl wrote: > Hi, > server:PostgreSQl 7.1 > why doesn't following statement work? > "select now;" > > THANK YOU! > JACK LIU > > > > ---(end of broadcast)--- > TIP 6:

[SQL] how can we change definition of a table once created?

2001-07-08 Thread Bhuvan A
hello sirs,, can any one say how can we change the table definition once created? say, we have a table with 1000s of records. if one needs to change the data type of particular column or if he needs to change the width of a column what should be done? As of now, i am copying the data to a fil

[SQL] SELECT * from select - HOW?

2001-07-16 Thread Bhuvan A
hi, how can we select * from a view named 'select'?? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[SQL] SELECT * FROM select -- got it!

2001-07-16 Thread Bhuvan A
sorry! infact, i didn't try that with quote. now it is fine.. sorry for ur inconvinence and thankx however. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] is it possible to comment each column of a table?

2001-07-16 Thread Bhuvan A
hi all, is it possible to comment a column of a table similar to EXTRA of mySQL. If yes then how?? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [

[SQL] CAST(ipaddress as text) -- HOW?

2001-07-17 Thread Bhuvan A
hi all, how can we cast an ipaddress(type cidr) to any other type? thankx in advance.. Regards, Bhuvaneswar. ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROT

Re: [SQL] CAST(ipaddress as text) -- HOW?

2001-07-18 Thread Bhuvan A
hi, ipaddress::text is resulting in ERROR: Cannot cast type 'cidr' to 'text' how else we can??? Thankx. On Tue, 17 Jul 2001, omid omoomi wrote: > ie, > ipaddrss::text > > >From: Bhuvan A <[EMAIL PROTECTED]> > >To: [EMAIL PROTECTED] >

Re: [SQL] CAST(ipaddress as text) -- HOW?

2001-07-20 Thread Bhuvan A
1, omid omoomi wrote: > Sorry friend, you are right. I could not do that too. :o > I'll look for it. > omid > > >From: Bhuvan A <[EMAIL PROTECTED]> > >To: omid omoomi <[EMAIL PROTECTED]> > >CC: [EMAIL PROTECTED] > >Subject: Re: [SQL] CAST(ipad

[SQL] how can we get total records in pg server?

2001-07-23 Thread Bhuvan A
Hi all, how can we get the COUNT of total records in the db server? hope this could be simple for pg experts. thankx in advance! Regards, Bhuvaneswar. Eighty percent of married men cheat in America. The rest

Re: [SQL] how can we get total records in pg server?

2001-07-24 Thread Bhuvan A
-Ambrose Bierce On Mon, 23 Jul 2001, omid omoomi wrote: > you mean this ? > select count(*) from tablefoo; > > > >From: Bhuvan A <[EMAIL PROTECTED]> > >To: [EMAIL PROTECTED] > >Subject: [SQL] how can we get total records in pg server? > >Date: Mon, 23 Ju

[SQL] is it possible to use arrays in plpgsql function??

2001-08-20 Thread Bhuvan A
hi all, Is it possible to use arrays of any datatypes in plpgsql function? If yes, how?? thankx. == Every absurdity has a champion who will defend it. ===

[SQL] Getting 'n-1'th record.

2001-08-21 Thread Bhuvan A
hi all, consider below.. An sql query results with 'n' records. OK. I need ONLY the 'n-1'th record. HOW CAN I GET THIS? Thankx in advance! == Q: What's the difference between the 1950's and the 1980's?

Re: [SQL] trigger trouble -- procedure not found

2001-09-13 Thread Bhuvan A
On Sep 14, Kevin Way wrote: > I'm having trouble creating a trigger. First i'm creating a function, > add_to_search in PL/pgSQL. > > \df verifies the existance of this function: > smallint | add_to_search | text, text, text, integer > -- We can verify all the functio

[SQL]

2001-09-14 Thread Bhuvan A
Hi all, Consider this.. SELECT EXTRACT(EPOCH FROM TIMESTAMP(now())); date_part 1000467997 (1 row) Fine.. Similarly, how could i get timestamp value for these SECONDS? ie.. VICE VERSA Something like this.. SELECT EXTRACT(TIMESTAMP FROM INTERVAL('1000467997 SECONDS')); :) K

[SQL] How to Get Timestamp From SECONDS?

2001-09-14 Thread Bhuvan A
Hi all, Consider this.. SELECT EXTRACT(EPOCH FROM TIMESTAMP(now())); date_part 1000467997 (1 row) Fine.. Similarly, how could i get timestamp value for SECONDS? ie.. VICE VERSA Something like this.. :) select extract(timestamp from interval('1000467997 seconds')); :) Ki

Re: [SQL] COUNT func

2001-10-18 Thread Bhuvan A
hi, try this too.. select count(*),age,status from person where age=40 and status='MARRIED' group by age,status; Regards, Bhuvaneswar. On Oct 18, Oleg Lebedev wrote: > Hi, > I am trying to count the number or rows in a table with similar field > values. I want to do it in one table sca

[SQL] Need a VIEW without SUB-SELECT

2001-10-19 Thread Bhuvan A
Hi all, Kindly apologize any inconvenience! I have 2 tables status and po_status like.. CREATE TABLE status ( status_id int primary key, status_name varchar(15) ); CREATE TABLE po_status ( po_no varchar(15), approval_status_id int references status(status

[SQL] Connecting to different DataBase In PlPgsql Function

2001-10-25 Thread Bhuvan A
hello all, How can we connect to different database using plpgsql function? Can we? Thankx in advance. == A beer delayed is a beer denied.

[SQL] Strange Problem As Type Casting

2001-11-02 Thread Bhuvan A
hi all, i am using postgresql 7.1. here i am facing some strange problem for last 2 days. i have a table 'users' as below test=> \d users Table "users" Attribute | Type | Modifier ---+

[SQL] COPY COMMAND -- Hanging

2001-10-05 Thread Bhuvan A
hi all, i am facing a strange problem in using COPY COMMAND. As i would like to merge 2 databases, i dumped data from one by $ pg_dump -R bhuvan -f bhuvan.sql Here i found data dumped using COPY COMMAND. now i tried to restore few of the tables. so i copied those tables alone to seperate file

[SQL] How to Return Unique Elements From An Array?

2001-10-08 Thread Bhuvan A
hello all, how can we get unique elements from an array(of any type)? Regards, Bhuvaneswar. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] COPY COMMAND -- Hanging

2001-10-05 Thread Bhuvan A
hi all, i am facing a strange problem in using COPY COMMAND. As i would like to merge 2 databases, i dumped data from one by $ pg_dump -R bhuvan -f bhuvan.sql Here i found data dumped using COPY COMMAND. now i tried to restore few of the tables. so i copied those tables alone to seperate file

Re: [SQL] how to write procedures

2002-07-09 Thread Bhuvan A
Hi, it seems you weren't yet installed appropriate procedural language. for example, if you wish to code in plpgsql you must install 'plpgsql'. for details refer the documentation and it has enough information. regards, bhuvaneswaran. On Thu, 4 Jul 2002, srikanth wrote: > Hi, I am using post

[SQL] contrib/dblink suggestion

2002-07-29 Thread Bhuvan A
Hi, I am using postgresql 7.2.1. I badly require to interconnect between databases. contrib/dblink seems to be handy and ofcourse it well suits my requirement. But while browsing across, i heard that it is not advicable to use it. So i wish to know someone's experience in using dblink and how han

Re: [SQL] contrib/dblink suggestion

2002-07-30 Thread Bhuvan A
again. regards, bhuvaneswaran On Tue, 30 Jul 2002, Joe Conway wrote: > Bhuvan A wrote: > > I am using postgresql 7.2.1. > > I badly require to interconnect between databases. contrib/dblink seems to > > be handy and ofcourse it well suits my requirement. But while browsin

[SQL] Casting integer to boolean

2002-08-16 Thread Bhuvan A
Hi, I am using postgresql 7.2.1. How do i cast an integer value to boolean? I did try the below sequence of SQLs and was little bit confused, by the way it behaves. It casts the integer value to boolean in one case but not ever again. bhuvan=> SELECT count(*)::int::boolean from my_table; ERROR:

Re: [SQL] Trigger/Function problem

2002-08-21 Thread Bhuvan A
On Wed, 21 Aug 2002, Andreas Johansson wrote: > Hi all, > > I have a slight problem using triggers and functions in PostGreSQL. I'm > currently running PostGreSQL 7.2.1 on a RedHat 7.2. I've compiled the > sources (no rpm installation). > > I have several different tables and in each table ther

Re: [SQL] record count

2002-08-29 Thread Bhuvan A
> > Hello list, > > Is there a system attribute or table or ? providing record count by table? > > Thanks. > pg_class.reltuples has the record count. regards, bhuvaneswaran ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ

[SQL] DELETE command is getting blocked

2002-10-12 Thread Bhuvan A
Hi, I am using 7.2. I have problem in deleting records from a particular table in my database. Say, if the DELETE command results deleting 10 records, the command is blocked at the end and is not returning. FYI, that table donot have any triggers/constraints/rules on delete. I have checked whe

Re: [SQL] How can I retrieve an info about function arguments ?

2002-10-25 Thread Bhuvan A
> I need to retreive full set of info about argument and return types (for > variable length too). test_db=>\df+ my_func will serve your need :( > How I can get it from system catalog ? pg_proc.pronargs-- count of arguments pg_proc.proargtypes -- oid(s) of pg_type for appropriate arguments r

[SQL] 'next' or similar in plpgsql

2002-10-22 Thread Bhuvan A
Hi, In perl we have 'next' function to skip rest of the statements in the loop and to start with next iteration. In plpgsql, do we have something similar? How do we skip rest of the statements in a loop in plpgsql? TIA. regards, bhuvaneswaran ---(end of broadcast)-

Re: [SQL] Database Design tool

2002-10-30 Thread Bhuvan A
> Can anybody take me reference on Database design tool with PostgreSQL > support. > visit, http://sourceforge.net/projects/phppgadmin/ regards, bhuvaneswaran ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives

Re: [SQL] How do I get rid of these messages?

2002-10-31 Thread Bhuvan A
> How do I get rid of the messages like "NOTICE: CREATE TABLE / PRIMARY > KEY will create implicit index 'test_pkey' for table 'test'" coming out > from stderr when I run psql with my create table script? > AFAIK, by default it cannot be done eventhough syslog is enabled (somebody correct me if

Re: [SQL] Password user postgres

2002-12-25 Thread Bhuvan A
On Mon, 23 Dec 2002, Arnaudo Massimo wrote: > Hi everibody, > i have to see the table pg_shadow, but i don't remind the default password > for user postgres in a Debian system. > > Can you help me? Edit pg_hba.conf and set the method to 'trust' and restart postmaster. Login(it wont ask for pa

Re: [SQL] Adding a Primary Key to an exisiting table

2003-01-02 Thread Bhuvan A
> Hi > > I just exported my MS Access databases into postgres using an ODBC driver, > but the thing is during the export postgres doesn't recognize any of my > primary keys in Access. > Is there any way to alter the tables so that i can make one of my current > fields the primary key? I don't wa

Re: [SQL] pg_dump problem

2003-01-20 Thread Bhuvan A
> mv camper.dump20020116 camper_bak/ > > The error I get is :: > > mv: camper.dump20020116: Value too large for defined data type > It may not be a postgresql problem. It may be due to your filesystem. Try the documentation or mailing list of your filesystem. regards, bhuvaneswaran ---

Re: [SQL] Implementing automatic updating of primary keys...

2003-01-20 Thread Bhuvan A
> > there can be many such tables that have foreign key id which is referencing > the master table test_master column "id". what we want is when some ids become ^^^ It should be profile_master, right? > redundant we have to merge two ids , we want that thru out the sy

Re: [SQL] PostgreSQL + SSL

2003-01-23 Thread Bhuvan A
> I´m trying to config PG with SSL, but i got a error. I create the key > and the certificate and put both in $PGDATA directory. I also enabled > the ssl option in postgresql.conf. But when i run postmaster i got a > error saying that server.key has wrong permissions. It reports the error in eith

Re: [SQL] DBCC CheckIdent in a stored proc?

2003-01-23 Thread Bhuvan A
> I need to know the last id of the last record added to the table from an > ASP page. => select field1 from my_table order by oid desc limit 1; -- will do that. regards, bhuvaneswaran ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaste

Re: [SQL] CAST from VARCHAR to INT

2003-01-23 Thread Bhuvan A
> (Postgres 7.2.1) > > I screwed up when I was designing a table a while back and made a column a > VARCHAR that referenced (and should have been) an INT. > > Now I'm trying to correct my mistake, I've created a new table and I'm > trying to INSERT INTO...SELECT the data into it, but it's compla

Re: [SQL] converting microsoft sql server 2000 sql-code for postgresql

2003-01-28 Thread Bhuvan A
> Can someone tell me how I can adjust the syntax of the code and in global: > how can I convert sql-code , for microsoft sql server 2000, to sql-code for > postgresql? > Try, http://techdocs.postgresql.org/techdocs/sqlserver2pgsql.php regards, bhuvaneswaran ---(end of

[SQL] Format in psql

2003-02-03 Thread Bhuvan A
Hi, I am using pgsql-7.2.3. Can i able to format the output of a SELECT sql in psql as perl format? Something like, +--++ | work_desc_id | short_desc | +--+---

Re: [SQL] Format in psql

2003-02-03 Thread Bhuvan A
> man psql. > > Inside psql: > \pset border 2 > Fine, \pset border 2 draws the border. But it donot format the multi line value, without affecting the format of other column. I want to format the multi line column appropriately. It should not affect the format of other column, similar to perl f