traight forward to format user input into an SQL statement that
uses arrays and composite types. It's even worse going the other way --
just Google how to convert SQL arrays into PHP arrays. :-(
Karl Nack
Futurity, Inc
5121 N Ravenswood Ave
Chicago, IL 60640
773-506-2007
--
Sent via pgs
> I wonder which other languages have first class support for these areas
> of Pg?
It'd be nice if PHP could get there. :p Maybe it's time to look at some
of these other languages. Or finally learn C and try hacking on the
extension myself.
Karl Nack
Futurity, Inc
5121 N Ravens
important.
>
> That's problematic to do in PostgreSQL because statement-level
> triggers don't have access to statement args, and I don't believe they
> can be deferred.
In another email I did provide a simple example of how I might implement
this; I don't know if
'Transaction 1',
'line_items' => array(
array('account_id' => 1, 'amount' => 50),
array('account_id' => 2, 'amount' => -50),
),
);
>From which I can easily build the appropriate SQL statements. Thi
plete. This would
enforce data integrity regardless of whether or not the database API is
used, which I think is also important.
Karl Nack
Futurity, Inc
5121 N Ravenswood Ave
Chicago, IL 60640
773-506-2007
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
tatement that INSERTs data, which is
> semantically a bad thing to do IMHO.
True, although others have suggested always returning something useful
from the function. For example, it's more likely the transaction id
would be assigned using a sequence inside the database. The function
could
id, is_balanced) = (old.txn_id, true);
end if;
return null;
end;
$$;
create trigger unbalance_txn
after insert or delete or update on line_item
for each row execute procedure unbalance_txn();
At least, this seems to be a fairly efficient and foolproof way to do it
to me.
Karl Nack
ging through the
documentation, but I really have no idea how to do something like this,
or if it's even possible. I'm really hoping someone can provide an
example, point me to some resources, or even just share their real-world
experience of doing something like this. It would be very much
ap
g.
If anyone has suggestions or some experience they could offer with this,
I'd greatly appreciate it.
Thanks!
Karl Nack
Futurity, Inc.
773-506-2007
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
e results
depend on database lookups, parameter variables (such as the current time
zone), etc."
Apparently not the case for after-update triggers that need to reference
the just-updated table.
Regardless, thank you very much for the help!
Karl Nack
Futurity, Inc.
773-506-2007
--
Sent
hanges.html
http://www.postgresql.org/docs/8.3/interactive/trigger-example.html
Am I doing something wrong here? Have I misunderstood the manual? Have I
found a bug? Any help is greatly appreciated, as this check is pretty key
to what I'm trying to do.
Thanks.
Karl Nack
Futurity, Inc.
773-506-2007
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ain constant. I
feel like I should probably include some kind of constraint to enforce
this.
Am I needlessly over-complicating this?
-Karl
Karl Nack
Futurity, Inc.
773-506-2007
- Original Message -
From: [EMAIL PROTECTED]
Sent: Tue, October 21, 2008 7:31
Subject:Re: [GENERAL] How best
do you need to store the total area at all (property_area)? This
value can easily be calculated with an group by query.
On Mon, Oct 20, 2008 at 10:56 PM, Karl Nack <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I'm a bit of a newb designing a database to hold landcover information
Hello all,
I'm a bit of a newb designing a database to hold landcover information for
properties in a city. Here's some simple sample data:
property:
property_name*, property_area
-
sample house, 2500
property_landcover:
property_name*, landcover_name*, landcover_are
14 matches
Mail list logo