[GENERAL] Arrays and LIKE

2009-08-08 Thread David
Done a bit of hunting and can't seem to find an answer as to if this sort of thing is possible: SELECT * FROM mail WHERE recipients ILIKE 'david%'; Where recipients is a VARCHAR(128)[] The above doesn't work but thats the sort of thing I want to do... If this is possible and can use an index as

Re: [GENERAL] Arrays and LIKE

2009-08-08 Thread Andreas Kretschmer
David wrote: > Done a bit of hunting and can't seem to find an answer as to if this sort of > thing is possible: > > SELECT * FROM mail WHERE recipients ILIKE 'david%'; > > Where recipients is a VARCHAR(128)[] > > The above doesn't work but thats the sort of thing I want to do... > If this is

[GENERAL] duplicate key violates unique constraint

2009-08-08 Thread sweta
Hello all, I have a table named "t_i_shift_shadow" with following spec Column | Type | Modifiers -+---+--- cid | character vary

Re: [GENERAL] Arrays and LIKE

2009-08-08 Thread Jasen Betts
On 2009-08-08, David wrote: > Done a bit of hunting and can't seem to find an answer as to if this sort of > thing is possible: > > SELECT * FROM mail WHERE recipients ILIKE 'david%'; > > Where recipients is a VARCHAR(128)[] > > The above doesn't work but thats the sort of thing I want to do... >

[GENERAL] 'a' = any( $${'a','x'} )

2009-08-08 Thread Jasen Betts
jasen=# select 'a' = any( $${'a','x'}$$ ) ; ?column? -- f (1 row) I expect it to be true instead. what am I doing wrong? PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2 jasen. -- Sent via pgsql-general mailing list (pgsql-general

Re: [GENERAL] 'a' = any( $${'a','x'} )

2009-08-08 Thread Greg Stark
On Sat, Aug 8, 2009 at 12:08 PM, Jasen Betts wrote: > select 'a' = any( $${'a','x'}$$ ) ; postgres=# select 'a' = any( $${"a","x"}$$ ) ; ?column? -- t (1 row) -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make cha

Re: [GENERAL] duplicate key violates unique constraint

2009-08-08 Thread Filip Rembiałkowski
2009/8/8 > Hello all, > > I have a table named "t_i_shift_shadow" with following spec > > > Column | Type | > Modifiers > > -+---+--- > cid | character varyi

Re: [GENERAL] 'a' = any( $${'a','x'} )

2009-08-08 Thread Vyacheslav Kalinin
Try select 'a' = any( $${a,x}$$ ) ; or select 'a' = any( array['a','x'] ) ; On Sat, Aug 8, 2009 at 3:08 PM, Jasen Betts wrote: > jasen=# select 'a' = any( $${'a','x'}$$ ) ; > ?column? > -- > f > (1 row) > > I expect it to be true instead. what am I doing wrong? > > > PostgreSQL 8

Re: [GENERAL] Arrays and LIKE

2009-08-08 Thread Sam Mason
On Sat, Aug 08, 2009 at 05:04:29PM +0930, David wrote: > Done a bit of hunting and can't seem to find an answer as to if this > sort of thing is possible: > > SELECT * FROM mail WHERE recipients ILIKE 'david%'; > > Where recipients is a VARCHAR(128)[] It's a bit of a fiddle: CREATE FUNCTION f

Re: [GENERAL] Postgresql Backups

2009-08-08 Thread Vick Khera
On Fri, Aug 7, 2009 at 3:54 PM, Scott Marlowe wrote: > You're probably better off switching to explicitly backing up > databases in the custom format and using a single pg_dumpall --globals > to backup the users accounts and such.  That's how I prefer to do it > and it makes life much easier. Thi

Re: [GENERAL] A compare and/or sync. database structure?

2009-08-08 Thread Sualeh Fatehi
The free, open-source SchemaCrawler for SQL Server tool is desinged to do just this. You can take human-readable snapshots of the schema and data, for later comparison. Comparisons are done using a standard diff tool such as WinMerge. SchemaCrawler outputs details of your schema (tables, views, pro

Re: [GENERAL] psql and Emacs on Windows

2009-08-08 Thread Wenjian Yang
Thanks for the replies. I tried Cygwin and unfortunately failed to get it to work with the "native" emacs binary for windows. I didn't spend too much time to try though, since the version of postgresql with cygwin is still 8.2.*, and I'm not sure how good the future support will be... I did try a

[GENERAL] libpq

2009-08-08 Thread Jim Michaels
I am trying to compile a program with libpq using boirland c++ 5.5.1 free edition and with mingw(gcc), and SELECT queries are returning PQntuples with results of 0, but I can do the same query in pgadmin and get 1 result. there is no way to link on the .lib files because they are in COFF forma

Re: [GENERAL] Arrays and LIKE

2009-08-08 Thread David
Thanks all normally I would have gone with a linked table but since support for arrays has improved in pg lately I thought I would give them a go again but I guess they are still not ready for what I want. I did think of another solution overnight though that still uses arrays but also a subtab