BUG #5167: Alternative to USE of MSSQL

View: New views
4 Messages — Rating Filter:   Alert me  

BUG #5167: Alternative to USE of MSSQL

by forbiddenvk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The following bug has been logged online:

Bug reference:      5167
Logged by:          forbiddenvk
Email address:      for.bid.den.vk@...
PostgreSQL version: 8.4
Operating system:   Windows
Description:        Alternative to USE of MSSQL
Details:

Why couldn't create a  alternative to USE command in MSSQL?, I think is
necesary when we want execute a full script for create a database and tables
in once.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: BUG #5167: Alternative to USE of MSSQL

by John R Pierce :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

forbiddenvk wrote:

> The following bug has been logged online:
>
> Bug reference:      5167
> Logged by:          forbiddenvk
> Email address:      for.bid.den.vk@...
> PostgreSQL version: 8.4
> Operating system:   Windows
> Description:        Alternative to USE of MSSQL
> Details:
>
> Why couldn't create a  alternative to USE command in MSSQL?, I think is
> necesary when we want execute a full script for create a database and tables
> in once.
>
>  

psql has the \c command to connect to a database.  this can be embedded
in a SQL file thats executed by psql




--
Sent via pgsql-bugs mailing list (pgsql-bugs@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: BUG #5167: Alternative to USE of MSSQL

by Pavel Stehule :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/5 forbiddenvk <for.bid.den.vk@...>:

>
> The following bug has been logged online:
>
> Bug reference:      5167
> Logged by:          forbiddenvk
> Email address:      for.bid.den.vk@...
> PostgreSQL version: 8.4
> Operating system:   Windows
> Description:        Alternative to USE of MSSQL
> Details:
>
> Why couldn't create a  alternative to USE command in MSSQL?, I think is
> necesary when we want execute a full script for create a database and tables
> in once.

Hello

\c command is alternative of USE statement in MSSQL.

postgres=# \c template1
You are now connected to database "template1".
template1=#

regards
Pavel Stehule

>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@...)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>

--
Sent via pgsql-bugs mailing list (pgsql-bugs@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: BUG #5167: Alternative to USE of MSSQL

by Devrim GÜNDÜZ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-11-05 at 06:01 +0000, forbiddenvk wrote:
> Why couldn't create a  alternative to USE command in MSSQL?, I think
> is
> necesary when we want execute a full script for create a database and
> tables
> in once.

(This is not a bug, but still...)

You can use psql's \c while scripting those kind of things.

Instead of using

USE dbname;

you can use this one:

\c dbname

and let psql read your script.
--
Devrim GÜNDÜZ, RHCE
Command Prompt - http://www.CommandPrompt.com 
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz


signature.asc (204 bytes) Download Attachment