ERROR: did not find '}' at end of input node (again)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrei Ivanov

    ERROR: did not find '}' at end of input node (again)


    This happend again, but now, postgresql tells me where it happens:

    pg_dump: SQL command failed
    pg_dump: Error message from server: ERROR: did not find '}' at end of
    input node
    pg_dump: The command was: select (select usename from pg_user where
    usesysid = datdba) as dba, pg_encoding_to_ char(encoding) as encoding,
    datpath from pg_database where datname = 'dc'
    pg_dumpall: pg_dump failed on database "dc", exiting


    template1=# select usename from pg_user;
    ERROR: did not find '}' at end of input node


    \d pg_user
    ********* QUERY **********
    SELECT c.oid,
    n.nspname,
    c.relname
    FROM pg_catalog.pg_c lass c
    LEFT JOIN pg_catalog.pg_n amespace n ON n.oid = c.relnamespace
    WHERE pg_catalog.pg_t able_is_visible (c.oid)
    AND c.relname ~ '^pg_user$'
    ORDER BY 2, 3;
    *************** ***********

    ********* QUERY **********
    SELECT relhasindex, relkind, relchecks, reltriggers, relhasrules
    FROM pg_catalog.pg_c lass WHERE oid = '16683'
    *************** ***********

    ********* QUERY **********
    SELECT a.attname,
    pg_catalog.form at_type(a.attty pid, a.atttypmod),
    (SELECT substring(d.ads rc for 128) FROM pg_catalog.pg_a ttrdef d
    WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef),
    a.attnotnull, a.attnum
    FROM pg_catalog.pg_a ttribute a
    WHERE a.attrelid = '16683' AND a.attnum > 0 AND NOT a.attisdropped
    ORDER BY a.attnum
    *************** ***********

    ********* QUERY **********
    SELECT pg_catalog.pg_g et_viewdef('166 83'::pg_catalog .oid, true)
    *************** ***********

    ERROR: did not find '}' at end of input node


    I think (hope) I can save the data by copying the data on another computer
    and start postgresql there and then dump it (just like I did last time).

    The problem is, why does this happen and how can I prevent it ? Maybe this
    is caused by an unproper shutdown of postgresql ?

    SELECT VERSION();
    version
    ------------------------------------------------------------------------------------------------------------------
    PostgreSQL 7.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.2 20031022 (Gentoo Linux 3.3.2-r2, propolice)


    ---------------------------(end of broadcast)---------------------------
    TIP 6: Have you searched our list archives?



  • Tom Lane

    #2
    Re: ERROR: did not find '}' at end of input node (again)

    Andrei Ivanov <andrei.ivanov@ ines.ro> writes:[color=blue]
    > template1=# select usename from pg_user;
    > ERROR: did not find '}' at end of input node[/color]

    There's something wrong with the ON SELECT rule for the pg_user view,
    evidently. Could we see the output of

    select * from pg_rewrite where ev_class = 16683;

    regards, tom lane

    ---------------------------(end of broadcast)---------------------------
    TIP 8: explain analyze is your friend

    Comment

    • John Sidney-Woollett

      #3
      Schema + search path problem

      I'm slightly confused by schemas and search paths...

      I'm using Postgres 7.4, and have broken my original test database into
      various schemas now. Using google I found a reference to a 7.3 document
      that provided quite a lot of information on schemas (in the section on SQL
      syntax).

      It appears that by default, the search path is a schema the same as your
      login name, and then public.

      I have created the schema in a database as the postgres user, and also
      created all that schema's objects (as the postgres user).

      Later I will connect to the schema via another user (say 'FRED') (who will
      have appropriate access rights to the objects in the schema).

      Question 1
      ==========
      Is there a way to set the default search path for the user 'FRED'
      permanently? Or do you have to reset the search path (and/or default
      schema) for each new session?

      Question 2
      ==========
      If I am the postgres user and creating a function (for example) in a given
      schema, do I have to qualify ALL the objects referred to in the function
      by the schema prefix (if I don't want them in the public schema)?

      And if I use the "SET search_path TO schema" command, am I still required
      to be explicit about the schema name for objects referred to in a newly
      created function?

      Thanks for shedding any light on the above.

      John Sidney-Woollett

      ps Is the 7.4 documentation less detailed on schemas than the 7.3 docs? Or
      have I missed a section somewhere?

      ---------------------------(end of broadcast)---------------------------
      TIP 1: subscribe and unsubscribe commands go to majordomo@postg resql.org

      Comment

      • Tom Lane

        #4
        Re: Schema + search path problem

        "John Sidney-Woollett" <johnsw@wardbro ok.com> writes:[color=blue]
        > Is there a way to set the default search path for the user 'FRED'
        > permanently?[/color]

        See ALTER USER. You can set per-user or per-database defaults for any
        SETtable variable, not only search_path.
        [color=blue]
        > If I am the postgres user and creating a function (for example) in a given
        > schema, do I have to qualify ALL the objects referred to in the function
        > by the schema prefix (if I don't want them in the public schema)?[/color]

        It's a good idea. At the moment a function body is interpreted with the
        call-time value of search_path. We've batted around the idea that it
        should use the creation-time path, but nothing's been done about it.
        [color=blue]
        > ps Is the 7.4 documentation less detailed on schemas than the 7.3
        > docs?[/color]

        I don't believe we've removed anything; rearranged, perhaps. Does
        5.10.&nbsp;Schemas # 5.10.1. Creating a Schema 5.10.2. The Public Schema 5.10.3. The Schema Search Path 5.10.4. Schemas and Privileges 5.10.5. …

        not cover the same ground that's in the 7.3 docs?

        regards, tom lane

        ---------------------------(end of broadcast)---------------------------
        TIP 4: Don't 'kill -9' the postmaster

        Comment

        • John Sidney-Woollett

          #5
          Re: Schema + search path problem

          Thanks Tom, that's cleared up both issues.

          You're right about the docs - I couldn't find the material in the 7.4 docs
          because I wasn't sure where to look.

          A full text index (web app showcasing Postgres's full test search
          capabilities) of the latest docs would be great! ... please don't say
          "google" :)

          Thanks for your help.

          John

          Tom Lane said:[color=blue]
          > "John Sidney-Woollett" <johnsw@wardbro ok.com> writes:[color=green]
          >> Is there a way to set the default search path for the user 'FRED'
          >> permanently?[/color]
          >
          > See ALTER USER. You can set per-user or per-database defaults for any
          > SETtable variable, not only search_path.
          >[color=green]
          >> If I am the postgres user and creating a function (for example) in a
          >> given
          >> schema, do I have to qualify ALL the objects referred to in the function
          >> by the schema prefix (if I don't want them in the public schema)?[/color]
          >
          > It's a good idea. At the moment a function body is interpreted with the
          > call-time value of search_path. We've batted around the idea that it
          > should use the creation-time path, but nothing's been done about it.
          >[color=green]
          >> ps Is the 7.4 documentation less detailed on schemas than the 7.3
          >> docs?[/color]
          >
          > I don't believe we've removed anything; rearranged, perhaps. Does
          > http://www.postgresql.org/docs/curre...l-schemas.html
          > not cover the same ground that's in the 7.3 docs?
          >
          > regards, tom lane
          >[/color]


          ---------------------------(end of broadcast)---------------------------
          TIP 5: Have you checked our extensive FAQ?



          Comment

          • Tom Lane

            #6
            Re: ERROR: did not find '}' at end of input node (again)

            Andrei Ivanov <andrei.ivanov@ ines.ro> writes:[color=blue]
            > On Thu, 11 Dec 2003, Tom Lane wrote:[color=green]
            >> Andrei Ivanov <andrei.ivanov@ ines.ro> writes:[color=darkred]
            >>> template1=# select usename from pg_user;
            >>> ERROR: did not find '}' at end of input node[/color]
            >>
            >> There's something wrong with the ON SELECT rule for the pg_user view,
            >> evidently. Could we see the output of
            >>
            >> select * from pg_rewrite where ev_class = 16683;[/color][/color]
            [color=blue]
            > The ouput is attached...[/color]

            Well, that's interesting, because it's no different from what I get.
            So it seems the fault is not in your database but in the rule-reading
            routines. Are you sure you have a clean build of PG 7.4? I'm wondering
            about having a slightly out-of-sync version that's expecting slightly
            different contents of the rule structures. We make such changes
            regularly, but they're supposed to go along with catversion.h changes
            that prevent you from running the wrong server version against a
            database ...

            regards, tom lane

            ---------------------------(end of broadcast)---------------------------
            TIP 5: Have you checked our extensive FAQ?



            Comment

            • Tom Lane

              #7
              Re: ERROR: did not find '}' at end of input node (again)

              Andrei Ivanov <andrei.ivanov@ ines.ro> writes:[color=blue]
              > It's an almost clean build (it has
              > http://gppl.terminal.ru/hier-Pg7.4-0.3.tar.gz in it)...[/color]

              That's your problem, then; it makes incompatible changes in stored
              rules. The patch should have included a catversion.h change to force
              you to initdb after applying it.

              regards, tom lane

              ---------------------------(end of broadcast)---------------------------
              TIP 2: you can get off all lists at once with the unregister command
              (send "unregister YourEmailAddres sHere" to majordomo@postg resql.org)

              Comment

              • Andrei Ivanov

                #8
                Re: ERROR: did not find '}' at end of input node (again)



                I've recompiled without the patch and all is fine now. I'm sorry for
                waisting your time...


                On Thu, 11 Dec 2003, Tom Lane wrote:
                [color=blue]
                > Andrei Ivanov <andrei.ivanov@ ines.ro> writes:[color=green]
                > > It's an almost clean build (it has
                > > http://gppl.terminal.ru/hier-Pg7.4-0.3.tar.gz in it)...[/color]
                >
                > That's your problem, then; it makes incompatible changes in stored
                > rules. The patch should have included a catversion.h change to force
                > you to initdb after applying it.
                >
                > regards, tom lane
                >[/color]

                ---------------------------(end of broadcast)---------------------------
                TIP 4: Don't 'kill -9' the postmaster

                Comment

                Working...