[SQL]

2001-03-03 Thread Gerald Gutierrez
I don't seem to be able to create tables (persistent or temporary) from within a PL/PGSQL function. With the following script, I can create the function fine: CREATE FUNCTION tst() RETURNS INTEGER AS ' BEGIN CREATE TABLE ttt(a int); RETURN 0; END; ' LANGUAGE 'plpgsql'; ... but when

[SQL] Passing table names to PL/PGSQL for SELECT/UPDATE/INSERT

2001-03-03 Thread Gerald Gutierrez
I've written my Dijkstra's algorithm in PL/PGSQL. It didn't turn out to be a big deal at all actually, programming-wise. I understand execution speed will be poor but it shouldn't be any slower than having something else, like PHP or Java, execute logic and query the database. I'd like to gen

Re: [HACKERS] why the DB file size does not reduce when 'delete'thedata in DB?

2001-03-03 Thread The Hermit Hacker
On Sun, 4 Mar 2001, xuyifeng wrote: > > - Original Message - > From: The Hermit Hacker <[EMAIL PROTECTED]> > To: Jaruwan Laongmal <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Friday, March 02, 2001 8:04 PM > Subject: Re: [HACKERS] why the DB file size does no

Re: [HACKERS] why the DB file size does not reduce when 'delete'the data in DB?

2001-03-03 Thread xuyifeng
- Original Message - From: The Hermit Hacker <[EMAIL PROTECTED]> To: Jaruwan Laongmal <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, March 02, 2001 8:04 PM Subject: Re: [HACKERS] why the DB file size does not reduce when 'delete'the data in DB? > On Fri

Re: [SQL] Temp Tables & Connection Pooling

2001-03-03 Thread Gerald Gutierrez
At 12:48 PM 3/2/2001 -0800, David Olbersen wrote: >On Fri, 2 Mar 2001, Gerald Gutierrez wrote: > >->Recently I wanted to implement Dijkstra's algorithm as a stored procedure, >->and finding that PL/PGSQL cannot return record sets, I thought about using >->a temporary table for the results. If temp

Re: [SQL] Insert into VIEW ???

2001-03-03 Thread Richard Huxton
Jacek Zagorski wrote: > > Is it possible to INSERT into xyz > where xyz is a view ? > What is the proper syntax ? > > Thanks Much > Jacek Zagorski You'll need to set up the rules for updating - PG can't figure out what you want automatically. There's a page on this in the programmer's guide. -

Re: [SQL] Temp Tables & Connection Pooling

2001-03-03 Thread Richard Huxton
David Olbersen wrote: > > On Fri, 2 Mar 2001, Gerald Gutierrez wrote: > > ->Recently I wanted to implement Dijkstra's algorithm as a stored procedure, > ->and finding that PL/PGSQL cannot return record sets, I thought about using > ->a temporary table for the results. If tempoary tables are sess

Re: [SQL] lo_import for storing Blobs

2001-03-03 Thread pgsql-sql
You can use 'DBI' from test.pl of DBD::Pg # create large object from binary file my ($ascii, $pgin); foreach $ascii (0..255) { $pgin .= chr($ascii); }; my $PGIN = '/tmp/pgin'; open(PGIN, ">$PGIN") or die "can not open $PGIN"; print PGIN $pgin; close PGIN; # begin transaction $dbh->{AutoCo

Re: [SQL] Help creating rules/triggers/functions

2001-03-03 Thread Jan Wieck
Blaise Carrupt wrote: > Hi all ! > > I use PostgreSQL 7.0.2 on a HP-UX system. > > I would like to create a simple function and a simple trigger (or rule) that > deny a delete from a table if the row is referenced in another table. > > I though it should look like this (from my Ingres experience..