On Mon, Sep 15, 2008 at 10:55 AM, c k <[EMAIL PROTECTED]> wrote:
> Dear PG members,
> I want to know that does begin and end in plpgsql are related to begin
> transactions and commit? if yes/no how?
No. a plpgsql function is a transaction in its entirety. If called
within a transaction it inheri
create a type and return this
--- On Sat, 8/2/08, C K <[EMAIL PROTECTED]> wrote:
> From: C K <[EMAIL PROTECTED]>
> Subject: [ADMIN] functions
> To: "pgsql-admin@postgresql.org"
> Date: Saturday, August 2, 2008, 9:39 AM
> Dear Friends,
> I have written a function as follows. Here I need to get
>
Hello,
There a some differences from MySQL to PostgreSQL. In PostgreSQL we use
Functions, what you called "Store Procedures", that do the same thing.
In Postgres you can combine the Functions with "Triggers".
Triggers are procedures that will be done when you do some U, I or D, you
have to specifi
I've found the queries at this link to be very good for getting
detailed postgresql schema information (table columns, triggers, etc)
http://www.alberton.info/postgresql_meta_info.html
-- Ilan
On Nov 15, 2007, at 10:33 AM, König, Monika wrote:
I'm looking for a postgres-funtion that shows me
On Thu, Nov 15, 2007 at 04:33:34PM +0100, "König, Monika" wrote:
> I'm looking for a postgres-funtion that shows me the definition of a table.
In psql, this is retrieved by \d [tablename]. By running psql -E, you'll be
able to see how it generates that. (No, I'm not going to tell you, because
I
select prosrc from pg_proc where proname = '';
However you cannot see the code of C language function with this query.
is that what you wanted?
--Imad
www.EnterpriseDB.com
On 11/27/06, Doron Baranes <[EMAIL PROTECTED]> wrote:
Hi,
I'm new to postgres and i cant find how can i get a function
Alvaro Herrera wrote:
Wow, incredible. You misread the whole documentation.
I certainly did, I read it with more care this time. It is a great
solution when we're required to return a single record with a custom
type, which are few but there certainly are.
I wonder if you know any tricks t
On Fri, Jul 15, 2005 at 10:57:04AM +1000, Ezequiel Tolnay wrote:
> Thanks for the tip, but unfortunately id didn't address any of my
> concerns. I alreay use the version 8, and I'm aware of the possibility
> of using arrays for the results, which allows for some flexibility. But
> unfortunately
Thanks for the tip, but unfortunately id didn't address any of my
concerns. I alreay use the version 8, and I'm aware of the possibility
of using arrays for the results, which allows for some flexibility. But
unfortunately arrays are not records, and I'm limited to values of the
same types, and
Ezequiel Tolnay <[EMAIL PROTECTED]> writes:
> I just can't get used to the annoyance of having to create a type for
> every single function that returns a rowset. It is frankly cumbersome.
Yup. See coming attractions at, eg,
http://developer.postgresql.org/docs/postgres/xfunc-sql.html#XFUNC-OUTP
Kris Kiger <[EMAIL PROTECTED]> writes:
> Interesting. That makes sense, though. So, is there a good way to lock
> a set of rows using SELECT FOR UPDATE in plpgsql? I assume using
> PERFORM would yield the same problem, because it immediately discards
> the results.
I think PERFORM would work
Interesting. That makes sense, though. So, is there a good way to lock
a set of rows using SELECT FOR UPDATE in plpgsql? I assume using
PERFORM would yield the same problem, because it immediately discards
the results.
Thanks!
Kris
Tom Lane wrote:
Kris Kiger <[EMAIL PROTECTED]> writes:
In
Kris Kiger <[EMAIL PROTECTED]> writes:
> In your second paragraph, I think that you are saying that SELECT FOR
> UPDATE only locks one row, even though the select itself may return
> many. Am I mis-interpreting you?
No, I'm saying that plpgsql's SELECT INTO operation only reads one row.
The fac
In your second paragraph, I think that you are saying that SELECT FOR
UPDATE only locks one row, even though the select itself may return
many. Am I mis-interpreting you? Also, what do you mean by seizing on
a non-active row?
Your assumption about pkey_id is right, I meant for that to mean p
Kris Kiger <[EMAIL PROTECTED]> writes:
> Hmm.. I was trying simplify my function to get the point across with
> minimal confusion. If you don't think there is enough detail, let me
> know what is lacking and I will add the appropriate detail. The
> function is executed BEFORE insert on table1.
Hmm.. I was trying simplify my function to get the point across with
minimal confusion. If you don't think there is enough detail, let me
know what is lacking and I will add the appropriate detail. The
function is executed BEFORE insert on table1. Thanks again for the help all
Kris
Tom Lane
Kris Kiger <[EMAIL PROTECTED]> writes:
> Here is my problem. I have a function that is triggered on insert. For
> simplicity's sake, lets say the function looks like this:
> CREATE OR REPLACE FUNCTION dostuff_on_insert() RETURNS TRIGGER AS '
> DECLARE lockrows RECORD;
> BEGIN
> select into
I guess first we should understand why the insert B waits at all,the
insert A did not commit ,right ,then how did it found any pkey_id =
NEW.pkey_id? That means you have already had those while starting your
experiment.
So ,insert B wait for those "old" rows not for your insert (i mean an
INSER
transaction_isolation
---
read committed
Running Postgres 7.4 btw
Kris
Tsirkin Evgeny wrote:
What transaction level are you using?
Evgeny.
Kris Kiger wrote:
Here is my problem. I have a function that is triggered on insert.
For simplicity's sake, lets say the function looks
What transaction level are you using?
Evgeny.
Kris Kiger wrote:
Here is my problem. I have a function that is triggered on insert. For
simplicity's sake, lets say the function looks like this:
CREATE OR REPLACE FUNCTION dostuff_on_insert() RETURNS TRIGGER AS '
DECLARE lockrows RECORD;
BEGIN
20 matches
Mail list logo