Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #187006

Re: Postresql: need a way to initiate a database with a test user

From Zenaan Harkness <zenaan@freedbms.net>
Newsgroups linux.debian.user
Subject Re: Postresql: need a way to initiate a database with a test user
Date 2017-09-19 14:50 +0200
Message-ID <urq8p-5xV-3@gated-at.bofh.it> (permalink)
References <upYxA-3ec-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Sep 15, 2017 at 01:03:36PM +0000, Tom Browder wrote:
> I get the following error when trying to create a table with psql:
> 
>   psql:  FATAL:   Peer authentication failed for user "sql92"
>   The spawned command 'psql -f ./t/t.sql -U sql92' exited unsuccessfully
> (exit code: 2)
> 
> The sql file has two create table commands.
> 
> I had already created the user 'sql92' with password = '' and createdb
> privileges.
> 
> Is there any way to create a user that can be used outside an open database
> connection in a script?

If you want something "just for testing", you can spin up a pg
instance on demand - custom access port and other params (so you
don't clash with any existing instance/install) - this is running it
like e.g. MSAccess "as an application", although "true db admins"
will of course highlight that this is very inefficient and pg is
designed to readily run any number of databases you might need ... in
the single running instance.

Haven't used it for years, so other than that ... Good luck :)

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Postresql: need a way to initiate a database with a test user Tom Browder <tom.browder@gmail.com> - 2017-09-15 15:10 +0200
  Re: Postresql: need a way to initiate a database with a test user Tom Browder <tom.browder@gmail.com> - 2017-09-15 16:10 +0200
  Re: Postresql: need a way to initiate a database with a test user Zenaan Harkness <zenaan@freedbms.net> - 2017-09-19 14:50 +0200
  Re: Postresql: need a way to initiate a database with a test user Michael Stone <mstone@debian.org> - 2017-09-19 20:10 +0200

csiph-web