Re: Further to postgres on Rails in Fedora 18 but OT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Apologies for top post
Thanks this is most helpful
Roger
On Fri, 17 May 2013, Roger wrote:

On 05/16/2013 09:51 PM, Max Pyziur wrote:

[... deleted for the sake of brevity ...]

Late getting back to the party ...


Thanks Max
I though so too. I tried SELECT * FROM registers ORDER BY lname it returns nothing, meaning the table doesn't exist or is empty.

If the table doesn't exist, you'll get a message saying "relation doesn't exist." More like, there is no data in the table.

So where would Rails put tables?I have no luck finding, yet they do seem to exist and show results in the rails app. It seems the registers table is not in booking_development and I cannot find where it may be.

Start with finding the database name; from a command-line, type:
psql -l

That should give you a list of postgresql databases hosted on a machine. It will also tell you who the owner is (and that gives you a clue as to access).

From a commandline:
psql <databasename>

will get you into postgresql's database monitor, providing you have privileges.

Once in the monitor, you can type
\dt
for list of tables.

Conversely, you can get a schema by typing from a commandline:
pg_dump -s <databasename>

Output it to a file (pg_dump -s <databasename> > filename) or grep out the lines in which you are interested
(pg_dump -s <databasename> | grep "CREATE TABLE")
is one way of getting a list of tables from the commandline.

As for the integer problem I think I'll recreate the table and use integer instead of string before it gets useable data entered.
More searching
thanks
Roger



Max Pyziur
pyz@xxxxxxxxx

--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux