Hello,
Does anybody have a site links for visual basic and postgresql?
What are your opinions about VB/MySQL and VB/PostgreSQL?
Thanks,
Michael Louie Loria
LoRz Technology Solutions
http://www.lorztech.com
signature.asc
Description: OpenPGP digital signature
Tom Lane <[EMAIL PROTECTED]> writes:
> A SQL-language function like this should get inlined into the query,
> so that you don't lose any performance compared to writing out the
> full expression each time.
I think what's going on here is that he doesn't really want a function in the
programming s
"Simon Kinsella" <[EMAIL PROTECTED]> writes:
> CREATE RULE rule_soft_delete_user AS ON DELETE TO users
> WHERE user_departed > now()
> DO INSTEAD
> UPDATE users SET user_departed = now()
> WHERE user_id = OLD.user_id;
This is run before the delete. However, since it's a conditional
Hello,
Can this possibly be right?
>From my troubleshooting of a DELETE rule it appears that the rule's WHERE
condition sees the *results* of the rule-actions. Apart from being pretty
odd, this is a proving to be a big problem in my situation.
Here is a cut-down example:
Given a table 'users',
On Sun, 5 Mar 2006 [EMAIL PROTECTED] wrote:
> On Sun, Mar 05, 2006 at 11:38:46AM -0800, Stephan Szabo wrote:
> > > But imagine instead that this function is more generic. You know
> > > that you're trying to get something that's equal to x and equal to
> > > y, but you don't know (until the func
On Sun, Mar 05, 2006 at 11:38:46AM -0800, Stephan Szabo wrote:
> > But imagine instead that this function is more generic. You know
> > that you're trying to get something that's equal to x and equal to
> > y, but you don't know (until the function is called) what those
> > rvalues should be. In
On Sun, 5 Mar 2006 [EMAIL PROTECTED] wrote:
> On Sun, Mar 05, 2006 at 01:16:40PM -0500, Tom Lane wrote:
> > [EMAIL PROTECTED] writes:
> > That would work fine if you said RETURNS SETOF ltree.
> >
> > That should work too, except that you are trying to return a record
> > not an ltree value. Try "
On Sun, Mar 05, 2006 at 01:16:40PM -0500, Tom Lane wrote:
> [EMAIL PROTECTED] writes:
> That would work fine if you said RETURNS SETOF ltree.
>
> That should work too, except that you are trying to return a record
> not an ltree value. Try "RETURN NEXT tree.ltree".
>
> > Because SETOF won't work
On Sun, 5 Mar 2006, Michael Glaesemann wrote:
On Mar 5, 2006, at 17:25 , Jeff Frost wrote:
I believe you're looking for what is called a partial index.
http://www.postgresql.org/docs/current/interactive/indexes-partial.html
create unique index foo_partial_idx on foo (id) where active;
Than
[EMAIL PROTECTED] writes:
> You can't do this:
> CREATE FUNCTION xpath(lquery) RETURNS ltree AS $$
> SELECT ltree FROM event WHERE ltree ~ $1;
> $$ LANGUAGE SQL;
That would work fine if you said RETURNS SETOF ltree.
> But I also can't get this kind of thing to work:
> CREATE FUNCTION xpath(lq
[EMAIL PROTECTED] writes:
> I've got one of these:
> SELECT * from some_table WHERE
> test_for_equality_is_syntactically_ugly;
> What I'd like to do is encapsulate the WHERE clause in a function,
You mean like replacing
SELECT * from some_table WHERE x = 42 AND y = 77
with
create function mytes
On Sun, Mar 05, 2006 at 12:02:58PM +0300, Nikolay Samokhvalov wrote:
> Unfortunately, at the moment Postgres doesn't support subqueries in
> CHECK constraints, so it's seems that you should use trigger to check
> what you need
The OP could also use a check constraint with a function if
everything
On Sun, Mar 05, 2006 at 10:26:35AM -0700, Michael Fuhr wrote:
> On Sun, Mar 05, 2006 at 10:16:52AM -0500, [EMAIL PROTECTED] wrote:
> > I've got one of these:
> >
> > SELECT * from some_table WHERE
> > test_for_equality_is_syntactically_ugly;
> >
> > What I'd like to do is encapsulate the WHERE cl
On Sun, Mar 05, 2006 at 10:16:52AM -0500, [EMAIL PROTECTED] wrote:
> I've got one of these:
>
> SELECT * from some_table WHERE
> test_for_equality_is_syntactically_ugly;
>
> What I'd like to do is encapsulate the WHERE clause in a function,
> but I'm having no end of trouble.
Would a view work?
Hi All,
I've got one of these:
SELECT * from some_table WHERE
test_for_equality_is_syntactically_ugly;
What I'd like to do is encapsulate the WHERE clause in a function,
but I'm having no end of trouble.
The WHERE clause expects the function to return a boolean value. I
can certainly return a
On Mar 5, 2006, at 17:25 , Jeff Frost wrote:
And would like to make a unique constraint which would only check
the uniqueness of id if active=true.
I believe you're looking for what is called a partial index.
http://www.postgresql.org/docs/current/interactive/indexes-partial.html
Note, I'v
On Mar 05 12:02, Nikolay Samokhvalov wrote:
> Unfortunately, at the moment Postgres doesn't support subqueries in
> CHECK constraints
I don't know how feasible this is but, it's possible to hide subqueries
that will be used in constraints in procedures. Here's an alternative
method to Nikolay's:
just a better way (workaround for subqueries in check constraints...):
CREATE OR REPLACE FUNCTION id_is_valid(
val INTEGER
) RETURNS boolean AS $BODY$
BEGIN
IF val IN (
SELECT id FROM foo WHERE active = TRUE AND id = val
) THEN
RETURN FALSE;
ELSE
RETURN TRUE
Unfortunately, at the moment Postgres doesn't support subqueries in
CHECK constraints, so it's seems that you should use trigger to check
what you need, smth like this:
CREATE OR REPLACE FUNCTION foo_check() RETURNS trigger AS $BODY$
BEGIN
IF NEW.active = TRUE AND NEW.id IN (
SELECT id
I have a table with the following structure:
Column | Type | Modifiers
+-+---
active | boolean | not null default true
id | integer | not null
(other columns left out)
And would like to make a unique constraint which would only
20 matches
Mail list logo