Обсуждение: (psql 9.4.5) ERROR: syntax error at or near "createuser"

Поиск
Список
Период
Сортировка

(psql 9.4.5) ERROR: syntax error at or near "createuser"

От
Дата:
Newly installed postgresql 9.4.5

Microsoft Windows 2008 R2 Standard SP1, x64


Installed from postgresql-9.4.5-2-windows-x64.exe

from http://www.enterprisedb.com/products-services-training/pgdownload#windows

File version of psql.exe is p.4.5.15322

I have disabled passwords in pg_hba.conf, because password
is not working for my superuser--this is why I wish to
create a new user--to see if passwords are broken in general,
or only for that first account--so have local method
set to "trust" to get in.

Invoking psql thus:

C:\Program Files\PostgreSQL\9.4\bin>

psql -p 5432 -U postgres

Attempting to create a new user thus:

postgres=# createuser -P -s testuser ;

I get this error:

ERROR:  syntax error at or near "createuser"

LINE 1: createuser -P -s testuser ;
        ^
I do not understand why there is a syntax error at
  the keyword createuser.

Can anyone give me any pointers?

- P





----
Sent using GuerrillaMail.com
Block or report abuse: https://www.guerrillamail.com/abuse/?a=UUZnFAFNRLEbjRy1%2FF4PfQfTStiVwcZciatQew%3D%3D





Re: (psql 9.4.5) ERROR: syntax error at or near "createuser"

От
Adrian Klaver
Дата:
On 11/30/2015 01:32 PM, 2athep+5ud7717ssvxx4@guerrillamail.com wrote:
> Newly installed postgresql 9.4.5
>
> Microsoft Windows 2008 R2 Standard SP1, x64
>
>
> Installed from postgresql-9.4.5-2-windows-x64.exe
>
> from http://www.enterprisedb.com/products-services-training/pgdownload#windows
>
> File version of psql.exe is p.4.5.15322
>
> I have disabled passwords in pg_hba.conf, because password
> is not working for my superuser--this is why I wish to
> create a new user--to see if passwords are broken in general,
> or only for that first account--so have local method
> set to "trust" to get in.
>
> Invoking psql thus:
>
> C:\Program Files\PostgreSQL\9.4\bin>
>
> psql -p 5432 -U postgres
>
> Attempting to create a new user thus:
>
> postgres=# createuser -P -s testuser ;
>
> I get this error:
>
> ERROR:  syntax error at or near "createuser"
>
> LINE 1: createuser -P -s testuser ;
>          ^
> I do not understand why there is a syntax error at
>    the keyword createuser.

Because you are using this:

http://www.postgresql.org/docs/9.4/interactive/app-createuser.html

when you want to use:

http://www.postgresql.org/docs/9.4/interactive/sql-createuser.html

To put it another way createuser is a stand alone command line program
to be run in a shell and CREATE USER is a SQL command.

>
> Can anyone give me any pointers?
>
> - P
>
>
>
>
>
> ----
> Sent using GuerrillaMail.com
> Block or report abuse: https://www.guerrillamail.com/abuse/?a=UUZnFAFNRLEbjRy1%2FF4PfQfTStiVwcZciatQew%3D%3D
>
>
>
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com