Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread Andrew Sullivan
On Sat, Oct 24, 2015 at 07:33:15PM -0700, David Blomstrom wrote: > It seems like a command-line tool would be > incredibly tedious when creating tables, modifying them, filling them with > data, etc. For whatever it's worth, I find quite the opposite: once you have the hang of the command line, it

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread David Blomstrom
I'm a writer. I studied programing and MySQL so I could create websites that I can publish my articles to. I don't have time to keep up with the endless technology - MySQL, PDO, stored procedures, PHP, JavaScript, JQuery, and on and on - especially when I have to work for a living. I've been using

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread Adrian Klaver
On 10/24/2015 08:52 PM, Rob Sargent wrote: ok. now who has the url to the pithy heres-why-you-/really/-want-the-command-line. It distills to something about actually knowing what you’re doing. Everyone has to start somewhere. The point is get someone using Postgres in manner they are comforta

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread Rob Sargent
ok. now who has the url to the pithy heres-why-you-really-want-the-command-line. It distills to something about actually knowing what you’re doing. > On Oct 24, 2015, at 9:29 PM, David Blomstrom > wrote: > > Good tip; I can now see the database I created. Thanks. > > On Sat, Oct 24, 2015

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread David Blomstrom
Good tip; I can now see the database I created. Thanks. On Sat, Oct 24, 2015 at 8:20 PM, Adrian Klaver wrote: > On 10/24/2015 08:00 PM, David Blomstrom wrote: > >> "Is there a entry under Servers?" >> >> PostgreSQL 9.5 (localhost) - but there's a red X over it. >> > > That means you are not conn

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread Adrian Klaver
On 10/24/2015 08:00 PM, David Blomstrom wrote: "Is there a entry under Servers?" PostgreSQL 9.5 (localhost) - but there's a red X over it. That means you are not connected to the Server. Right click on the entry and select Connect. It will probably ask for a password, which should be the dat

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread David Blomstrom
"Is there a entry under Servers?" PostgreSQL 9.5 (localhost) - but there's a red X over it. On Sat, Oct 24, 2015 at 7:52 PM, Adrian Klaver wrote: > On 10/24/2015 07:44 PM, David Blomstrom wrote: > >> Hmmm...I have pgAdminIII. When I click on Server, there's no option to >> create a database. >>

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread Adrian Klaver
On 10/24/2015 07:44 PM, David Blomstrom wrote: Hmmm...I have pgAdminIII. When I click on Server, there's no option to create a database. I would spend some time here: http://www.pgadmin.org/docs/1.20/index.html before going much further, just to get the gist of pgAdmin. In the meantime, you

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread David Blomstrom
Hmmm...I have pgAdminIII. When I click on Server, there's no option to create a database. On Sat, Oct 24, 2015 at 7:37 PM, John R Pierce wrote: > On 10/24/2015 7:33 PM, David Blomstrom wrote: > >> I'd greatly prefer a GUI. It seems like a command-line tool would be >> incredibly tedious when cre

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread John R Pierce
On 10/24/2015 7:33 PM, David Blomstrom wrote: I'd greatly prefer a GUI. It seems like a command-line tool would be incredibly tedious when creating tables, modifying them, filling them with data, etc. Thanks. normally, your application programs do the data filling part, manual data entry di

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread David Blomstrom
I'd greatly prefer a GUI. It seems like a command-line tool would be incredibly tedious when creating tables, modifying them, filling them with data, etc. Thanks. On Sat, Oct 24, 2015 at 7:28 PM, Adrian Klaver wrote: > On 10/24/2015 07:20 PM, David Blomstrom wrote: > >> I'm on a Mac running OS X

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread Adrian Klaver
On 10/24/2015 07:20 PM, David Blomstrom wrote: I'm on a Mac running OS X El Capitain. I think I installed PostgreSQL 9.5 after following the links to http://www.enterprisedb.com/products-services-training/pgdownload#osx Well the tutorial is geared to using the command line to run programs. Are

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread David Blomstrom
I'm on a Mac running OS X El Capitain. I think I installed PostgreSQL 9.5 after following the links to http://www.enterprisedb.com/products-services-training/pgdownload#osx I just learned about phpPGAdmin and installed it as well. But when I navigate to localhost/phppgadmin, I get a "not found" er

Re: [GENERAL] Where do I enter commands?

2015-10-24 Thread Adrian Klaver
On 10/24/2015 06:21 PM, David Blomstrom wrote: I just installed PostgreSQL and started reading the tutorial @ http://www.postgresql.org/docs/8.0/static/tutorial-createdb.html and was snowed at square one. To create a database, I'm supposed to type the following command: $ createdb mydb But it

[GENERAL] Where do I enter commands?

2015-10-24 Thread David Blomstrom
I just installed PostgreSQL and started reading the tutorial @ http://www.postgresql.org/docs/8.0/static/tutorial-createdb.html and was snowed at square one. To create a database, I'm supposed to type the following command: $ createdb mydb But it doesn't say where I'm supposed to type it. When I

Re: [GENERAL] Using function returning multiple values in a select

2015-10-24 Thread Adrian Klaver
On 10/24/2015 12:37 PM, Lele Gaifax wrote: Adrian Klaver writes: An actual working example that shows exactly what you want to achieve would help. Mainly where does the base price originate? A product has a base price (and maybe a base discount), but that may be overridden by particular rule

Re: [GENERAL] partial JOIN (was: ID column naming convention)

2015-10-24 Thread Dane Foster
On Sat, Oct 24, 2015 at 5:23 PM, Dane Foster wrote: > On Sat, Oct 24, 2015 at 3:42 PM, Rafal Pietrak wrote: > >> >> >> W dniu 24.10.2015 o 21:03, Rafal Pietrak pisze: >> > >> > >> > W dniu 24.10.2015 o 15:00, David G. Johnston pisze: >> >> On Sat, Oct 24, 2015 at 6:41 AM, Rafal Pietrak > >>

Re: [GENERAL] partial JOIN (was: ID column naming convention)

2015-10-24 Thread Dane Foster
On Sat, Oct 24, 2015 at 3:42 PM, Rafal Pietrak wrote: > > > W dniu 24.10.2015 o 21:03, Rafal Pietrak pisze: > > > > > > W dniu 24.10.2015 o 15:00, David G. Johnston pisze: > >> On Sat, Oct 24, 2015 at 6:41 AM, Rafal Pietrak >> >wrote: > > [--] > >> > >

Re: [GENERAL] Duplicate rows during pg_dump

2015-10-24 Thread Marc Mamin
>On 10/24/2015 12:35 PM, Chaz Yoon wrote: >> I am seeing a duplicate, stale copy of the same row when performing a >> pg_dump or copying a specific table, but not when directly selecting >> from it. I'm running PostgreSQL 9.3.9 on Amazon RDS, with 9.3.10 client >> tools. >> >> It's happening on a

Re: [GENERAL] Duplicate rows during pg_dump

2015-10-24 Thread Adrian Klaver
On 10/24/2015 12:35 PM, Chaz Yoon wrote: I am seeing a duplicate, stale copy of the same row when performing a pg_dump or copying a specific table, but not when directly selecting from it. I'm running PostgreSQL 9.3.9 on Amazon RDS, with 9.3.10 client tools. It's happening on a users table, whic

Re: [GENERAL] partial JOIN (was: ID column naming convention)

2015-10-24 Thread Rafal Pietrak
W dniu 24.10.2015 o 21:03, Rafal Pietrak pisze: > > > W dniu 24.10.2015 o 15:00, David G. Johnston pisze: >> On Sat, Oct 24, 2015 at 6:41 AM, Rafal Pietrak > >wrote: > [--] >> >> ​Using explicit column names is expected - using "*" in non-trivial and

Re: [GENERAL] Using function returning multiple values in a select

2015-10-24 Thread Lele Gaifax
Adrian Klaver writes: > An actual working example that shows exactly what you want to achieve would > help. Mainly where does the base price originate? A product has a base price (and maybe a base discount), but that may be overridden by particular rules based on the customer, on the product typ

[GENERAL] Duplicate rows during pg_dump

2015-10-24 Thread Chaz Yoon
I am seeing a duplicate, stale copy of the same row when performing a pg_dump or copying a specific table, but not when directly selecting from it. I'm running PostgreSQL 9.3.9 on Amazon RDS, with 9.3.10 client tools. It's happening on a users table, which has a primary key and enforces a unique e

Re: [GENERAL] partial JOIN (was: ID column naming convention)

2015-10-24 Thread Rafal Pietrak
W dniu 24.10.2015 o 15:00, David G. Johnston pisze: > On Sat, Oct 24, 2015 at 6:41 AM, Rafal Pietrak >wrote: [--] > > ​Using explicit column names is expected - using "*" in non-trivial and > production queries is not. > > You can move the aliases if

Re: [GENERAL] Using function returning multiple values in a select

2015-10-24 Thread Adrian Klaver
On 10/24/2015 10:56 AM, Lele Gaifax wrote: Hi all, I have a function that returns multiple values, computing them from the input parameters, and I need to use it within an existing query. Say I have the following table: CREATE TABLE products ( id SERIAL NOT NULL, description VARCH

[GENERAL] Using function returning multiple values in a select

2015-10-24 Thread Lele Gaifax
Hi all, I have a function that returns multiple values, computing them from the input parameters, and I need to use it within an existing query. Say I have the following table: CREATE TABLE products ( id SERIAL NOT NULL, description VARCHAR(64), PRIMARY KEY (id) ) and the foll

Re: [GENERAL] partial JOIN (was: ID column naming convention)

2015-10-24 Thread David G. Johnston
On Sat, Oct 24, 2015 at 6:41 AM, Rafal Pietrak wrote: > The only way I know to avoid the column name > duplication is to explicity select column list: > SELECT s.sled,s.length,s,r.runner as right,r.length as > right_length,r,l.runner as left,l.length as left_length,l.* FROM > sleds s JOIN

[GENERAL] partial JOIN (was: ID column naming convention)

2015-10-24 Thread Rafal Pietrak
Hi, Recent interesting discussion on the list, on (just) naming convention reminded me of a related problem which I haven't resolved myself, jet. As slowly I learn SQL (like a blind dog in a meat market), currently I've just started to use table JOINS more extensively ... and I often bump on a "t