Re: [GENERAL] Programmatic access to interval units

2014-12-02 Thread Nelson Green
On Tue, Dec 2, 2014 at 3:48 PM, Merlin Moncure wrote: > On Tue, Dec 2, 2014 at 12:40 PM, Nelson Green > wrote: > > In the line: IF LOWER(_unit) NOT IN (SELECT interval_unit ..., I would > > rather > > query a catalog table for the interval unit names if possi

Re: [GENERAL] [Solved] Programmatic access to interval units

2014-12-02 Thread Nelson Green
On Tue, Dec 2, 2014 at 2:25 PM, Adrian Klaver wrote: > On 12/02/2014 10:40 AM, Nelson Green wrote: > >> On Tue, Dec 2, 2014 at 11:57 AM, Merlin Moncure > <mailto:mmonc...@gmail.com>> wrote: >> > > >> Hi Merlin, >> >> I'm afraid I'm

Re: [GENERAL] Programmatic access to interval units

2014-12-02 Thread Nelson Green
On Tue, Dec 2, 2014 at 11:57 AM, Merlin Moncure wrote: > On Tue, Dec 2, 2014 at 9:48 AM, Nelson Green > wrote: > > On Mon, Dec 1, 2014 at 2:14 PM, Merlin Moncure > wrote: > >> On Mon, Dec 1, 2014 at 10:42 AM, Nelson Green > >> wrote: > >> > Good

Re: [GENERAL] Programmatic access to interval units

2014-12-02 Thread Nelson Green
27;),('hour'),('day'),('week'),('month'),('year'),('decade'),('century'),('millennium');* > > *SELECT * FROM time_intervals;* > Thanks Melvin, Actually I've already hard-coded a temporary table into the fun

Re: [GENERAL] Programmatic access to interval units

2014-12-02 Thread Nelson Green
On Mon, Dec 1, 2014 at 2:14 PM, Merlin Moncure wrote: > On Mon, Dec 1, 2014 at 10:42 AM, Nelson Green > wrote: > > Good morning list, > > > > According to the documentation for interval data type inputs, the unit > can > > be one of microsecond, millisecond

[GENERAL] Programmatic access to interval units

2014-12-01 Thread Nelson Green
Good morning list, According to the documentation for interval data type inputs, the unit can be one of microsecond, millisecond, second, minute, hour, day, week, month, year, decade, century, or millennium. Are these units stored in a catalog somewhere? I would like to access them programmaticall

Re: [GENERAL] password in recovery.conf [SOLVED]

2014-09-27 Thread Nelson Green
On Fri, Sep 26, 2014 at 6:40 PM, John R Pierce wrote: > On 9/26/2014 4:32 PM, Nelson Green wrote: > >> >> Thanks Bosco, DrakoRod, and Adrian. Between the three of you it became >> obvious >> that I was doing something wrong. And yes, in the end you were right.

Re: [GENERAL] password in recovery.conf [SOLVED]

2014-09-27 Thread Nelson Green
On Fri, Sep 26, 2014 at 6:46 PM, Adrian Klaver wrote: > On 09/26/2014 04:32 PM, Nelson Green wrote: > >> On Fri, Sep 26, 2014 at 5:51 PM, Adrian Klaver >> > > Doubling the quote seems to work here. >> >> >> Thanks Bosco, DrakoRod, and Adrian. Bet

Re: [GENERAL] password in recovery.conf [SOLVED]

2014-09-26 Thread Nelson Green
On Fri, Sep 26, 2014 at 5:51 PM, Adrian Klaver wrote: > On 09/26/2014 12:58 PM, Nelson Green wrote: > >> Hello all, >> >> I am setting up a streaming replication stand-by, and the replication >> role password has a single quote in it. I am unable to properly &g

[GENERAL] password in recovery.conf

2014-09-26 Thread Nelson Green
Hello all, I am setting up a streaming replication stand-by, and the replication role password has a single quote in it. I am unable to properly reference the password in the conninfo setting of recovery.conf so it will authenticate to the master. Doubling the quote gives me a syntax error, and es

Re: [GENERAL] Employee modeling question

2014-09-23 Thread Nelson Green
On Fri, Sep 5, 2014 at 11:39 AM, Rich Shepard wrote: > On Fri, 5 Sep 2014, John McKown wrote: > > They are excellent. They are _not_ for beginners. The "For Smarties" >> portion is not just a play against the "For Dummies" series. Joe does some >> high powered SQL. >> > > For the purpose of de

Re: [GENERAL] Employee modeling question

2014-09-05 Thread Nelson Green
On Fri, Sep 5, 2014 at 9:46 AM, John McKown wrote: > On Fri, Sep 5, 2014 at 7:52 AM, Nelson Green > wrote: > > > > Thanks Robin. Ironically enough, our little local library has three > books by > > Joe Celko, so looks like I may have a weekend of reading ahead of me.

Re: [GENERAL] Employee modeling question

2014-09-05 Thread Nelson Green
> > > I could store the department and business attributes with the >> > employee, but without proper constraints the referenced department >> > could conceivably not correspond to the referenced business. Or I >> > could ensure that all businesses have at least one department, >> > defaulting to t

Re: [GENERAL] Employee modeling question

2014-09-04 Thread Nelson Green
On Thu, Sep 4, 2014 at 9:48 AM, François Beausoleil wrote: > Hello Nelson, > > Le 2014-09-04 à 10:39, Nelson Green a écrit : > > > Good morning, > > > > Hopefully this is the correct place to ask this type of question. > > > > I am in the early stag

[GENERAL] Employee modeling question

2014-09-04 Thread Nelson Green
Good morning, Hopefully this is the correct place to ask this type of question. I am in the early stages of designing a system to track employee information, including some aspects of their payroll, one of which is the source of the salary funds within the business. I need to make this generic en

Re: [GENERAL] Last inserted row id with complex PK

2014-01-09 Thread Nelson Green
On Wed, Jan 8, 2014 at 5:39 PM, Alban Hertroys wrote: > On 08 Jan 2014, at 16:54, Nelson Green wrote: > > > I have a projects log table with a three column PK, project_num, > person_num, and sequence, where each new entry for a project/person > combination increments the sequ

Re: [GENERAL] Last inserted row id with complex PK

2014-01-08 Thread Nelson Green
On Wed, Jan 8, 2014 at 1:24 PM, David Johnston wrote: > Nelson Green wrote > > My apologies, I was not completely clear. I will not know any of the > > columns in advance. The most recent insert is the result of user input > > from > > a web form, so I won'

Re: [GENERAL] Last inserted row id with complex PK

2014-01-08 Thread Nelson Green
On Wed, Jan 8, 2014 at 10:22 AM, Tom Lane wrote: > Francisco Olarte writes: > > Hi Nelson: > > On Wed, Jan 8, 2014 at 4:54 PM, Nelson Green > wrote: > >> I have a projects log table with a three column PK, project_num, > person_num, > >> and sequence, wh

Re: [GENERAL] Last inserted row id with complex PK

2014-01-08 Thread Nelson Green
On Wed, Jan 8, 2014 at 10:09 AM, Francisco Olarte wrote: > Hi Nelson: > > On Wed, Jan 8, 2014 at 4:54 PM, Nelson Green > wrote: > > I have a projects log table with a three column PK, project_num, > person_num, > > and sequence, where each new entry for a

[GENERAL] Last inserted row id with complex PK

2014-01-08 Thread Nelson Green
I have a projects log table with a three column PK, project_num, person_num, and sequence, where each new entry for a project/person combination increments the sequence, which is not an auto incrementing sequence. Is there any way to retrieve the last entry to the table? For instance, if the last e

Re: [GENERAL] Inserting rows containing composite foreign keys

2013-11-26 Thread Nelson Green
> To: pgsql-general@postgresql.org > Date: Tue, 26 Nov 2013 08:15:45 +0100 > > Nelson Green, 25.11.2013 23:01: > > Hello, > > When inserting a record into the jobs table that references projects by > > name, do I have to query the projects table twice, > > o

[GENERAL] Inserting rows containing composite foreign keys

2013-11-25 Thread Nelson Green
Hello, I have a question regarding inserting a row into a child table when the PK of the parent table is a composite key. In this case, I have funding sources that buy projects, and projects generate jobs. Project numbers are not universally unique, but are unique to funding source. Therefore

Re: [GENERAL] Storing small image files

2013-05-10 Thread Nelson Green
On Fri, May 10, 2013 at 5:24 AM, Misa Simic wrote: > 2013/5/10 Eduardo Morras > >> >> Hi Nelson. I worked with images and Postgresql, and want to add some >> comments: >> >> On Thu, 9 May 2013 13:40:15 -0500 >> Nelson Green wrote: >> > OK, thi

Re: [GENERAL] Storing small image files

2013-05-10 Thread Nelson Green
On Fri, May 10, 2013 at 2:59 AM, Eduardo Morras wrote: > > Hi Nelson. I worked with images and Postgresql, and want to add some > comments: > > On Thu, 9 May 2013 13:40:15 -0500 > Nelson Green wrote: > > OK, this is kind of convoluted, but I got a couple of test case

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
. On Thu, May 9, 2013 at 1:49 PM, Misa Simic wrote: > > > > 2013/5/9 Nelson Green > >> Hi Misa, >> >> That gives me a "ERROR: must be superuser to use server-side >> lo_import()" on the client. I think this is enforced to preserve file >> perm

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
! On Thu, May 9, 2013 at 12:31 PM, Misa Simic wrote: > > > > 2013/5/9 Nelson Green > >> Thanks Karl, but I'm trying to do this from a psql shell. I can't use the >> C functions there, can I? >> >> >> On Thu, May 9, 2013 at 11:21 AM, Karl De

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
On Thu, May 9, 2013 at 12:05 PM, Nelson Green wrote: > > > > On Thu, May 9, 2013 at 10:51 AM, Achilleas Mantzios < > ach...@matrix.gatewaynet.com> wrote: > >> ** >> >> Take a look here first : >> >> http://www.postgresql.org/docs/9.2/

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
time people manipulate bytea's using a higher level > programming lang. > > > > > > On Πεμ 09 Μαΐ 2013 10:34:35 Nelson Green wrote: > > On Thu, May 9, 2013 at 10:20 AM, Achilleas Mantzios < > ach...@matrix.gatewaynet.com> wrote: > > why not bytea? > > >

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
her than years ago when I was studying for some of the MySQL certs. If I do happen to come up with a solution that works I will be sure to post it here. > > > > > On Πεμ 09 Μαΐ 2013 10:34:35 Nelson Green wrote: > > On Thu, May 9, 2013 at 10:20 AM, Achilleas Mantzios < >

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
ytea's. > > > > There are downsides in both solutions, you just have to have good reasons > > to not use bytea. > > > > On Πεμ 09 Μαΐ 2013 10:04:18 Nelson Green wrote: > > Good morning list, > > I am designing a system that will have a table for security

[GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
Good morning list, I am designing a system that will have a table for security badges, and we want to store the ID badge photo. These are small files, averaging about 500K in size. We have made the decision to store the image as a BLOB in the table itself for a variety of reasons. However, I am ha