Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?

2017-09-05 Thread Ryan Murphy
M Hellmuth Vargas wrote: > Hi > > can see: > > > https://stackoverflow.com/questions/4928054/postgresql-wildcard-like-for-any-of-a-list-of-words > > 2017-09-04 22:42 GMT-05:00 Ryan Murphy : > >> > I'm pretty sure it doesn't work syntactically

Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?

2017-09-04 Thread Ryan Murphy
> I'm pretty sure it doesn't work syntactically. Don't recall the details offhand. Ok, thanks!

Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?

2017-09-04 Thread Ryan Murphy
> > I'm not sure why we've never got round to providing such a thing > in core ... probably lack of consensus on what to name the reverse > operator. You'd need to support regex cases as well, so there's > more than one operator name to come up with. > Interesting! It seems like one "simple" poss

[GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?

2017-09-04 Thread Ryan Murphy
e.g. I know you can do select * from post where 'music' = any(tags); Which is similar to saying tags @> '{music}'. And I see that I can even do: select * from post where 'music' LIKE any(tags); ...implying that ANY is more general in some ways than @>, e.g. it can would with LIKE as well as =.

Re: [GENERAL] postgres question: Views with duplicate field names

2016-09-05 Thread Ryan Murphy
> Because I specifically aliased the first task reference using AS task_1. > > Ok, totally. I missed that when I first read your query, didn't read it closely enough. Thanks.

Re: [GENERAL] postgres question: Views with duplicate field names

2016-09-05 Thread Ryan Murphy
> You're confused about the input vs. the output. The output columns > of a view all have to have distinct names, just like you can't do > "create table foo (f1 int, f1 int)". They can be reading the same > values, though. > > regards, tom lane > Ok, that makes sense. Tha

Re: [GENERAL] postgres question: Views with duplicate field names

2016-09-05 Thread Ryan Murphy
> You're confused about the input vs. the output. The output columns > of a view all have to have distinct names, just like you can't do > "create table foo (f1 int, f1 int)". They can be reading the same > values, though. > > regards, tom lane > Ok, that makes sense. Tha

Re: [GENERAL] postgres question: Views with duplicate field names

2016-09-05 Thread Ryan Murphy
Interesting, thanks! Do you know why the first one fails instead of doing that renaming process, while your version succeeds? On Monday, September 5, 2016, Adrian Klaver wrote: > On 09/05/2016 12:55 PM, Ryan Murphy wrote: > >> Hello, I have a question about views in Postgres. &

[GENERAL] postgres question: Views with duplicate field names

2016-09-05 Thread Ryan Murphy
Hello, I have a question about views in Postgres. Given a table like so: create table todo ( id serial, task text, done_time timestamp default null ); it is legal (though perhaps not advised, by some) to query it like so: select task, * from todo; This gives a result with 2 redundant "ta