Thread

  1. creating temp table...

    Lukasz Michalski <zork@clan.pl> — 2000-04-29T13:54:15Z

    Hi,
    I've got PostgreSQL 6.5.2 installed and strange things happens when I
    try to create temp table in transaction block.
    
    Here's SQL commands send to backend:
    
    SELECT data FROM aukcje WHERE aukcja_id = '1'
    SELECT reklama,logo_loid,logo_content,www,nazwa FROM domy WHERE dom_id =
    '0'
    BEGIN
    SELECT * FROM domy WHERE dom_id = '0'
    CREATE TEMPORARY TABLE tmp (obraz_id int,tytul varchar(80),nazwa
    varchar(40),obrazm_loid oid,obrazm_content varchar(20))
    INSERT INTO tmp SELECT obraz_id,tytul,nazwa,obrazm_loid,obrazm_content
    FROM obrazy,autorzy,aukcje WHERE obrazy.autor_id = autorzy.autor_id AND
    obrazy.aukcja_id
    = aukcje.aukcja_id AND dom_id = '0' AND obrazy.aukcja_id = '1'
    DECLARE obraz_cur CURSOR FOR SELECT * FROM tmp
    select count(obraz_id) FROM tmp
    FETCH FORWARD 10 IN obraz_cur
    CLOSE obraz_cur
    COMMIT
    
    Everything is going fine but from time to time I've got something like
    this:
    
    SELECT data FROM aukcje WHERE aukcja_id = '1'
    SELECT reklama,logo_loid,logo_content,www,nazwa FROM domy WHERE dom_id =
    '0'
    BEGIN
    SELECT * FROM domy WHERE dom_id = '0'
    CREATE TEMPORARY TABLE tmp (obraz_id int,tytul varchar(80),nazwa
    varchar(40),obrazm_loid oid,obrazm_content varchar(20))
    
    Warning: PostgresSQL query failed: pqReadData() -- backend closed the
    channel unexpectedly. This probably means the backend terminated
    abnormally before or while
    processing the request. in common.inc on line 19
    
    [message wrapped by php interpreter]
    
    Any suggestions? Is this a bug in backend server or something is wrong
    with my SQL ?
    
    thanks for any help
    
    --
    Łukasz Michalski
    mailto:zork@clan.pl
    
    
    
    
    
  2. Re: creating temp table...

    Tom Lane <tgl@sss.pgh.pa.us> — 2000-04-29T14:47:59Z

    Lukasz Michalski <zork@clan.pl> writes:
    > I've got PostgreSQL 6.5.2 installed and strange things happens when I
    > try to create temp table in transaction block.
    
    Yes, that area is kinda broken in 6.5.*.  Try it with 7.0 (RC1 or
    later).
    
    			regards, tom lane