Re: [GENERAL] Between with a list of ranges possible ?

2015-05-29 Thread Stephen Cook
Use UNION ALL: select * from table where number * 3 between start_value1 and end_value2 UNION ALL select * from table where number * 3 between start_value2 and end_value2 UNION ALL select * from table where number * 3 between start_value3 and end_value3; -- Stephen On 5/29/2015 12:32 PM, Ar

Re: [GENERAL] PostgresSQL and HIPAA compliance

2016-06-17 Thread Stephen Cook
On 2016-06-17 14:09, Paul Jungwirth wrote: > On 06/17/2016 03:03 AM, Alex John wrote: >> RDS is a prime candidate except for the fact that they have explicitly >> stated that the Postgres engine is *not* HIPAA compliant. > > More precisely, it is not covered by the BAA Amazon will sign. > > I've

Re: [GENERAL] WIP: CoC V2

2016-01-11 Thread Stephen Cook
On 1/11/2016 6:41 PM, Alban Hertroys wrote: > >> On 12 Jan 2016, at 0:16, Joshua D. Drake wrote: >> >> 3. A safe, respectful, productive and collaborative environment is free of >> non-technical or personal comments, for example ones related to gender, >> sexual orientation, disability, physica

Re: [GENERAL] Skip trigger?

2016-04-30 Thread Stephen Cook
On 2016-04-30 02:08, wolfg...@alle-noten.de wrote: > Hi, > > I have a table with a row update trigger that is quite slow. > The trigger finction basically sets some bits in a "changed" column > depending on which values really changed. > For some bulk updates it can be determined in advance that t

Re: [GENERAL] top posting

2007-12-11 Thread Stephen Cook
Ivan Sergio Borgonovo wrote: On Tue, 11 Dec 2007 12:00:00 -0600 "Scott Marlowe" <[EMAIL PROTECTED]> wrote: You're certainly not. I can't tell you how many times I've carefully replied to someone with inline quoting, only to get some top post response. I then ask them politely not to top post,

Re: [GENERAL] top posting

2007-12-12 Thread Stephen Cook
Peter Childs wrote: On 12/12/2007, *Stephen Cook* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: I am subscribed to some other technical mailing lists on which the standard is top posting. Those people claim that filing through interleaved quotes or scrolling t

Re: [GENERAL] Postgres forums ... take 2

2010-11-16 Thread Stephen Cook
On 11/16/2010 10:51 AM, Magnus Hagander wrote: What I'm more interested in is still a word from the people who would actually *use* a forum on how this would be better than sites like Nabble and Gmane. I'm one of those. I'm subscribed to these mailing lists simply because it is the only way I

Re: [GENERAL] How to calculate length of path data without diagonals?

2010-12-23 Thread Stephen Cook
On 12/23/2010 1:25 PM, Romain Billoir wrote: > Hi, i need to calculate some length of path without diagonal. Some examples: > length((5,5),(6,6))) returns 1.41. I need 2: 5,5 to 5,6 + 5,6 to 6,6. > > Is that possible? You could write a function to get the Manhattan distance between two points

Re: [GENERAL] Disable Postgresql startup on boot (Windows XP)

2011-01-04 Thread Stephen Cook
On 1/4/2011 10:25 PM, Ken wrote: Hi. Everytime I boot Windows XP a number of postgres.exe services start and run in the background. As I am only an occasional user of postgresql on my laptop I was wondering how (a) I could disable the auto-start of the service on boot and (b) how to manually st

Re: [GENERAL] Retrieving Data from table based on Date and Time.

2014-11-01 Thread Stephen Cook
On 11/1/2014 2:27 AM, VENKTESH GUTTEDAR wrote: I have a table in which i have some few fields, in that few, one field is of date type and second one is of time data type, so now my question is how can i fetch the data with latest date and time, or the last inserted value from the PostgreSQL

Re: [GENERAL] execute trigger after another one

2014-12-04 Thread Stephen Cook
On 12/4/2014 6:11 PM, Carlos Carcamo wrote: Yes because my update_remote.sh file calls a php file to update a table in mysql, and it is updated after I perform another query to in_kardex, so the mysql table is one query behind postgres... Any thoughts? My bet is that the query run from your

[GENERAL] Equivalent of PHP "hex2bin()"

2014-12-19 Thread Stephen Cook
PHP has functions "bin2hex()" and "hex2bin()", and I have to deal with the results in PostgreSQL. These functions "Returns an ASCII string containing the hexadecimal representation of |str|. The conversion is done byte-wise with the high-nibble first" and "Decodes a hexadecimally encoded binar

[GENERAL] Installing PostgreSQL on OSX Server

2013-01-28 Thread Stephen Cook
Hello! I have convinced a client to use PostgreSQL instead of MySQL (hooray), which means it falls on me to install and configure it. I'm planning on doing this from the command line (I have SSH access). I have installed and configured PostgreSQL on Windows, FreeBSD, and a few Linux flavors,

Re: [GENERAL] Installing PostgreSQL on OSX Server

2013-01-28 Thread Stephen Cook
On 1/28/2013 11:15 AM, Steve Atkins wrote: You're not planning on using this in production, I hope? OS X is a very solid desktop OS, but it's server variant is packed full of weird and plain broken behaviour. Ouch. These are the servers they have and use, I don't really get a say in that.

Re: [GENERAL] Function tracking

2013-06-07 Thread Stephen Cook
On 6/7/2013 6:30 AM, Rebecca Clarke wrote: I'm looking for suggestions on the best way to track the updates to a function. We have two databases, Dev & Live, so I want to update Live with just the functions that have been modified in the DEV databas3e. Is there another, easier way to track the

[GENERAL] Logging failed connections

2017-08-16 Thread Stephen Cook
Hello! When a client gets the error message about "remaining connection slots are reserved for non-replication superuser connections", is this logged? What should I be grep-ing for? Thanks! -- Stephen -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

[GENERAL] pgcrypto encrypt

2017-09-06 Thread Stephen Cook
Hello! Is there a way to decrypt data encrypted with the pgcrypto "encrypt" function, outside the database? Assuming that I know the key etc... Thanks! -- Stephen -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql

Re: [GENERAL] pgcrypto encrypt

2017-09-19 Thread Stephen Cook
On 2017-09-19 15:42, Jeff Janes wrote: > On Tue, Sep 19, 2017 at 12:20 PM, Bruce Momjian <mailto:br...@momjian.us>> wrote: > > On Wed, SepĀ  6, 2017 at 04:19:52PM -0400, Stephen Cook wrote: > > Hello! > > > > Is there a way to decrypt data

Re: [GENERAL] REASSIGN OWNED simply doesn't work

2017-10-12 Thread Stephen Cook
On 2017-10-12 21:09, Sam Gendler wrote: > psql 9.6.3 on OS X. > > I'm dealing with a production database in which all db access has been > made by the same user - the db owner, which isn't actually a superuser > because the db runs on amazon RDS - amazon retains the superuser > privilege for its o

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-14 Thread Stephen Cook
Magnus Hagander wrote: I would guess they're referring to the ability to "pin" a table into memory, so that it always stays in the cache regardless of what else the database is doing. There is a narrow use-case where this can be very useful, but it can also be a very dangerous tool (hint: if yo

[GENERAL] Temp table or normal table for performance?

2009-08-19 Thread Stephen Cook
up in the future if necessary. Is there a rule of thumb on this one? I'm a bit biased against temporary tables, but then again if the normal table gets a lot of action it might not be the optimal choice. Thanks and regards, Stephen Cook -- Sent via pgsql-general mailing list (pgsql-g

Re: [GENERAL] Temp table or normal table for performance?

2009-08-19 Thread Stephen Cook
Peter Hunsberger wrote: On Wed, Aug 19, 2009 at 2:03 AM, Stephen Cook wrote: Let's say I have a function that needs to collect some data from various tables and process and sort them to be returned to the user. In general, would it be better to create a temporary table in that function, d

Re: [GENERAL] how to find primary key field name?

2011-10-11 Thread Stephen Cook
On 10/11/2011 6:54 PM, J.V. wrote: > If I have a table name, I know how to find the primary key constraint > name, but see no way to find the primary key field name. SELECT t.table_catalog, t.table_schema, t.table_name, kcu.constraint_name, kcu.column_name,

Re: [GENERAL] 7

2011-10-11 Thread Stephen Cook
On 10/11/2011 11:34 PM, Scott Ribe wrote: On Oct 11, 2011, at 8:18 PM, The Great SunWuKung wrote: This shop is number 1 at my shop-list! So why the fuck is your spam title "7"??? Because 1 through 6 already get caught as SPAM? -- Sent via pgsql-general mailing list (pgsql-general@postgres

Re: [GENERAL] Great site for comparing databases (or anything else)

2012-10-27 Thread Stephen Cook
On 10/27/2012 5:18 PM, Mike Christensen wrote: Just came across this one: http://hammerprinciple.com/databases/items/mysql/postgresql mySQL is great for embedding in applications though? Have they not read Oracle's license? Does it say anywhere on that site if the people surveyed know both

Re: [GENERAL] Bitmask trickiness

2010-07-21 Thread Stephen Cook
On 7/20/2010 11:59 PM, Howard Rogers wrote: But how do I find records which are ONLY yellow and orange, and exclude records which have some other colour mixed in, in one simple query without a lot of 'not this, not that' additions, and without using multiple separate AND tests to nail it down? ..

Re: [GENERAL] Bitmask trickiness

2010-07-23 Thread Stephen Cook
On 7/23/2010 2:38 AM, Howard Rogers wrote: Still doesn't answer the precise, specific technical question I >> actually asked, though, does it?! > > Which was answered by Stephen Cook was it not? I.e. use plain old equals? Maybe I should assume you haven't read the th

Re: [GENERAL] Bitmask trickiness

2010-07-23 Thread Stephen Cook
On 7/23/2010 5:33 AM, Howard Rogers wrote: ...so select * from table where 21205 | 4097 = 21205 would correctly grab that record. So I'm assuming you mean the 'stored value' should be on both sides of the equals test. If so, that would indeed seem to be the ultimate answer to the question (though

[GENERAL] What does # mean in plpgsql?

2010-08-12 Thread Stephen Cook
What does the hash mark (#) mean in plpgsql? I saw it used in the pseudo_encrypt function @ http://wiki.postgresql.org/wiki/Pseudo_encrypt, on the line: r2 := l1 # 1366.0 * r1 + 150889) % 714025) / 714025.0) * 32767)::int; My google-fu has failed me on this one, and I needs to know. Than

Re: [GENERAL] What does # mean in plpgsql?

2010-08-12 Thread Stephen Cook
On 8/12/2010 10:56 AM, Pavel Stehule wrote: so this means a xor operation 2010/8/12 Stephen Cook: What does the hash mark (#) mean in plpgsql? I saw it used in the pseudo_encrypt function @ http://wiki.postgresql.org/wiki/Pseudo_encrypt, on the line: r2 := l1 # 1366.0 * r1 + 150889

Re: [GENERAL] PostgreSQL Write Performance

2010-01-05 Thread Stephen Cook
those tables into the real ones, which would check constraints and such but as a set. I've done it that way in SQL Server before, but I'm much less experienced with PostgreSQL. -- Stephen Cook -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Stephen Cook
You should use pg_query_params() rather than build a SQL statement in your code, to prevent SQL injection attacks. Also, if you are going to read this data back out and show it on a web page you probably should make sure there is no rogue HTML or JavaScript or anything in there with htmlentitie

Re: [GENERAL] text column constraint, newbie question

2009-03-25 Thread Stephen Cook
Daniel Verite wrote: Note that htmlentities() expects LATIN1-encoded strings and is thus unusable on UTF-8 contents. So if you end up talking UTF-8 with the database, you'll probably need to use htmlspecialchars() instead, and UTF-8 as your HTML charset. I believe you are wrong, at least the