On 04/23/2014 08:11 AM, Simon Riggs wrote:
> We start with a database called Postgres and a schema called Public.
> Yet we don't start up with any usable tables.
>
> I propose we add a single table called Postgres when we Initdb
>
>   CREATE TABLE Postgres (Id Integer, Data Jsonb);
>   COMMENT ON TABLE Postgres IS 'Single table for quick start usage -
> design your database';
>
> The purpose of this is to make the database immediately usable.
With default access controls it still aint :(

And most of complaints I have heard are about the need of
fidgeting with pg_hba.conf to get *anything* started.

So maybe we could start with something like this at the end of initdb:

> createdb example

> psql example

sample# create table stuff(id serial primary key, data jsonb);
sample# grant all on stuff to public;

And also have the following lines in pg_hba.conf for it

local   all             all                                         trust
host    all             all             127.0.0.1/32        trust
host    all             all             ::1/128                 trust


This would solve most of the frustration with starting pg development
for newcomers

Cheers
Hannu

>  By
> including this table in the default  initdb it will mean that programs
> can rely on the existence of this table and begin working quicker.
>
> By now, some of you will be doubled over laughing as if this is an
> April fool joke.  I don't mean it to be at all.
>
> The idea is to have a stupidly obvious and easy table that will
> potentially be usable by just about everyone, in any language.
>
> If you don't like it, don't use it. If you really dislike it, drop it.
>
> But for new people coming to Postgres, they will have a data object to
> access and begin using the database immediately. Their code will work,
> their examples will work. OK, so they need to go back and think about
> the design, but at least they got it to work and will be encouraged to
> do more.
>
> Remember when we didn't have a database called Postgres? Remember how
> much simpler life is now? Remember that now.
>
> We can also insert a single row, Id = 0 with "Postgres sample data" in
> it, but that seems a step too far.
>


-- 
Hannu Krosing
PostgreSQL Consultant
Performance, Scalability and High Availability
2ndQuadrant Nordic OÜ



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

Reply via email to