Re: [BUGS] BUG #5171: Composite type with array does not translate in plpythonu

2009-11-09 Thread Peter Eisentraut
On Sun, 2009-11-08 at 16:33 -0500, Robert Haas wrote:
> On Sat, Nov 7, 2009 at 5:23 AM, Peter Eisentraut  wrote:
> > On fre, 2009-11-06 at 17:29 +, Jason wrote:
> >> When I have a plpythonu function returning a composite type that has an
> >> array column, the function does not work when I try to return a list for
> >> that column.
> >
> > There is a patch proposed to address that in 8.5, but before that,
> > arrays are pretty much not supported in plpythonu.
> 
> Is this at all related to bug #5128?

It's in the same area, but fixing one won't fix the other, I think.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] odd deadlock on CREATE TABLE AS SELECT

2009-11-09 Thread digitaldeath
Oh no, I thought my message was rejected and I reposted it in a
slightly modified form..

2009/11/9 Tom Lane :
> It's not a bug.  The CREATE TABLE AS SELECT is acquiring a read lock on
> table "adc", and then the ALTER TABLE RENAME tries to upgrade that lock
> to exclusive.  If you've got some other stuff going on with "adc" at
> the same time, a deadlock isn't surprising in the least.

Ok, I have split my function in two pieces, one for CREATE TABLE AS
SELECT and one for ALTER TABLE, but:

If acquired lock is only a read lock, why can't I SELECT from the adc
table while CREATEing TABLE
AS SELECT? Nobody is trying to change nothing...

> You could make the function safe by adding "LOCK TABLE adc" before
> the select.  However, if the idea is to not hold a strong lock on adc
> while the CREATE is going on, this approach isn't going to work :-(
>
> I kinda think you have more bugs than that, btw.  If a deadlock is
> happening it's probably because some other process also had read lock
> on "adc" and is trying to upgrade it, which would strongly suggest
> that the other process is trying to modify the contents of "adc",
> which would be a Real Bad Thing because it implies that you're losing
> data with this.  Any changes committed into "adc" after the function
> starts are not going to be reflected in the updated version of "adc",
> which cannot be what you want.

Everybody is doing SELECT only on "adc" table, so why deadlocks if there
are no write attempts on any row?

That's the reason why I posted my message, it seems strange: SELECTs
only do read...

Thank you for your help

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] odd deadlock on CREATE TABLE AS SELECT

2009-11-09 Thread Greg Stark
On Mon, Nov 9, 2009 at 9:48 AM, digitaldeath  wrote:
> Everybody is doing SELECT only on "adc" table, so why deadlocks if there
> are no write attempts on any row?

Well the deadlock error does include the information about what
queries deadlocked. In newer versions it includes the full text of the
query, but in older versions you would have to check the pg_stat*
views or postgres logs to track them down.


-- 
greg

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #5128: Returning nested composite types in plpython

2009-11-09 Thread Robert Haas
On Tue, Oct 20, 2009 at 12:19 PM,   wrote:
>
> The following bug has been logged online:
>
> Bug reference:      5128
> Logged by:
> Email address:      landrevi...@deadtreepages.com
> PostgreSQL version: 8.4
> Operating system:   FreeBSD
> Description:        Returning nested composite types in plpython
> Details:
>
> I have nested custom types and when I try to return a mapping in python the
> nested type gives me a malform record error. Here is my test code and the
> error:
>
>
> create type type1 as (
>        col1 text,
>        col2 text
> );
>
> create type type2 as (
>        col1 text,
>        col2 text,
>        test_type type1
> );
>
> create function returnComposite(test_one text, test_three text) RETURNS
> type2 as
> $$
>        return {'col1': test_one, 'col2': test_one, 'test_type': {'col1': 
> test_two,
> 'col2': test_two}}
> $$ language plpythonu;
>
> select returnComposite('test1','test2')
>
> ERROR: malformed record literal: "{'col2': 'test2', 'col1': 'test2'}"
> SQL state: 22P02
> Detail: Missing left parenthesis.
>
>
> If I put the nested type as ('test': test_two) it will return me the type
> but it includes extra quotes. The only way to make this work is make a
> select using plpy returning a type2 column.
>
> It would seem that the nested composite type is not being processed by
> plpython and going straight to the rowtypes processing.

See Peter's note here - apparently this is not supported.

http://archives.postgresql.org/pgsql-bugs/2009-11/msg00073.php

...Robert

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


[BUGS] postgresql installing problems

2009-11-09 Thread Tim van Loon

hello,

I have problems with installing postgresql 8.3

after following a few steps. He starts to install, but after a while I get the 
next error.
"user could not be created. user account already exists"   ??

I tried to uninstall everything and installed it again, but I got the same error

regards
Tim van Loon
  
_
Windows 7: kijk live tv, rechtstreeks vanaf je laptop. Meer informatie.
http://windows.microsoft.com/windows-7

Re: [BUGS] postgresql installing problems

2009-11-09 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, Nov 09, 2009 at 10:28:51PM +0100, Tim van Loon wrote:
> 
> hello,
> 
> I have problems with installing postgresql 8.3

t would be helpful if you provided some more details. As it is, you
leave it to our crystal ball to come up with things as "what OS are you
using?" (my guess: Windows).

> after following a few steps. He starts to install, but after a while I get 
> the next error.
> "user could not be created. user account already exists"   ??
> 
> I tried to uninstall everything and installed it again, but I got the same 
> error

Besides, this question should go to the pgsql-nov...@postgresql.org. If
I'm not completely off here, you'll find already an answer there: delete
this user (it is most probably a leftover from a previous installation
gone wrong). See 


Hope this helps
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFK+OtvBcgs9XrR2kYRAjdZAJ9BAOVrzNIwMDmSq19NvgulWeWhqwCcCmYu
W5voq7GzHGri2BZvY9VT38c=
=lSRo
-END PGP SIGNATURE-

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs