> If I add the DO INSTEAD,the record can be inserted
> into 'maytable_log' and also still remain in the table
> 'maytable'. Which is exactly not exist at all. It just
> show it as im using the DO INSTEAD.
>
> My problem is, how to insert the deleted record into
> table 'mytable_log' without showin
> Currently i have implemented this as a stored procedure in the plpgsql
> language. This means that in my stored procedure i first do a
> select to
> find out if the row exists or not, then i do a insert or update
> depending if the row existed.
>
> Unfortunately, stored procedures seems awfull
Sri,
> I have a small problem in using nested transactions while
> working on Postgres 8.0.
This is a known problem with Postgres 8.0 - there is no support for
nested transactions (which occurs when calling functions). Your best bet
would be to raise an exception within B or C - this will cause
Mike,
> I am trying to run this function but the return is not
> correct. If I run the select statement from the psql command
> line it works. My guess is that the WHERE clause could be
> causing the problem. Then again, it may be how I am using
> the FOR loop. The ides column is of type T
> The problem is that we treat the PL languages as add-ons and therefore
> the documentation of the "core" system shouldn't rely on them ... but
> that leaves us presenting C-code triggers as the only examples in
> chapter 35. There is a paragraph in there suggesting you go look at
> the PL langu
> Splitting locations into subsets (like 2,2,3) doesn't work
> because it is possible that low values in one location can be offset
by
> high values in another location, and still result in an excellent
combo.
>
> The good news is these suggestions got me thinking outside
> the box. I think I
Is there any easy way to script granting privileges to a number of
functions? I've got as far as the following code before realising that
I'll need to pass in the arguments, and the arguments are stored as OIDs
in pg_proc.
Is there any easy way, such as GRANT FUNCTION OID 12345?
---CODE---
> Is there a way to assing variable a value returned from query that
> accesses the temporary table in a way you explained above?
>
> For instance, I can do:
>
> myValue := col2 FROM tmpTbl WHERE someValue = somethingElse...
If I'm parsing this correctly, all you need do is:
SELECT col2 INTO my
Ferindo,
> Is there a way to change the position attribute of a column
> in a table?
AFAIK, there's no way to change this easily. The best way to do it would
be as follows:
BEGIN WORK;
LOCK TABLE mytable IN ACCESS EXCLUSIVE MODE;
ALTER TABLE mytable ADD COLUMN col_to_move_2 coltype;
UPDATE myt
> Is there supported syntax to do 'deep' queries? That is where
> A relates to B relates to C, returning fields from each table?
>
> This doesn't seem to work. Is there a google-able term for
> this sort of query?
>
> select
>foo.aaa,
>bar.bbb,
>baz.ccc
>
> from
>foo,bar,baz
>
Hate to reply to my own posts, but I thought the solution I've come
across may help others with problems implementing savepoints and
transactions in functions.
This function implements rollbacks whilst still returning a valid row
instead of an exception. A temporary variable is used to get around
After reading up on Postgres documentation, it seems that transactions
and savepoints are not available to functions, and savepoints are
implemented via BEGIN.. EXCEPTION.. END blocks.
I have a function returning an int4 with the following proposed
structure:
-
12 matches
Mail list logo