pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
can we write to a flat file from Postgresql procedure
7+ messages / 5 participants
[nested] [flat]

* can we write to a flat file from Postgresql procedure
@ 2001-07-05 15:34  R Vijayanath <vijayanath@yahoo.com>
  0 siblings, 2 replies; 7+ messages in thread

From: R Vijayanath @ 2001-07-05 15:34 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I found your name in the Postgresql web site.

It would be great if you can tell me if I can write a
procedure that can write the output to the OS(Linux
OS) file.

Can you assist me on this if there is a way to do it.

We are using Postgresql 7.1 running in Linux Redhat
7.1.

Thanks in Advance.

Vijay


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



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

* Re: can we write to a flat file from Postgresql procedure
@ 2001-07-11 12:36  Jan Wieck <JanWieck@Yahoo.com>
  parent: R Vijayanath <vijayanath@yahoo.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Jan Wieck @ 2001-07-11 12:36 UTC (permalink / raw)
  To: R Vijayanath <vijayanath@Yahoo.com>; +Cc: pgsql-sql

R Vijayanath wrote:
> Hi,
>
> I found your name in the Postgresql web site.
>
> It would be great if you can tell me if I can write a
> procedure that can write the output to the OS(Linux
> OS) file.
>
> Can you assist me on this if there is a way to do it.
>
> We are using Postgresql 7.1 running in Linux Redhat
> 7.1.

    In  version  7.1  is  a  procedural language PL/TclU. It's an
    unrestricted (and thus untrusted) version of PL/Tcl. Meaning,
    since  it's  possible  to do any sort of OS level access from
    within the backend under  the  postgres  UNIX  user-ID,  only
    Postgres superusers can create functions in that language.

    That's  the  only  choice other than C you have. There are no
    plans yet to modify PL/pgSQL in that direction.

>
> Thanks in Advance.

    You're welcome.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




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

* Re: can we write to a flat file from Postgresql procedure
@ 2001-07-11 14:47  Peter Eisentraut <peter_e@gmx.net>
  parent: R Vijayanath <vijayanath@yahoo.com>
  1 sibling, 1 reply; 7+ messages in thread

From: Peter Eisentraut @ 2001-07-11 14:47 UTC (permalink / raw)
  To: R Vijayanath <vijayanath@yahoo.com>; +Cc: pgsql-sql

R Vijayanath writes:

> It would be great if you can tell me if I can write a
> procedure that can write the output to the OS(Linux
> OS) file.

You could try out PL/sh for that.

http://www.postgresql.org/~petere/plsh.html

YMMV

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter




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

* Re: can we write to a flat file from Postgresql procedure
@ 2001-07-11 15:03  Alex Pilosov <alex@pilosoft.com>
  parent: Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Alex Pilosov @ 2001-07-11 15:03 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: R Vijayanath <vijayanath@yahoo.com>; pgsql-sql

On Wed, 11 Jul 2001, Peter Eisentraut wrote:

> R Vijayanath writes:
> 
> > It would be great if you can tell me if I can write a
> > procedure that can write the output to the OS(Linux
> > OS) file.
> 
> You could try out PL/sh for that.
> 
> http://www.postgresql.org/~petere/plsh.html
Well, as long as we all keep plugging our favorite languages, in 7.2, you
can use pl/perlu ;)
-alex




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

* RE: can we write to a flat file from Postgresql procedure
@ 2001-07-11 15:15  Jeff Eckermann <jeckermann@verio.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Jeff Eckermann @ 2001-07-11 15:15 UTC (permalink / raw)
  To: 'R Vijayanath' <vijayanath@yahoo.com>; pgsql-sql

I don't think there is any way to do this using any of the generally
available tools.

You could do a workaround using pl/pgsql, in the following way:
*	insert your data into a temp table
*	output the data to a file using COPY

pl/pgsql allows INSERT statements, but does not allow CREATE/DROP TABLE or
COPY statements.  Those can be constructed using EXECUTE, which takes a
string (which can be constructed using parameters) and passes it on to be
executed as an SQL statement.

For more information, check out the PostgreSQL documentation, especially on
pl/pgsql (under "Procedural Languages") and COPY (under "SQL Commands").

> -----Original Message-----
> From:	R Vijayanath [SMTP:vijayanath@yahoo.com]
> Sent:	Thursday, July 05, 2001 10:34 AM
> To:	pgsql-sql@postgresql.org
> Subject:	can we write to a flat file from Postgresql procedure
> 
> Hi,
> 
> I found your name in the Postgresql web site.
> 
> It would be great if you can tell me if I can write a
> procedure that can write the output to the OS(Linux
> OS) file.
> 
> Can you assist me on this if there is a way to do it.
> 
> We are using Postgresql 7.1 running in Linux Redhat
> 7.1.
> 
> Thanks in Advance.
> 
> Vijay
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly



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

* RE: can we write to a flat file from Postgresql procedure
@ 2001-07-11 15:19  Jeff Eckermann <jeckermann@verio.net>
  0 siblings, 1 reply; 7+ messages in thread

From: Jeff Eckermann @ 2001-07-11 15:19 UTC (permalink / raw)
  To: 'Alex Pilosov' <alex@pilosoft.com>; +Cc: pgsql-sql

I haven't seen anything on this list to say that pl/perlu is being worked
on.  Is it?

> -----Original Message-----
> From:	Alex Pilosov [SMTP:alex@pilosoft.com]
> Sent:	Wednesday, July 11, 2001 10:03 AM
> To:	Peter Eisentraut
> Cc:	R Vijayanath; pgsql-sql@postgresql.org
> Subject:	Re: can we write to a flat file from Postgresql procedure
> 
> On Wed, 11 Jul 2001, Peter Eisentraut wrote:
> 
> > R Vijayanath writes:
> > 
> > > It would be great if you can tell me if I can write a
> > > procedure that can write the output to the OS(Linux
> > > OS) file.
> > 
> > You could try out PL/sh for that.
> > 
> > http://www.postgresql.org/~petere/plsh.html
> Well, as long as we all keep plugging our favorite languages, in 7.2, you
> can use pl/perlu ;)
> -alex
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly



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

* RE: can we write to a flat file from Postgresql procedure
@ 2001-07-11 17:51  Alex Pilosov <alex@pilosoft.com>
  parent: Jeff Eckermann <jeckermann@verio.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Alex Pilosov @ 2001-07-11 17:51 UTC (permalink / raw)
  To: Jeff Eckermann <jeckermann@verio.net>; +Cc: pgsql-sql

Its done and committed to CVS, will be in 7.2 release.

Also done is DBD::PgSPI, interface to access postgres from within your
stored procedure. (www.formenos.org/PgSPI)

-alex

On Wed, 11 Jul 2001, Jeff Eckermann wrote:

> I haven't seen anything on this list to say that pl/perlu is being worked
> on.  Is it?
> 
> > -----Original Message-----
> > From:	Alex Pilosov [SMTP:alex@pilosoft.com]
> > Sent:	Wednesday, July 11, 2001 10:03 AM
> > To:	Peter Eisentraut
> > Cc:	R Vijayanath; pgsql-sql@postgresql.org
> > Subject:	Re: can we write to a flat file from Postgresql procedure
> > 
> > On Wed, 11 Jul 2001, Peter Eisentraut wrote:
> > 
> > > R Vijayanath writes:
> > > 
> > > > It would be great if you can tell me if I can write a
> > > > procedure that can write the output to the OS(Linux
> > > > OS) file.
> > > 
> > > You could try out PL/sh for that.
> > > 
> > > http://www.postgresql.org/~petere/plsh.html
> > Well, as long as we all keep plugging our favorite languages, in 7.2, you
> > can use pl/perlu ;)
> > -alex
> > 
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly
> 
> 




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


end of thread, other threads:[~2001-07-11 17:51 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-05 15:34 can we write to a flat file from Postgresql procedure R Vijayanath <vijayanath@yahoo.com>
2001-07-11 12:36 ` Jan Wieck <JanWieck@Yahoo.com>
2001-07-11 14:47 ` Peter Eisentraut <peter_e@gmx.net>
2001-07-11 15:03   ` Alex Pilosov <alex@pilosoft.com>
2001-07-11 15:15 RE: can we write to a flat file from Postgresql procedure Jeff Eckermann <jeckermann@verio.net>
2001-07-11 15:19 RE: can we write to a flat file from Postgresql procedure Jeff Eckermann <jeckermann@verio.net>
2001-07-11 17:51 ` Alex Pilosov <alex@pilosoft.com>

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