Re: [HACKERS] inquiry
Jinqiang Han [EMAIL PROTECTED] writes: hi,Bruce Momjian I think you are wrong. multiple query in a string, such as SELECT;SELECT will invoke pg_execute_query_string twice, It won't generate two parsetree. Try it in something other than psql. psql splits such a string into multiple submissions to the backend --- but other interfaces don't. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
[HACKERS] inquiry
hello, I have read the source code of postgres.c. Two strang things I can't understand. Souce code of Postgres.c: .. Foreach(parsetree_listparsetree){ //In what situation here will be many parsetrees (List *)querytree_list = pg_analyze_and_rewrite(parsetree); foreach(querytree_listquerytree){ //In what situation here will be many querytrees Who can tell me the reason? Thank you very much Jinqiang Han ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [HACKERS] inquiry
hi,Bruce Momjian I think you are wrong. multiple query in a string, such as SELECT;SELECT will invoke pg_execute_query_string twice, It won't generate two parsetree. === 2003-03-26 10:20:00 === Jinqiang Han wrote: hello, I have read the source code of postgres.c. Two strang things I can't understand. Souce code of Postgres.c: .. Foreach(parsetree_listparsetree){ //In what situation here will be many parsetrees You can send multiple queries in a single string, SELECT;SELECT. (List *)querytree_list = pg_analyze_and_rewrite(parsetree); foreach(querytree_listquerytree){ //In what situation here will be many querytrees A RULE may have additional queries to fire. Who can tell me the reason? Thank you very much Jinqiang Han ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 . = = = = = = = = = = = = = = = = = = = = ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[HACKERS] inquiry about multi-row resultset in functions
dear hacker, hello. I want to know how to build a function of my own which returns rows of resultset, not just a row. Can anybody help me? Thank you in advance. Jinqiang Han ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Re: [HACKERS] inquiry about multi-row resultset in functions
??? wrote: dear hacker, hello. I want to know how to build a function of my own which returns rows of resultset, not just a row. Can anybody help me? Thank you in advance. It is possible, but not very user friendly if you are using PostgreSQL 7.2.x or before. See contrib/dblink/dblink.c for an example of how to write a C function to do this. It is also possible in SQL language functions, but very inefficient and difficult to use. Search the mail archives for examples. It is not possible at all with PL/pgSQL in 7.2.x (or earlier). In 7.3, which is currently in beta testing, creating a function returning a resultset (also know as table functions) is much easier. Table functions can be created using C, SQL, or PL/pgSQL languages. See: http://developer.postgresql.org/docs/postgres/xfunc-tablefunctions.html http://developer.postgresql.org/docs/postgres/xfunc-sql.html http://developer.postgresql.org/docs/postgres/xfunc-c.html http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html HTH, Joe ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[HACKERS] inquiry
Dear Momjian£¬ hello, I want to make the show variable SQL to returnmessage like pgresult. how can I revise the source code? Any suggestion? I really need you help. Jinqiang Han
Re: [HACKERS] inquiry
thank you for your information. I want to use the imformation of show or other utilities sql in jdbc interface. generally resultset is empty when such sql is execute. I want to get the information like psql. How can I do? Thanks again. Youshouldaskthisongeneral,andbemorespecificabouthowpgresult isdifferentfromthatSHOWcurrentlydoes. Duetotimeconstraints,IdonotdirectlyanswergeneralPostgreSQL questions.Forassistance,pleasejointheappropriatemailinglistand postyourquestion: http://www.postgresql.org/users-lounge Youcanalsotrythe#postgresqlIRCchannel.SeethePostgreSQLFAQ formoreinformation. --- [?GB2312?]wrote: DearMomjian£¬ hello, IwanttomaketheshowvariableSQLtoreturnmessagelikepgresult.howcanIrevisethesourcecode?Anysuggestion? Ireallyneedyouhelp. JinqiangHan -- BruceMomjian|http://candle.pha.pa.us [EMAIL PROTECTED]|(610)359-1001 +Ifyourlifeisaharddrive,|13RobertsRoad +Christcanbeyourbackup.|NewtownSquare,Pennsylvania19073
Re: [HACKERS] inquiry
In 7.3, SHOW returns a query results that can be resturned to jdbc. We are using beta1/2 now, so you can test that from ftp.postgresql.org. --- [ ?GB2312?] wrote: thank you for your information. I want to use the imformation of show or other utilities sql in jdbc interface. generally resultset is empty when such sql is execute. I want to get the information like psql. How can I do? Thanks again. You should ask this on general, and be more specific about how pgresult is different from that SHOW currently does. Due to time constraints, I do not directly answer general PostgreSQL questions. For assistance, please join the appropriate mailing list and post your question: http://www.postgresql.org/users-lounge You can also try the #postgresql IRC channel. See the PostgreSQL FAQ for more information. --- [ ?GB2312?] wrote: Dear Momjian£¬ hello, I want to make the show variable SQL to return message like pgresult. how can I revise the source code? Any suggestion? I really need you help. Jinqiang Han -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[HACKERS] inquiry
Hi,all expert of the postgresql. I want to learn the kernel of postgresql. WhenI debug it with gdb, I come to a problem that I can't solve. In the BackendStartup() it forks a new child process. I can't trace into the new child process with attach. It say that Operation is not permitted. I really need your help. Thank you very much. Jinqiang Han
[HACKERS] Inquiry From Form [pgsql]
does anybody know who i can talk to about a virus/bug scanning engine for postgresql tables/webportal stuff? i would like to start a proof-of-concept thread for this. sounds strange, i know, but chill out, details to come. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[HACKERS] inquiry using create function
Hello, This is my first post here. I've tried to search the archive and i haven't found an answer to my problem...here it is... I created a function with the create function+setof keywords... create function employee(int) returns setof employee as 'select * from employee where $1 = id' language 'sql'; Instead of returning a tuple, I get this: ?column? --- 136491256 I tried exchanging $1 and id but the thing did not yet work. I replaced the * with the actual fields in my table and it still would not work. What could be the problem? By the way, I use postgreseql 7.1.3 Thanks! Carlo Florendo ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
[HACKERS] inquiry using create function
Hello, I've tried to search some postgresql mailing lists and i haven't found an answer to my problem... I create a function with the setof keyword... create function employee(int) returns setof employee as 'select * from employee where $1 = id' language 'sql'; Instead of returning a tuple, I get this: ?column? --- 136491256 I tried exchanging $1 and id but the thing did not yet work. I replaced the * with the actual fields in my table and it still would not work. What could be the problem? By the way, I use postgreseql 7.1.3 Thanks! Carlo Florendo ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html