pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
TODO item for plpgsql Was Re: obtuse plpgsql function needs
11+ messages / 4 participants
[nested] [flat]

* TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-07-23 20:13  Robert Treat <xzilla@users.sourceforge.net>
  0 siblings, 1 reply; 11+ messages in thread

From: Robert Treat @ 2003-07-23 20:13 UTC (permalink / raw)
  To: pgsql-sql

On Wed, 2003-07-23 at 15:38, greg@turnstep.com wrote:
>   FOR myrec IN EXECUTE myinfo LOOP
>     biglist := myrec.info;
>   END LOOP;
> 

One other thing, I hate when I have to do things like the above, can we
get a TODO like:

allow 'EXECUTE var INTO record' in plpgsql

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-07-23 23:06  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Robert Treat <xzilla@users.sourceforge.net>
  0 siblings, 1 reply; 11+ messages in thread

From: Bruce Momjian @ 2003-07-23 23:06 UTC (permalink / raw)
  To: Robert Treat <xzilla@users.sourceforge.net>; +Cc: pgsql-sql

Robert Treat wrote:
> On Wed, 2003-07-23 at 15:38, greg@turnstep.com wrote:
> >   FOR myrec IN EXECUTE myinfo LOOP
> >     biglist := myrec.info;
> >   END LOOP;
> > 
> 
> One other thing, I hate when I have to do things like the above, can we
> get a TODO like:
> 
> allow 'EXECUTE var INTO record' in plpgsql

So the TODO would be?

	Allow PL/pgSQL EXECUTE to return a single record outside a loop

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-07-24 02:00  Robert Treat <xzilla@users.sourceforge.net>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 11+ messages in thread

From: Robert Treat @ 2003-07-24 02:00 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-sql

On Wednesday 23 July 2003 19:06, Bruce Momjian wrote:
> Robert Treat wrote:
> > On Wed, 2003-07-23 at 15:38, greg@turnstep.com wrote:
> > >   FOR myrec IN EXECUTE myinfo LOOP
> > >     biglist := myrec.info;
> > >   END LOOP;
> >
> > One other thing, I hate when I have to do things like the above, can we
> > get a TODO like:
> >
> > allow 'EXECUTE var INTO record' in plpgsql
>
> So the TODO would be?
>
> 	Allow PL/pgSQL EXECUTE to return a single record outside a loop

that's what I wrote, but not what I meant :-)  I do like the sound of it 
though, but really what I meant to say was:
EXECUTE var1 INTO var2
but this assumes a number of things, namely that executing var1 will return 
only one field, and one row.  I guess that would be:
Allow PL/pgSQL EXECUTE to return a single variable outside a loop

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-07-31 04:12  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Robert Treat <xzilla@users.sourceforge.net>
  0 siblings, 1 reply; 11+ messages in thread

From: Bruce Momjian @ 2003-07-31 04:12 UTC (permalink / raw)
  To: Robert Treat <xzilla@users.sourceforge.net>; +Cc: pgsql-sql


Does Oracle have a syntax for this?

---------------------------------------------------------------------------

Robert Treat wrote:
> On Wednesday 23 July 2003 19:06, Bruce Momjian wrote:
> > Robert Treat wrote:
> > > On Wed, 2003-07-23 at 15:38, greg@turnstep.com wrote:
> > > >   FOR myrec IN EXECUTE myinfo LOOP
> > > >     biglist := myrec.info;
> > > >   END LOOP;
> > >
> > > One other thing, I hate when I have to do things like the above, can we
> > > get a TODO like:
> > >
> > > allow 'EXECUTE var INTO record' in plpgsql
> >
> > So the TODO would be?
> >
> > 	Allow PL/pgSQL EXECUTE to return a single record outside a loop
> 
> that's what I wrote, but not what I meant :-)  I do like the sound of it 
> though, but really what I meant to say was:
> EXECUTE var1 INTO var2
> but this assumes a number of things, namely that executing var1 will return 
> only one field, and one row.  I guess that would be:
> Allow PL/pgSQL EXECUTE to return a single variable outside a loop
> 
> Robert Treat
> -- 
> Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
> 
> ---------------------------(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
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-08-01 19:16  Robert Treat <xzilla@users.sourceforge.net>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 11+ messages in thread

From: Robert Treat @ 2003-08-01 19:16 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-sql

I don't seem to have any plsql specfic documentation, and the rest of my 
oracle documentation isn't specfific enough. Anyone else?

Robert Treat

On Thursday 31 July 2003 00:12, Bruce Momjian wrote:
> Does Oracle have a syntax for this?
>
> ---------------------------------------------------------------------------
>
> Robert Treat wrote:
> > On Wednesday 23 July 2003 19:06, Bruce Momjian wrote:
> > > Robert Treat wrote:
> > > > On Wed, 2003-07-23 at 15:38, greg@turnstep.com wrote:
> > > > >   FOR myrec IN EXECUTE myinfo LOOP
> > > > >     biglist := myrec.info;
> > > > >   END LOOP;
> > > >
> > > > One other thing, I hate when I have to do things like the above, can
> > > > we get a TODO like:
> > > >
> > > > allow 'EXECUTE var INTO record' in plpgsql
> > >
> > > So the TODO would be?
> > >
> > > 	Allow PL/pgSQL EXECUTE to return a single record outside a loop
> >
> > that's what I wrote, but not what I meant :-)  I do like the sound of it
> > though, but really what I meant to say was:
> > EXECUTE var1 INTO var2
> > but this assumes a number of things, namely that executing var1 will
> > return only one field, and one row.  I guess that would be:
> > Allow PL/pgSQL EXECUTE to return a single variable outside a loop
> >
> > Robert Treat
> > --
> > Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> >                http://www.postgresql.org/docs/faqs/FAQ.html

-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-08-01 20:06  Josh Berkus <josh@agliodbs.com>
  parent: Robert Treat <xzilla@users.sourceforge.net>
  0 siblings, 1 reply; 11+ messages in thread

From: Josh Berkus @ 2003-08-01 20:06 UTC (permalink / raw)
  To: Robert Treat <xzilla@users.sourceforge.net>; Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-sql

Robert,

> I don't seem to have any plsql specfic documentation, and the rest of my 
> oracle documentation isn't specfific enough. Anyone else?

As far as I can tell from my PL/SQL guide to Oracle8, PL/SQL does not permit 
exectution of strings-as-queries at all.  So there's no equivalent in PL/SQL.

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-08-01 20:26  Richard Poole <richard@ruthie.org>
  parent: Josh Berkus <josh@agliodbs.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Richard Poole @ 2003-08-01 20:26 UTC (permalink / raw)
  To: pgsql-sql

On Fri, Aug 01, 2003 at 01:06:18PM -0700, Josh Berkus wrote:

> As far as I can tell from my PL/SQL guide to Oracle8, PL/SQL does not permit 
> exectution of strings-as-queries at all.  So there's no equivalent in PL/SQL.

I'm not an Oracle bunny but they seem to have something vaguely similar
to what we do; they call it "EXECUTE IMMEDIATE" and the concept is
described as "Dynamic SQL".

http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a77069/10_dynam.htm#4376

Richard



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-08-01 21:02  Josh Berkus <josh@agliodbs.com>
  parent: Richard Poole <richard@ruthie.org>
  0 siblings, 1 reply; 11+ messages in thread

From: Josh Berkus @ 2003-08-01 21:02 UTC (permalink / raw)
  To: Richard Poole <richard@ruthie.org>; pgsql-sql

Guys,

> I'm not an Oracle bunny but they seem to have something vaguely similar
> to what we do; they call it "EXECUTE IMMEDIATE" and the concept is
> described as "Dynamic SQL".

Aha.  I see it now; a pretty awful OO-package-style format.   I don't think we 
want to imitate this.

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-08-01 21:31  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Josh Berkus <josh@agliodbs.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Bruce Momjian @ 2003-08-01 21:31 UTC (permalink / raw)
  To: josh@agliodbs.com; +Cc: Richard Poole <richard@ruthie.org>; pgsql-sql


OK, so what should the TODO item be?

---------------------------------------------------------------------------

Josh Berkus wrote:
> Guys,
> 
> > I'm not an Oracle bunny but they seem to have something vaguely similar
> > to what we do; they call it "EXECUTE IMMEDIATE" and the concept is
> > described as "Dynamic SQL".
> 
> Aha.  I see it now; a pretty awful OO-package-style format.   I don't think we 
> want to imitate this.
> 
> -- 
> -Josh Berkus
>  Aglio Database Solutions
>  San Francisco
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-08-01 21:39  Josh Berkus <josh@agliodbs.com>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 11+ messages in thread

From: Josh Berkus @ 2003-08-01 21:39 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Richard Poole <richard@ruthie.org>; pgsql-sql

Bruce,

> OK, so what should the TODO item be?

Go with the simple and intuitive:

EXECUTE query_var INTO record_var;

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
@ 2003-08-01 21:44  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Josh Berkus <josh@agliodbs.com>
  0 siblings, 0 replies; 11+ messages in thread

From: Bruce Momjian @ 2003-08-01 21:44 UTC (permalink / raw)
  To: josh@agliodbs.com; +Cc: Richard Poole <richard@ruthie.org>; pgsql-sql


Added.

---------------------------------------------------------------------------

Josh Berkus wrote:
> Bruce,
> 
> > OK, so what should the TODO item be?
> 
> Go with the simple and intuitive:
> 
> EXECUTE query_var INTO record_var;
> 
> -- 
> -Josh Berkus
>  Aglio Database Solutions
>  San Francisco
> 
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2003-08-01 21:44 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-23 20:13 TODO item for plpgsql Was Re: obtuse plpgsql function needs Robert Treat <xzilla@users.sourceforge.net>
2003-07-23 23:06 ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-07-24 02:00   ` Robert Treat <xzilla@users.sourceforge.net>
2003-07-31 04:12     ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-08-01 19:16       ` Robert Treat <xzilla@users.sourceforge.net>
2003-08-01 20:06         ` Josh Berkus <josh@agliodbs.com>
2003-08-01 20:26           ` Richard Poole <richard@ruthie.org>
2003-08-01 21:02             ` Josh Berkus <josh@agliodbs.com>
2003-08-01 21:31               ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-08-01 21:39                 ` Josh Berkus <josh@agliodbs.com>
2003-08-01 21:44                   ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox