Export a column in a view without "announcing" it?

Ask a Question related to PostgreSQL / PGSQL, Design and Development.

  1. #1

    Default Export a column in a view without "announcing" it?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    I'm fairly certain there is currently no way to do this, but it would
    make life a bit easier for me right now if there were, so I guess I'm
    going to ask it anyway, just in case:

    Is there any way to expose a column in a view without "announcing" the
    fact that it is there? Specifically, in order to support updatable
    cursors on views (faked ones, using the ODBC driver), it is necessary
    to include the underlying table's OID and CTID columns in the view; but
    the client software I am trying to use then chokes on there being a
    column named OID (which is present, but hidden, if I use a table). So
    basically I would like to do:

    CREATE VIEW aView AS
    SELECT x, y, OID, CTID, z, t, ... FROM aTable WHERE condition_met
    WITHOUT ANNOUNCING OID, CTID


    or some such, so that if a query requesting OID or CTID is made, it
    will be there, while if a client asks for a list of columns, OID and
    CTID are not given?

    Also: with respect to the "fake" updatable cursors: if the client
    program attempts an INSERT operation and does not provide values for
    OID and CTID, am I correct in assuming that the database will correctly
    fill in these columns automatically?

    Thank you!

    - -----------------------------------------------------------
    Frank D. Engel, Jr. <fde101@fjrhome.net>

    $ ln -s /usr/share/kjvbible /usr/manual
    $ true | cat /usr/manual | grep "John 3:16"
    John 3:16 For God so loved the world, that he gave his only begotten
    Son, that whosoever believeth in him should not perish, but have
    everlasting life.
    $
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (Darwin)

    iD8DBQFB98Dg7aqtWrR9cZoRAhQZAJ9YcDwir3mvcPESGEuduV HWIeXfzwCeMO/+
    iQ7q3x86VNjjpoywOXr4KJ4=
    =uROx
    -----END PGP SIGNATURE-----



    __________________________________________________ _________
    $0 Web Hosting with up to 120MB web space, 1000 MB Transfer
    10 Personalized POP and Web E-mail Accounts, and much more.
    Signup at [url]www.doteasy.com[/url]


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

    Frank D. Engel, Jr. Guest

  2. Similar Questions and Discussions

    1. Option "Save As optimizes for Fast Web View" in Acrobat
      Hello Status : in Preferences->Documents->"Save As optimizes for Fast Web View" is enabled. Target : I want to disable this option with my plugin...
    2. Need "View States/Transitions" tutorial MXML code
      Hello Flexers, I've been going through the Flex tutorials and have hit a roadblock in the 4th tutorial. I need the full MXML source code for the...
    3. how to get a file from the "Testing Server" / "remote view"
      if I want to get a particular file from the "Testing Sever" or "remote view" in my extension, how can i do so? Thanks a lot!!!
    4. Grey when I "export", black when I "print to Distiller"
      When I export my B&W ad, designed in InDesign 2.0.2, all the solid black areas in the resulting PDF are actually greyish-black. But if I send the...
    5. Adobe Writer: View setting: "Continuous - Facing"
      I'm using Adobe Writer and am using the View setting called "Continuous - Facing". I like to use this when I need two pages next to each other (since...
  3. #2

    Default Re: Export a column in a view without "announcing" it?

    I don't know how this works for a view, but in the ODBC driver settings
    there is an option on page 2 to show the OID column. I am using linked
    tables in Access and it does not show the OID column because the checkmark
    is not clicked. I would suspect it works the same for views.

    In any case, in order to support updates on views you need to define a
    non-conditional update rule for the view, so that it actually updates the
    underlying table. I did it for the first time yesterday and found the
    concept quite interesting.

    Sim

    ""Frank D. Engel, Jr."" <fde101@fjrhome.net> wrote in message
    news:BF620526-6FB4-11D9-B323-0050E410655F@fjrhome.net...
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > I'm fairly certain there is currently no way to do this, but it would
    > make life a bit easier for me right now if there were, so I guess I'm
    > going to ask it anyway, just in case:
    >
    > Is there any way to expose a column in a view without "announcing" the
    > fact that it is there? Specifically, in order to support updatable
    > cursors on views (faked ones, using the ODBC driver), it is necessary
    > to include the underlying table's OID and CTID columns in the view; but
    > the client software I am trying to use then chokes on there being a
    > column named OID (which is present, but hidden, if I use a table). So
    > basically I would like to do:
    >
    > CREATE VIEW aView AS
    > SELECT x, y, OID, CTID, z, t, ... FROM aTable WHERE condition_met
    > WITHOUT ANNOUNCING OID, CTID
    >
    >
    > or some such, so that if a query requesting OID or CTID is made, it
    > will be there, while if a client asks for a list of columns, OID and
    > CTID are not given?
    >
    > Also: with respect to the "fake" updatable cursors: if the client
    > program attempts an INSERT operation and does not provide values for
    > OID and CTID, am I correct in assuming that the database will correctly
    > fill in these columns automatically?
    >
    > Thank you!
    >
    > - -----------------------------------------------------------
    > Frank D. Engel, Jr. <fde101@fjrhome.net>
    >
    > $ ln -s /usr/share/kjvbible /usr/manual
    > $ true | cat /usr/manual | grep "John 3:16"
    > John 3:16 For God so loved the world, that he gave his only begotten
    > Son, that whosoever believeth in him should not perish, but have
    > everlasting life.
    > $
    > -----BEGIN PGP SIGNATURE-----
    > Version: GnuPG v1.2.4 (Darwin)
    >
    > iD8DBQFB98Dg7aqtWrR9cZoRAhQZAJ9YcDwir3mvcPESGEuduV HWIeXfzwCeMO/+
    > iQ7q3x86VNjjpoywOXr4KJ4=
    > =uROx
    > -----END PGP SIGNATURE-----
    >
    >
    >
    > __________________________________________________ _________
    > $0 Web Hosting with up to 120MB web space, 1000 MB Transfer
    > 10 Personalized POP and Web E-mail Accounts, and much more.
    > Signup at [url]www.doteasy.com[/url]
    >
    >
    > ---------------------------(end of broadcast)---------------------------
    > TIP 4: Don't 'kill -9' the postmaster
    >

    Sim Zacks Guest

  4. #3

    Default Re: Export a column in a view without "announcing" it?

    On Wed, 26 Jan 2005 11:10:07 -0500, Frank D. Engel, Jr.
    <fde101@fjrhome.net> wrote:
    > I'm fairly certain there is currently no way to do this, but it would
    So am I. :)
    > Is there any way to expose a column in a view without "announcing" the
    > fact that it is there? Specifically, in order to support updatable
    > cursors on views (faked ones, using the ODBC driver), it is necessary
    > to include the underlying table's OID and CTID columns in the view; but
    > the client software I am trying to use then chokes on there being a
    > column named OID (which is present, but hidden, if I use a table). So
    > basically I would like to do:
    >
    > CREATE VIEW aView AS
    > SELECT x, y, OID, CTID, z, t, ... FROM aTable WHERE condition_met
    > WITHOUT ANNOUNCING OID, CTID
    Oh, I think it would be quite useful in non-ODBC world,
    suppose I have:
    CREATE VIEW av AS
    SELECT foo_id, foo_name, foo_bar, foo_baz FROM blah
    WITHOUT ANNOUNCING foo_id;
    ....means that I can later do things like:
    SELECT foo_name FROM av ORDER BY foo_id;
    ....but also (much more important) use this foo_id in joins!

    This could be especially useful when doing view-on-a-view. :)

    Regards,
    Dawid

    PS: Though I'm somewhat sceptical towards "WITHOUT ANNOUNCING" syntax.

    ---------------------------(end of broadcast)---------------------------
    TIP 9: the planner will ignore your desire to choose an index scan if your
    joining column's datatypes do not match

    Dawid Kuroczko Guest

  5. #4

    Default Re: Export a column in a view without "announcing" it?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    That option was already turned off, and I already have an unconditional
    update rule on the view.

    On Jan 27, 2005, at 1:51 AM, Sim Zacks wrote:
    > I don't know how this works for a view, but in the ODBC driver settings
    > there is an option on page 2 to show the OID column. I am using linked
    > tables in Access and it does not show the OID column because the
    > checkmark
    > is not clicked. I would suspect it works the same for views.
    >
    > In any case, in order to support updates on views you need to define a
    > non-conditional update rule for the view, so that it actually updates
    > the
    > underlying table. I did it for the first time yesterday and found the
    > concept quite interesting.
    >
    > Sim
    >
    > ""Frank D. Engel, Jr."" <fde101@fjrhome.net> wrote in message
    > news:BF620526-6FB4-11D9-B323-0050E410655F@fjrhome.net...
    >> -----BEGIN PGP SIGNED MESSAGE-----
    >> Hash: SHA1
    >>
    >> I'm fairly certain there is currently no way to do this, but it would
    >> make life a bit easier for me right now if there were, so I guess I'm
    >> going to ask it anyway, just in case:
    >>
    >> Is there any way to expose a column in a view without "announcing" the
    >> fact that it is there? Specifically, in order to support updatable
    >> cursors on views (faked ones, using the ODBC driver), it is necessary
    >> to include the underlying table's OID and CTID columns in the view;
    >> but
    >> the client software I am trying to use then chokes on there being a
    >> column named OID (which is present, but hidden, if I use a table). So
    >> basically I would like to do:
    >>
    >> CREATE VIEW aView AS
    >> SELECT x, y, OID, CTID, z, t, ... FROM aTable WHERE condition_met
    >> WITHOUT ANNOUNCING OID, CTID
    >>
    >>
    >> or some such, so that if a query requesting OID or CTID is made, it
    >> will be there, while if a client asks for a list of columns, OID and
    >> CTID are not given?
    >>
    >> Also: with respect to the "fake" updatable cursors: if the client
    >> program attempts an INSERT operation and does not provide values for
    >> OID and CTID, am I correct in assuming that the database will
    >> correctly
    >> fill in these columns automatically?
    >>
    >> Thank you!
    >>
    >> - -----------------------------------------------------------
    >> Frank D. Engel, Jr. <fde101@fjrhome.net>
    >>
    >> $ ln -s /usr/share/kjvbible /usr/manual
    >> $ true | cat /usr/manual | grep "John 3:16"
    >> John 3:16 For God so loved the world, that he gave his only begotten
    >> Son, that whosoever believeth in him should not perish, but have
    >> everlasting life.
    >> $
    >> -----BEGIN PGP SIGNATURE-----
    >> Version: GnuPG v1.2.4 (Darwin)
    >>
    >> iD8DBQFB98Dg7aqtWrR9cZoRAhQZAJ9YcDwir3mvcPESGEuduV HWIeXfzwCeMO/+
    >> iQ7q3x86VNjjpoywOXr4KJ4=
    >> =uROx
    >> -----END PGP SIGNATURE-----
    >>
    >>
    >>
    >> __________________________________________________ _________
    >> $0 Web Hosting with up to 120MB web space, 1000 MB Transfer
    >> 10 Personalized POP and Web E-mail Accounts, and much more.
    >> Signup at [url]www.doteasy.com[/url]
    >>
    >>
    >> ---------------------------(end of
    >> broadcast)---------------------------
    >> TIP 4: Don't 'kill -9' the postmaster
    >>
    >
    >
    >
    > ---------------------------(end of
    > broadcast)---------------------------
    > TIP 8: explain analyze is your friend
    >
    >
    - -----------------------------------------------------------
    Frank D. Engel, Jr. <fde101@fjrhome.net>

    $ ln -s /usr/share/kjvbible /usr/manual
    $ true | cat /usr/manual | grep "John 3:16"
    John 3:16 For God so loved the world, that he gave his only begotten
    Son, that whosoever believeth in him should not perish, but have
    everlasting life.
    $
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (Darwin)

    iD8DBQFB/jvW7aqtWrR9cZoRArRKAJoCAOS7Pgqgly5H22eHsKAh9Ks13AC eJw7O
    276t3Shl0i+ob+/xP5rYivg=
    =v8ed
    -----END PGP SIGNATURE-----



    __________________________________________________ _________
    $0 Web Hosting with up to 120MB web space, 1000 MB Transfer
    10 Personalized POP and Web E-mail Accounts, and much more.
    Signup at [url]www.doteasy.com[/url]


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

    [url]http://archives.postgresql.org[/url]

    Frank D. Engel, Jr. Guest

Posting Permissions

  • You may not post new threads
  • You may 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