Professional Web Applications Themes

View definition truncated in information_schema - PostgreSQL / PGSQL

Hi all, I'm trying to retrieve the SQL definition of a view from information_schema via: SELECT view_definition FROM information_schema.views WHERE table_name = 'viewname'; It appears the definition returned is truncated at a fixed number of characters - for this view it's 7650. Does anybody know where this problem is in information_schema, or in the actual storage of the text definition. If it's the former, is there a way I can query the text definition directly? This occurs in both server versions 8.0 and v7.4.1, BTW. Many thanks, Eric ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at ...

  1. #1

    Default View definition truncated in information_schema

    Hi all,
    I'm trying to retrieve the SQL definition of a view from
    information_schema via:
    SELECT view_definition FROM information_schema.views WHERE
    table_name = 'viewname';
    It appears the definition returned is truncated at a fixed number of
    characters - for this view it's 7650.
    Does anybody know where this problem is in information_schema, or in the
    actual storage of the text definition. If it's the former, is there a
    way I can query the text definition directly?

    This occurs in both server versions 8.0 and v7.4.1, BTW.

    Many thanks,

    Eric

    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [email]majordomopostgresql.org[/email])

    Eric E Guest

  2. #2

    Default Re: View definition truncated in information_schema

    On Thu, Jan 27, 2005 at 12:09:47PM -0500, Eric E wrote:
    > I'm trying to retrieve the SQL definition of a view from
    > information_schema via:
    > SELECT view_definition FROM information_schema.views WHERE
    > table_name = 'viewname';
    > It appears the definition returned is truncated at a fixed number of
    > characters - for this view it's 7650.
    What client are you using? psql, or something else? In simple
    tests I don't see this truncation with psql (8.0.0); I wonder
    if your client is truncating the output.
    > Does anybody know where this problem is in information_schema, or in the
    > actual storage of the text definition. If it's the former, is there a
    > way I can query the text definition directly?
    information_schema.views is itself a view; you can see its definition
    by executing the following in psql:

    \d information_schema.views

    The above shows that the view_definition column gets its value from
    pg_get_viewdef(). What do the following queries return?

    SELECT length(pg_get_viewdef('viewname'::regclass));
    SELECT pg_get_viewdef('viewname'::regclass);

    --
    Michael Fuhr
    [url]http://www.fuhr.org/~mfuhr/[/url]

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

    Michael Fuhr Guest

Similar Threads

  1. Problems with information_schema
    By Marcel Gsteiger in forum PostgreSQL / PGSQL
    Replies: 1
    Last Post: December 12th, 06:33 AM
  2. articletext data gets truncated
    By Alan in forum ASP
    Replies: 1
    Last Post: August 20th, 04:21 PM
  3. Truncated-Why
    By YrbkMgr in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 2
    Last Post: August 14th, 12:59 PM
  4. Data getting truncated
    By Bill in forum ASP
    Replies: 1
    Last Post: July 11th, 08:28 PM
  5. Wierd error when going to Design View from HTML view
    By VB Programmer in forum ASP.NET General
    Replies: 1
    Last Post: July 10th, 03:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139