WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to start PostgreSQL in TCL?  (Read 3573 times)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
How to start PostgreSQL in TCL?
« on: April 04, 2017, 10:48:21 AM »
Hi all,

1. I've just installed PostgreSQL 9.5.1. However, I'm not sure to start the service on TCL. Please advise.
Code: [Select]
tc@box:/$ psql -V
psql (PostgreSQL) 9.5.1
tc@box:/$
tc@box:/$ df -h | g sql
/dev/loop9                3.6M      3.6M         0 100% /tmp/tcloop/postgresql-9.5.1
tc@box:/$
tc@box:/$ psql
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
tc@box:/$

2. When I search for sql, there is no option for MySQL. May I know why? Thanks.
Code: [Select]
tc@box:/$ tce
tce-ab - Tiny Core Extension: Application Browser

S)earch P)rovides K)eywords or Q)uit:
Enter starting chars of desired extension, e.g. abi: sql

tce - Tiny Core Extension browser

         1. postgresql-9.5.1-dev.tcz
         2. postgresql-9.5.1-lib.tcz
         3. postgresql-9.5.1-locale.tcz
         4. postgresql-9.5.1.tcz
         5. pysqlite2.tcz
         6. qt-4.x-sql.tcz
         7. qt-5.x-sql.tcz
         8. sqlite3-bin.tcz
         9. sqlite3-dev.tcz
        10. sqlite3-doc.tcz
        11. sqlite3.tcz

Enter selection ( 1 - 11 ) or (q)uit:

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to start PostgreSQL in TCL?
« Reply #1 on: April 04, 2017, 11:37:52 AM »
MySQL has been replaced with mariadb.

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: How to start PostgreSQL in TCL?
« Reply #2 on: April 04, 2017, 11:44:42 AM »
MySQL has been replaced with mariadb.
Thanks Gerald.

There is useful information on mariadb.tcz info file. I would recommend we do the same on postgresql-9.5.1.tcz.
Quote
tc@box:~$ tce
tce-ab - Tiny Core Extension: Application Browser

S)earch P)rovides K)eywords or Q)uit:
Enter starting chars of desired extension, e.g. abi: maria
Title:          mariadb.tcz
Description:    An enhanced, drop-in replacement for MySQL
Version:        10.0.17
Author:         MariaDB Foundation
Original-site:  https://mariadb.org
Copying-policy: GPL V2, LGPL v2.1
Size:           33.3M
Extension_by:   bmarkus
Tags:           LIBRARY CLI SERVER SQL MYSQL MARIADB
Comments:       Binaries only
                ----
                Start server with command
                'sudo /usr/local/mysql/bin/mysqld_safe &'

                Database is /usr/local/mysql/data
                Backup or use persistent storage

                ----
                Compiled for Core 6.0
Change-log:     2014/11/27 First version, to 10.0.15
Current:        2015/04/06 Updated to 10.0.17

~


Quote
tc@box:~$ tce
tce-ab - Tiny Core Extension: Application Browser

S)earch P)rovides K)eywords or Q)uit:
Enter starting chars of desired extension, e.g. abi: psql
S)earch P)rovides K)eywords or Q)uit:
Enter starting chars of desired extension, e.g. abi: postgres
Title:          postgresql-9.5.1.tcz
Description:    PostgreSQL database
Version:        9.5.1
Author:         PostgreSQL Global Development Group
Original-site:  http://www.postgresql.org
Copying-policy: PostgreSQL License
Size:           3.7M
Extension_by:   andyj
Tags:           PostgreSQL database
Comments:       Compiled for TC 7.x
                Optional procedural language support will require Perl, Python, and/or Tcl extensions.
Change-log:     2015/03/20 first version 9.4.1
Current:        2016/02/24 updated to version 9.5.1

~

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: How to start PostgreSQL in TCL?
« Reply #3 on: April 04, 2017, 02:45:31 PM »
Try the Postgresql website. It's no different in TCL than any other distro.

For persistance update your path and library cache:

Add /usr/local/pgsql95/bin to your path in ~/.profile
Add /usr/local/pgsql95/lib to /etc/ld.so.conf (and add this file to /opt/.filetool)

This way you will be able to use psql without having to use full paths.

Once you get your database created add the following to your /opt/bootlocal.sh:

/usr/bin/sudo "PATH=$PATH:/usr/local/pgsql95/bin" "LD_LIBRARY_PATH=/usr/local/pgsql95/lib" -u tc /usr/local/pgsql95/bin/pg_ctl -D /path/to/my/db -l /path/to/my/db.log start