Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-07 Thread Michael Sacket
On Feb 6, 2014, at 12:57 PM, Gavin Flower wrote: On 07/02/14 05:43, Michael Sacket wrote: On Feb 6, 2014, at 2:23 AM, Vik Fearing wrote: On 02/06/2014 04:16 AM, Michael Sacket wrote: Often times I find it necessary to work with table rows in a specific, generally user-supplied order

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Michael Sacket
On Feb 6, 2014, at 2:23 AM, Vik Fearing wrote: On 02/06/2014 04:16 AM, Michael Sacket wrote: Often times I find it necessary to work with table rows in a specific, generally user-supplied order. It could be anything really that requires an ordering that can't come from a natural column

[GENERAL] Ordering Results by a Supplied Order

2014-02-05 Thread Michael Sacket
Greetings, Often times I find it necessary to work with table rows in a specific, generally user-supplied order. It could be anything really that requires an ordering that can't come from a natural column. Most of the time this involved manipulating a position column from the client

Re: [GENERAL] [GENERAL] INSERT. RETURNING for copying records

2012-09-10 Thread Michael Sacket
On Sep 7, 2012, at 2:19 PM, David Johnston wrote: From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Michael Sacket Sent: Friday, September 07, 2012 2:09 PM To: PG-General Mailing List Subject: [GENERAL] INSERT… RETURNING for copying

[GENERAL] INSERT… RETURNING for copying records

2012-09-07 Thread Michael Sacket
Good Afternoon, I'm attempting to write a function that will duplicate a few records, but the catch is I need to have a mapping of the original pk to the new pk. I know I can use the RETURNING clause to get the new ids... but how to map that to the original ones is escaping me. Setup

Re: [GENERAL] NULL value comparison

2012-08-23 Thread Michael Sacket
On Aug 22, 2012, at 9:38 PM, Craig Ringer wrote: On 08/23/2012 10:32 AM, Michael Sacket wrote: The good news is I now have the proper constraints in place and the app and it's 130 tables are working with PostgreSQL in less than a day. Wow, that's cool, especially without SQL changes

[GENERAL] NULL value comparison

2012-08-22 Thread Michael Sacket
Good Day, I'm trying to figure out why a postgresql query doesn't return what I'd expect with a query like this where there are NULL values: select * from users where is_enabled'Y'; I'm expecting it to return all records where is_enabled is 'N' or NULL. Perhaps my expectations are misguided.

Re: [GENERAL] NULL value comparison

2012-08-22 Thread Michael Sacket
Thank you all very much! Unfortunately I can't change the query... but I can modify the data. I updated the NULL values to 'N' and put the appropriate NOT NULL constraint and a default value of 'N'. On Aug 22, 2012, at 8:37 AM, David Johnston wrote: On Aug 22, 2012, at 9:23, Michael Sacket

Re: [GENERAL] NULL value comparison

2012-08-22 Thread Michael Sacket
On Aug 22, 2012, at 8:17 PM, Craig Ringer wrote: On 08/22/2012 10:58 PM, Michael Sacket wrote: Thank you all very much! Unfortunately I can't change the query... but I can modify the data. I updated the NULL values to 'N' and put the appropriate NOT NULL constraint and a default value