On Sat, Aug 16, 2014 at 7:02 PM, Chris Hanks
wrote:
> Thanks, I have considered it, and I'd like to stick with an array for
> my use case if possible. Also, if citext is being advised against, I'd
> like to know about it, since I use it extensively and have never had
>
ack into the array form by doing a
> JOIN and grouping by the first table's primary key.
>
>
> On Fri, Aug 15, 2014 at 11:46 AM, Chris Hanks
> wrote:
>>
>> Hi -
>>
>> I have a table with a citext[] column, and I'm trying to write a
>> uniqueness
Hi -
I have a table with a citext[] column, and I'm trying to write a
uniqueness constraint for the array values. That is, two rows with
{one,two} and {two,three} would conflict. Since it's citext, also
{one,two} and {TWO, THREE} should conflict too.
My first thought was to make a unique index us
That did the trick! Thanks, Tom!
On Thu, Jul 10, 2014 at 8:47 AM, Tom Lane wrote:
> Chris Hanks writes:
>> CREATE VIEW tables AS
>> SELECT a.*, b.col AS other_col
>> FROM a
>> LEFT JOIN b ON a.id = b.id
>> UNION ALL
>> SELECT c.*, d.col AS ot
I need it the way it is. It's a foreign key in the actual query.
Thanks!
On Thu, Jul 10, 2014 at 8:31 AM, Igor Neyman wrote:
>> -Original Message-
>> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
>> ow...@postgresql.org] On Behalf Of Chris Hanks
Hi everyone -
I have a slow query issue in an app I'm working on. I'm unfortunately
not at liberty to share the query/schema details, but I've put
together a very similar reproduction of the issue:
-
CREATE TABLE a (id integer primary key, col integer);
CREATE TABLE b (id integer primary key
That works! Thanks!
On Fri, May 30, 2014 at 11:59 AM, Merlin Moncure wrote:
> On Fri, May 30, 2014 at 11:16 AM, Chris Hanks
> wrote:
>> I'm using a JSON column to store some aggregate data, like so:
>>
>> UPDATE courses_table
>> SET aggr
I'm using a JSON column to store some aggregate data, like so:
UPDATE courses_table
SET aggregates = agg.aggregates
FROM (
SELECT course_id, row_to_json(sub) AS aggregates
FROM (
SELECT course_id, avg(rating) AS rating, sum(reviews_count) AS
reviews_count,
On Fri, Mar 1, 2013 at 6:37 AM, Merlin Moncure wrote:
> On Fri, Mar 1, 2013 at 3:59 AM, Chris Hanks
> wrote:
> > On Fri, Mar 1, 2013 at 1:21 AM, Raymond O'Donnell wrote:
> >>
> >> On 01/03/2013 00:19, Chris Hanks wrote:
> >> > On Thu, Fe
On Fri, Mar 1, 2013 at 1:21 AM, Raymond O'Donnell wrote:
> On 01/03/2013 00:19, Chris Hanks wrote:
> > On Thu, Feb 28, 2013 at 6:00 AM, Tom Lane > <mailto:t...@sss.pgh.pa.us>> wrote:
> >
> > Chris Hanks > <mailto:christopher.m.ha...@gmail.co
On Thu, Feb 28, 2013 at 6:00 AM, Tom Lane wrote:
> Chris Hanks writes:
> > create or replace view values_view as
> > select fkey1, fkey3,
> > (derived1 / max(derived1) over (partition by fkey1)) as derived1,
> > (derived2 / sum(derived1) over (partition by f
On Wed, Feb 27, 2013 at 10:18 PM, Merlin Moncure wrote:
> On Wed, Feb 27, 2013 at 8:22 PM, Chris Hanks
> wrote:
> > Hi. Sorry if this is repetitive, I tried posting to pgsql-performance
> first
> > but I think it got stuck in moderation.
> >
> > I'm tryi
Hi. Sorry if this is repetitive, I tried posting to pgsql-performance first
but I think it got stuck in moderation.
I'm trying to create a view that uses a window function, but it seems that
Postgres is unable to optimize it. Here's a reproduction of my situation
with 9.2.2:
---
drop table if ex
On Mon, May 14, 2012 at 8:36 PM, Tom Lane wrote:
> Chris Hanks writes:
> > Nothing? Are subqueries just not meant to be used this way?
>
> The SQL standard says not ;-).
>
> You could approximate it like this:
>
>select ..., (select row(x,y,z) from ...), ... f
Nothing? Are subqueries just not meant to be used this way?
On Wed, May 9, 2012 at 9:42 AM, Chris Hanks
wrote:
> Hello -
>
> I have two tables:
>
> CREATE TABLE users
> (
> id serial NOT NULL,
> created_at timestamp with time zone NOT NULL,
> last_seen_at timest
Hello -
I have two tables:
CREATE TABLE users
(
id serial NOT NULL,
created_at timestamp with time zone NOT NULL,
last_seen_at timestamp with time zone NOT NULL,
-- some other columns...
)
CREATE TABLE emails
(
user_id integer NOT NULL,
address text NOT NULL,
created_at timestamp w
Ausburn wrote:
> This might help you:
>
> http://www.postgresql.org/docs/8.4/static/queries-with.html
>
> On 24/08/2011, at 9:54 AM, Chris Hanks wrote:
>
>> I have two tables:
>>
>> CREATE TABLE items
>> (
>> root_id integer NOT NULL,
>> id
I have two tables:
CREATE TABLE items
(
root_id integer NOT NULL,
id serial NOT NULL,
-- Other fields...
CONSTRAINT items_pkey PRIMARY KEY (root_id, id)
)
CREATE TABLE votes
(
root_id integer NOT NULL,
item_id integer NOT NULL,
user_id integer NOT NULL,
type smallint NOT NULL,
18 matches
Mail list logo