Re: Change Default Database

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Change Default Database
Date: 2007-02-26 18:43:00
Message-ID: a55915760702261043s5c52101cqa3e8dd07b5d6f348@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2/26/07, Rommel the iCeMAn <icecrew(at)gmail(dot)com> wrote:
> Thanks for the swift responses,
>
> I tried the \c command but I got the following error:
>
> ERROR: syntax error at or near "\"
> SQL state: 42601
> Character: 520
>
> Here's a code snippet ...
>
> <snip>
> --
> -- TOC entry 1685 (class 1262 OID 16453)
> -- Name: test_db; Type: DATABASE; Schema: -; Owner: postgres
> --
>
> DROP DATABASE IF EXISTS test_db;
> CREATE DATABASE test_db WITH TEMPLATE = template0 ENCODING = 'UTF8';
>
>
> ALTER DATABASE test_db OWNER TO postgres;
>
> \c test_db; -- query tool doesn't like this command :-(
>
> </snip>
>
> Rommel Edwards
> Software Developer,
> Barbados, Caribbean.

\c only works in psql.

See:
http://www.postgresql.org/docs/8.2/static/app-psql.html

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2007-02-26 19:40:42 Re: Change Default Database
Previous Message Louis-David Mitterrand 2007-02-26 18:14:51 getting at sequence previous/next values