Re: [GENERAL] Using timestamp(tz) in C functions

2016-07-29 Thread Keith Fiske
On Fri, Jul 29, 2016 at 11:49 AM, Vitaly Burovoy wrote: > On 7/29/16, Keith Fiske wrote: > > On Fri, Jul 29, 2016 at 12:53 AM, Vitaly Burovoy < > vitaly.buro...@gmail.com> > > wrote: > > > >> On 7/28/16, Keith Fiske wrote: > >> > Working on tr

Re: [GENERAL] Using timestamp(tz) in C functions

2016-07-29 Thread Keith Fiske
On Fri, Jul 29, 2016 at 12:53 AM, Vitaly Burovoy wrote: > On 7/28/16, Keith Fiske wrote: > > Working on trying to get a C version of the maintenance function for my > > pg_partman extension working so I can hopefully make it more flexible and > > efficient. > > >

Re: [GENERAL] Using timestamp(tz) in C functions

2016-07-28 Thread Keith Fiske
On Thu, Jul 28, 2016 at 5:28 PM, Adrian Klaver wrote: > On 07/28/2016 02:15 PM, Keith Fiske wrote: > >> Working on trying to get a C version of the maintenance function for my >> pg_partman extension working so I can hopefully make it more flexible >> and efficient. >

[GENERAL] Using timestamp(tz) in C functions

2016-07-28 Thread Keith Fiske
ntenance.sql#L139 So, not sure if I'm even going about this the right manner for the way I intend to use the timestamp values. Still fairly new to C and getting use to postgres internals. Any help, or even an example of using timstamp data pulled from a table in C with SPI, would be great

Re: [GENERAL] Postgresql 9.4 and ZFS?

2015-09-30 Thread Keith Fiske
On Wed, Sep 30, 2015 at 4:58 PM, Benjamin Smith wrote: > On Wednesday, September 30, 2015 03:49:44 PM Keith Fiske wrote: > > We've run postgres on ZFS for years with great success (first on > > OpenSolaris, now on OmniOS, and I personally run it on FreeBSD). The > >

Re: [GENERAL] Postgresql 9.4 and ZFS?

2015-09-30 Thread Keith Fiske
different filesystem. Just make a 9.5 directory in the same spot when the time comes around. With ZFS snapshots available, there's really no reason not to use the --link option to greatly speed up upgrades. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] WAL Shipping and streaming replication

2015-09-28 Thread Keith Fiske
ou've encountered bugs with OmniPITR, please feel free to open an issue on Github. If you look at the issue and commit history you can see that we do indeed fix reported issues or respond to help people with problems they are having. https://github.com/omniti-labs/omnipitr -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] Background worker assistance & review

2015-04-21 Thread Keith Fiske
<http://www.keithf4.com> On Tue, Apr 21, 2015 at 5:47 PM, Keith Fiske wrote: > > > > <http://www.keithf4.com> > > On Fri, Apr 10, 2015 at 1:00 PM, Keith Fiske wrote: > >> >> On Thu, Apr 9, 2015 at 11:56 PM, Craig Ringer >> wrote: >>

Re: [GENERAL] Background worker assistance & review

2015-04-21 Thread Keith Fiske
<http://www.keithf4.com> On Fri, Apr 10, 2015 at 1:00 PM, Keith Fiske wrote: > > On Thu, Apr 9, 2015 at 11:56 PM, Craig Ringer > wrote: > >> >> >> On 9 April 2015 at 05:35, Keith Fiske wrote: >> >>> I'm working on a background worke

[GENERAL] Background worker assistance & review

2015-04-08 Thread Keith Fiske
r a better way to do what I've done, I'd appreciate it. All I really have it doing now is calling the run_maintenance() function at a defined interval and don't need it doing more than that yet. https://gist.github.com/keithf4/0047eae0b3a22829d527 -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] 9.3.5 failing to compile with dtrace on FreeBSD 10.1

2015-01-23 Thread Keith Fiske
f the other steps besides the kernel loading are needed for compilation and installation, but could be handy. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com On Mon, Dec 22, 2014 at 2:22 PM, Lacey Powers wrote: > Hello Luca, > > I had some s

[GENERAL] Updating timezone setting

2014-11-10 Thread Keith Fiske
can remember. Would there be any issues then just leaving the columns as "timestamp without time zone"? I know that's not ideal, but that would be a big project to try and convert every single one of those columns. Thanks, -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] Bloat check query

2014-08-26 Thread Keith Fiske
On Tue, Aug 26, 2014 at 5:44 PM, Keith Fiske wrote: > So I recently wrote this script to help us in monitoring for table/index > bloat > > https://github.com/keithf4/pg_bloat_check > > I based my query off of the one contained in check_postgres, since I > thought it seemed

[GENERAL] Bloat check query

2014-08-26 Thread Keith Fiske
which one of these two bloat check queries is more accurate able to provide some assistance? -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] HOT standby with ONLY WAL shipping?

2014-06-17 Thread Keith Fiske
ation or WAL replay. It is determined by setting the parameter "hot_standby" on the slave and ensuring the master has a minimum "wal_level" of "hot_standby" as well. So both streaming and wal replay slaves can be hot standbys. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [HACKERS] [GENERAL] Question about partial functional indexes and the query planner

2014-06-12 Thread Keith Fiske
Scan on partial_functional_index_test (cost=82.67..4805.55 rows=5000 width=0) (actual time=40.704..1282.955 rows=50 loops=1) Recheck Cond: (CASE WHEN ((id % 2) = 1) THEN 0 ELSE id END = id) Heap Blocks: exact=4425 -> Bitmap Index Scan on partial_functional_idx (cost=0.00..81.42 rows=5000 width=0) (actual time=39.657..39.657 rows=50 loops=1) Planning time: 0.127 ms Execution time: 2483.979 ms (7 rows) -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] How can I tell if pg_restore is running?

2014-06-10 Thread Keith Fiske
hen you'd have your triggers check if the advisory lock is held and skip whatever they do if so. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

[GENERAL] Trigger function permissions

2014-06-06 Thread Keith Fiske
the gist link below. You can see the owner has no explicit permissions to the trigger function and inserts still work even after revoking PUBLIC. https://gist.github.com/keithf4/83c5c6516e2726609675 -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] Merge a sharded master into a single read-only slave

2014-06-05 Thread Keith Fiske
changes at fixed time intervals would certainly > help reduce the load. I will have to test and see if a good balance can be > achieved between not having stale data for too long and keeping up with > writes. > > Sébastien > > If you have any questions while evaluating it, feel free to ask or post any issues to github. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] Merge a sharded master into a single read-only slave

2014-06-04 Thread Keith Fiske
et up with an empty parent table pointing to all the child tables that pulled data into them. Yes, it was a lot of setup since each of the 512 tables has to be set up individually. But once it was set up it worked surprisingly well. And it's honestly a use case I had never foreseen fo

Re: [GENERAL] Planning error in dynamic string creation in plpgsql

2014-01-08 Thread Keith Fiske
Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com On Mon, Jan 6, 2014 at 11:33 AM, Keith Fiske wrote: > David, > > That seems to have fixed it! I was going down a path of grabbing the > column's type from pg_attribute and trying to wo

Re: [GENERAL] replicate per tablespace

2014-01-06 Thread Keith Fiske
two, but a little simpler to configure if you just need a few tables replicated. http://bucardo.org/wiki/Bucardo http://slony.info/ https://github.com/omniti-labs/mimeo Hope that helps to answer your questions -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] Planning error in dynamic string creation in plpgsql

2014-01-06 Thread Keith Fiske
David, That seems to have fixed it! I was going down a path of grabbing the column's type from pg_attribute and trying to work from there, but was still having some of the same issues. Thanks everyone else that replied as well! -- Keith Fiske Database Administrator OmniTI Computer Consu

Re: [GENERAL] Planning error in dynamic string creation in plpgsql

2014-01-05 Thread Keith Fiske
That is not an option either. This is for a publicly released extension and I'm really not going to go requiring another scripting language be installed, especially an untrusted one. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com On Sun,

Re: [GENERAL] Planning error in dynamic string creation in plpgsql

2014-01-05 Thread Keith Fiske
I can't remove the quote_literal() because the value could potentially be a string, time, or number. Without the loop, quote_literal() handles the variable being any one of those types without any issues and quotes (or doesn't) as needed. -- Keith Fiske Database Administrator OmniT

Re: [GENERAL] Planning error in dynamic string creation in plpgsql

2014-01-05 Thread Keith Fiske
from partman_test.time_static_table_p2014_01_01; min | max -+- 100 | 99 (1 row) -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com On Sun, Jan 5, 2014 at 11:23 PM, Keith Fiske wrote: > That fixed it! In the example and my original as well. Thank you v

Re: [GENERAL] Planning error in dynamic string creation in plpgsql

2014-01-05 Thread Keith Fiske
with no issue. Any chance you can explain what's going on here? Never would've thought to put the cast there to fix the problem. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com On Sun, Jan 5, 2014 at 11:06 PM, Adrian Klaver wrote: > On 01/

Re: [GENERAL] Planning error in dynamic string creation in plpgsql

2014-01-05 Thread Keith Fiske
Sorry, forgot to include that I've tested this on PostgreSQL versions 9.2.6 and 9.3.2 and same thing happens on both. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com On Sun, Jan 5, 2014 at 9:31 PM, Keith Fiske wrote: > Running into an issu

[GENERAL] Planning error in dynamic string creation in plpgsql

2014-01-05 Thread Keith Fiske
) NOTICE: v_sql: col1 min: , col1 max: NOTICE: v_record: ("2014-01-05 21:25:58.603149","2014-01-06 21:25:58.603149") NOTICE: v_sql: col3 min: , col3 max: testing_record (1 row) In the real function I'm writing, the columns to be used in the string being created are pulled from a configuration table, so their types could be anything. So casting the quote_literal() calls is not really an option here. Any help would be appreciated. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com

Re: [GENERAL] Foreign Key violated

2013-06-04 Thread Keith Fiske
zero signs of corruption or other FKs being violated, we asked the for more information about what had been done recently and they fessed up. So, relief on one hand that there was no data corruption. But a bit troubling that the user did that :p -- Keith Fiske Database Administrator OmniTI Com

[GENERAL] Foreign Key violated

2013-05-23 Thread Keith Fiske
k" DETAIL: Key (rma_id, rma_status)=(1008122437, r) is not present in table "rmas". prod=# rollback; ROLLBACK This is running 9.2.4 on CentOS. If anyone can suggest how I can look into this deeper and find what the problem may be, I'd appreciate it. I'm here at PGCon if anyo

[GENERAL] Issue with extension updates to pg_extension table

2012-07-05 Thread Keith Fiske
ob_check_config 214225038 | job_status_text 214972369 | dblink_mapping (6 rows) I know this isn't really something that would be done often, but it just seemed a rather odd behavior so I thought I'd bring it up in case it's something that can be easily fixed. -- Keith Fiske

Re: [GENERAL] Extension table data

2012-06-11 Thread Keith Fiske
27;re documented now. I think its time to recognize the extension system is more widely usable than it was originally intended. And that's a good thing! We just need to try to find ways to make the existing tools work in a more predictable manner now. -- Keith Fiske Database Administrator OmniT

Re: [GENERAL] Extension table data

2012-06-09 Thread Keith Fiske
is to explicitly name all schemas but the one your extension is in, which I think is another bug you had actually fixed for 9.1.3 where extension data was always being dumped. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. 443.325.1357 x251 On Sat, Jun 9, 2012 at 2:56 AM, Keith

Re: [GENERAL] Extension table data

2012-06-08 Thread Keith Fiske
dumps, perhaps another option to pg_dump is needed, and have the schema-only or data-only options be honored in that case as well. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. 443.325.1357 x251 On Fri, Jun 8, 2012 at 11:38 PM, Tom Lane wrote: > Keith Fiske writes: &

[GENERAL] Extension table data

2012-06-08 Thread Keith Fiske
should work, though? Extension I'm working on: https://github.com/omniti-labs/pg_jobmon Anyone else having this issue or am I doing something wrong? -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. 443.325.1357 x251 -- Sent via pgsql-general mailing list (pgsql-genera

[GENERAL] ALTER DEFAULT PRIVILEGES target_role doesn't work with group roles

2012-02-21 Thread Keith Fiske
ers to reproduce it and see if I'm not asking for something unreasonable. -- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. 443.325.1357 x251 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general