Re: [SQL] "record" datatype - plpgsql

2003-05-30 Thread Brian Knox
That's not what I was asking. I know I can access the values of each column using NEW.columnname. What I was asking is if there's anyway to use the NEW record to get a list of the columnnames in it without knowing them beforehand. Brian Knox On Thu, 29 May 2003, George Weaver wrote: > Hi Brian;

Re: [SQL] please helpme ?

2003-05-30 Thread Richard Huxton
On Friday 30 May 2003 5:52 am, andhie lala wrote: > Dear All > > I'am a new user in postgresql, i want to ask about : > > 1. The one who is intended with STORED PROCEDURE, >how its implement and what its surplus. >Version POSTGRESQL that how much possess STRORED PROCEDURE. All PostgreSQL v

[SQL] please help me ???

2003-05-30 Thread andhie lala
Dear All I'am a new user in postgresql, i want to ask about : 1. The one who is intended with STORED PROCEDURE, how its implement and what its surplus. Version POSTGRESQL that how much possess STRORED PROCEDURE. 2. In when I make the function as follows: CREATE FUNCTION forward(C

[SQL] please helpme ?

2003-05-30 Thread andhie lala
Dear All I'am a new user in postgresql, i want to ask about : 1. The one who is intended with STORED PROCEDURE, how its implement and what its surplus. Version POSTGRESQL that how much possess STRORED PROCEDURE. 2. In when I make the function as follows: CREATE FUNCTION forward(C

Re: [SQL] "record" datatype - plpgsql

2003-05-30 Thread Stephan Szabo
On Thu, 29 May 2003, Brian Knox wrote: > Given a variable of the "record" data type in pl/pgsql, is it possible to > get the names of the columns ( attributes ) of that record? > > eg, given record "NEW" for table "foo", is there a way to get information > concerning the columns that make up that

Re: [SQL] "record" datatype - plpgsql

2003-05-30 Thread George Weaver
Brian, You can also use the "record" type as well in the same way. George - Original Message - From: "George Weaver" <[EMAIL PROTECTED]> To: "Brian Knox" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 2:01 PM Subject: Re: [SQL] "record" datatype - plpgsql > Hi Br

Re: [SQL] CREATE TABLES AS looses constraints

2003-05-30 Thread Josh Berkus
Tiaan, > It seems as if a CREATE TABLES AS does not duplicate the table constraints. > How can I enforce this. I need the fastest possible way to make an exact copy > of a table. This is to support the administrative mechanism in an app where > changes are made to a mirrored copy of a set of t

Re: [SQL] "record" datatype - plpgsql

2003-05-30 Thread George Weaver
Hi Brian; Assuming "NEW" has been declared as foo%rowtype, you can access the columns thus NEW.xxx where xxx is the column name HTH. George - Original Message - From: "Brian Knox" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 11:11 AM Subject: [SQL] "re

Re: [SQL] [PHP] faster output from php and postgres (one resolution)

2003-05-30 Thread Chadwick Rolfs
My solution to the problem stated below was to learn plpgsql, and write a function that loops through the returned records, concatenating a string together, and returning that string as the Author field. This function was actually e-mailed to me by a collegue, and I did a bit of doctoring (it still

Re: [SQL] Index scan never executed?

2003-05-30 Thread Tom Lane
"Chad Thompson" <[EMAIL PROTECTED]> writes: > Aggregate (cost=2519.58..2519.58 rows=1 width=16) (actual > time=110715.45..110715.46 rows=1 loops=1) >-> Nested Loop (cost=0.00..2519.58 rows=1 width=16) (actual > time=110715.43..110715.43 rows=0 loops=1) > -> Index Scan using start_

Re: [SQL] Rows UPDATEd? (solved!)

2003-05-30 Thread David Olbersen
Using the Pg module, one can use $res->cmdStatus for UPDATE as well as INSERT and DELETE to see how many rows were UPDATE/INSERT/DELETEd and what action was taken. One can also use $res->cmdTuples in the same manner. Looks like the documentation is just a little lacking. --

Re: [SQL] Index scan never executed?

2003-05-30 Thread Stephan Szabo
On Thu, 29 May 2003, Chad Thompson wrote: > I have never been very good at reading these query plans, but I have a bit > of a problem w/ my query. So any help is appreciated. > > The query is fairly self explanitory i think. 2 tables, call_results ( 6.5 > Million records ) and lists ( 11 Million

[SQL] Index scan never executed?

2003-05-30 Thread Chad Thompson
I have never been very good at reading these query plans, but I have a bit of a problem w/ my query. So any help is appreciated. The query is fairly self explanitory i think. 2 tables, call_results ( 6.5 Million records ) and lists ( 11 Million records ) weblink=# explain analyze weblink-# selec

[SQL] Rows UPDATEd?

2003-05-30 Thread David Olbersen
I'm looking for a way to see how many rows were UPDATEd. I Googled a bit and found that if I were using pl/pgsql I could use 'GET DIAGNOSTICS'. But I'm not using pl/pgsql. Is there some other way I could find out how many rows were affected by the last statement in my transaction? For what it'

[SQL] CREATE TABLES AS looses constraints

2003-05-30 Thread Tiaan Wessels
Hi, It seems as if a CREATE TABLES AS does not duplicate the table constraints. How can I enforce this. I need the fastest possible way to make an exact copy of a table. This is to support the administrative mechanism in an app where changes are made to a mirrored copy of a set of tables first a

[SQL] "record" datatype - plpgsql

2003-05-30 Thread Brian Knox
Given a variable of the "record" data type in pl/pgsql, is it possible to get the names of the columns ( attributes ) of that record? eg, given record "NEW" for table "foo", is there a way to get information concerning the columns that make up that record? Brian Knox ---(

Re: [SQL] How To Recover Deleted Data

2003-05-30 Thread Brian Knox
Do you have a backup of the data? Brian Knox Senior Systems Programmer Web Infrastructure and Security x51613 [EMAIL PROTECTED] On Thu, 29 May 2003, Abdul Wahab Dahalan wrote: > I've accidentally deleted the data in my table. So How to recover it back. > > > ---(end of br

[SQL] Returning Multiple Values from CASE statement?

2003-05-30 Thread C F
Hello, This is probably an odd request, but I have my reasons :)  Basically, what I need to do is return *multiple* values each for a number of criteria.  Imagine being able to return multiple values for each CASE statement... that's what I'm trying to do.  I can solve this with subqueries, but as