By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,811 Members | 1,978 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,811 IT Pros & Developers. It's quick & easy.

connection or query affected

P: n/a
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

Nov 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* Dennis Gearon <ge*****@fireserve.net> [2004-10-12 08:13:07 -0700]:
turn off autocommit
Per connection.
start transaction
commit transaction
They're statements themselves that change the state of the
connection. You start a transaction, run your queries, and then
commit/rollback.
SET schema


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('SELECT 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 ma*******@postgresql.org

Nov 23 '05 #2

P: n/a
Steven Klassen wrote:
* Dennis Gearon <ge*****@fireserve.net> [2004-10-12 08:13:07 -0700]:

turn off autocommit

Per connection.

start transaction
commit transaction

They're statements themselves that change the state of the
connection. You start a transaction, run your queries, and then
commit/rollback.

SET schema

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('SELECT foo FROM my_schema.bar WHERE active');

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

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.