connection or query affected

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis Gearon

    #1

    connection or query affected

    please cc me

    If I am using some server side langauge to access Postgres - php,
    python, perl, asp, if I make a connection, do the following actions
    affect the connection, or the individual query that contains them:

    turn off autocommit
    start transaction
    commit transaction
    SET schema

    ---------------------------(end of broadcast)---------------------------
    TIP 7: don't forget to increase your free space map settings

  • Steven Klassen

    #2
    Re: connection or query affected

    * Dennis Gearon <gearond@firese rve.net> [2004-10-12 08:13:07 -0700]:
    [color=blue]
    > turn off autocommit[/color]

    Per connection.
    [color=blue]
    > start transaction
    > commit transaction[/color]

    They're statements themselves that change the state of the
    connection. You start a transaction, run your queries, and then
    commit/rollback.
    [color=blue]
    > SET schema[/color]

    It depends if you're setting your search path for subsequent queries
    which would be tracked per connection or you're actually prepending
    the schema where the table exists in the query.

    E.g.

    $dbh->query("SET search_path='my _schema'");

    - or -

    $dbh->query('SELEC T foo FROM my_schema.bar WHERE active');

    --
    Steven Klassen - Lead Programmer
    Command Prompt, Inc. - http://www.commandprompt.com/
    PostgreSQL Replication & Support Services, (503) 667-4564

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

    Comment

    • Dennis Gearon

      #3
      Re: connection or query affected

      Steven Klassen wrote:
      [color=blue]
      > * Dennis Gearon <gearond@firese rve.net> [2004-10-12 08:13:07 -0700]:
      >
      >[color=green]
      >> turn off autocommit[/color]
      >
      >
      > Per connection.
      >
      >[color=green]
      >> start transaction
      >> commit transaction[/color]
      >
      >
      > They're statements themselves that change the state of the
      > connection. You start a transaction, run your queries, and then
      > commit/rollback.
      >
      >[color=green]
      >> SET schema[/color]
      >
      >
      > It depends if you're setting your search path for subsequent queries
      > which would be tracked per connection or you're actually prepending
      > the schema where the table exists in the query.
      >
      > E.g.
      >
      > $dbh->query("SET search_path='my _schema'");
      >
      > - or -
      >
      > $dbh->query('SELEC T foo FROM my_schema.bar WHERE active');
      >[/color]
      Thanks, I meant the first of the two schema related queries above.

      ---------------------------(end of broadcast)---------------------------
      TIP 7: don't forget to increase your free space map settings

      Comment

      Working...