Unix Technical Forum

Nested/recursive query execution

This is a discussion on Nested/recursive query execution within the pgsql Hackers forums, part of the PostgreSQL category; --> Hi all, I am new to postgres developement. Want some help. Can we run nested query in postgres? Means, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 06:21 AM
Paresh Bafna
 
Posts: n/a
Default Nested/recursive query execution

Hi all,
I am new to postgres developement. Want some help.
Can we run nested query in postgres?
Means, can I do like -

When somequery is being executed (say "create database") it goes through
exec_simple_query():backend/tcop/postgres.c (if I am not wrong) then can
I call exec_simple_query() from createdb():backend/commands/dbcommands.c

Actually I tried to do that but I think portal used for "create
database" is still ACTIVE when I call exec_simple_again, and thats why
it give error like "can not drop portal - still active"

Is it due to exec_simple_query() creates unnamed portal?



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 06:22 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: Nested/recursive query execution

On Sat, Oct 22, 2005 at 03:41:07PM +0530, Paresh Bafna wrote:
> Hi all,
> I am new to postgres developement. Want some help.
> Can we run nested query in postgres?


The answer is yes, although you generally need to use the SPI interface
to do it. Among other things it sets up everything to work recursively.

Consider, foreign keys, SQL functions, etc are all recursive
invokations of a sort....

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFDWhL8IB7bNG8LQkwRAiOwAJ49re0HemWLtTCQ/DaCUGyBK7Bo0ACfUV0q
vILQoFNS41ZruIvgtyaLc1c=
=eSez
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com