Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-22 Thread Melvin Davidson
On Fri, Apr 22, 2016 at 12:49 PM, Shulgin, Oleksandr < oleksandr.shul...@zalando.de> wrote: > On Thu, Apr 21, 2016 at 6:55 PM, Melvin Davidson <melvin6...@gmail.com> > wrote: > >> And so far, NO ONE has shown any proof that this enhancement could >> p

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-21 Thread Melvin Davidson
On Thu, Apr 21, 2016 at 11:59 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, Apr 21, 2016 at 8:18 AM, Melvin Davidson <melvin6...@gmail.com> > wrote: > >> On Thu, Apr 21, 2016 at 11:08 AM, Adrian Klaver < >> adrian.kla...@aklaver.com&g

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-21 Thread Melvin Davidson
On Thu, Apr 21, 2016 at 11:08 AM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > On 04/21/2016 07:53 AM, Melvin Davidson wrote: > > >> "Whether that is worthy or not is the point of your request and really >> depends on more input." >> Correct.

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-21 Thread Melvin Davidson
On Thu, Apr 21, 2016 at 10:44 AM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > On 04/21/2016 07:30 AM, Melvin Davidson wrote: > >> >> >> > >> >> "Just one example of why that assertion does not hold:" >> >> I fail to see

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-21 Thread Melvin Davidson
On Thu, Apr 21, 2016 at 10:08 AM, Karsten Hilbert <karsten.hilb...@gmx.net> wrote: > On Thu, Apr 21, 2016 at 09:40:18AM -0400, Melvin Davidson wrote: > > > "and what about user objects added to a database which is > > then used as a template for creating another

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-21 Thread Melvin Davidson
down rogue objects created by developers and users and at the same time add the same functionality as already is in Oracle and SQL Server. What would be your solution? *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-21 Thread Melvin Davidson
works fine for the single database situation, but when you have hundreds of servers and databases to monitor (as I did), it makes the implementation a bit more daunting. Whereas having relcreatedat would mean "no muss, no fuss". :) -- *Melvin Davidson* I reserve the right to fantasize. Whe

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-21 Thread Melvin Davidson
On Thu, Apr 21, 2016 at 3:11 AM, Karsten Hilbert <karsten.hilb...@gmx.net> wrote: > On Wed, Apr 20, 2016 at 07:09:24PM -0400, Melvin Davidson wrote: > > > There is also the situation of tables with limitited use. EG: > > history_mm, in which case it would facil

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-20 Thread Melvin Davidson
On Wed, Apr 20, 2016 at 8:01 PM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > On 04/20/2016 04:33 PM, Melvin Davidson wrote: > >> >> >> > >> >> "Not until pg_upgrade is done or replication is started, in either case >> a new cluster i

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-20 Thread Melvin Davidson
On Wed, Apr 20, 2016 at 7:22 PM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > On 04/20/2016 04:09 PM, Melvin Davidson wrote: > >> >> On Wed, Apr 20, 2016 at 6:17 PM, Kevin Grittner <kgri...@gmail.com >> <mailto:kgri...@gmail.com>> wrote: >>

Re: [GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-20 Thread Melvin Davidson
On Wed, Apr 20, 2016 at 5:14 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Apr 20, 2016 at 1:50 PM, melvin6925 <melvin6...@gmail.com> wrote: > >> On Wed, Apr 20, 2016 at 12:59 PM, Melvin Davidson <melvin6...@gmail.com> >> wrote: >

[GENERAL] Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

2016-04-20 Thread Melvin Davidson
reated > current_timestamp - INTERVAL ' 1 year';There are those whom have argued that this would create a problem with table restore from pg_dump, but it does not. Simply make it an attribute of CREATE TABLE. The only requirement would be to insure that the date cannot be a future date.* -- *Melvin Da

Re: [GENERAL] Enhancement Request

2016-04-19 Thread Melvin Davidson
ents and enable us to pull metrics directly via > simple SQL. > > If anyone can provide insight on how I could accomplish these in a simple > manner by other means then I'm all ears! > > Thanks, > Rob > Rob, Enhancement or feature requests should probably go to *Custormer Feedback <https://postgresql.uservoice.com/forums/21853-general>* https://postgresql.uservoice.com/forums/21853-general -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Enhancement request for pg_dump

2016-04-17 Thread Melvin Davidson
t; the determined order of the statements, >> > > > but it CAN do it with the minor changes, and be more useful to >> administrators. Why rely on the third party tools >> > > > for the tasks that can be done with the native, trusted tools? >> > > > &g

Re: [GENERAL] $foo $bar is BAD

2016-04-15 Thread Melvin Davidson
McKown <john.archie.mck...@gmail.com> wrote: > On Fri, Apr 15, 2016 at 6:35 PM, Melvin Davidson <melvin6...@gmail.com> > wrote: > >> >> >> *Although people commonly use $foo $bar in examples, it is actually a >> misuse of a VERY rude acronym.Anyone tha

[GENERAL] $foo $bar is BAD

2016-04-15 Thread Melvin Davidson
g a little more original (or meaningful) with your variable names.* -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] recover from this error

2016-04-08 Thread Melvin Davidson
ELSE 'Unknown' END FROM pg_class WHERE relfilenode = 35954; Make sure you have a good backup then: 2. DROP the bad object. 3. RESTORE the object. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] What does Rows Counted mean

2016-04-05 Thread Melvin Davidson
On Tue, Apr 5, 2016 at 1:37 PM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > On 04/05/2016 10:10 AM, Melvin Davidson wrote: > >> >> >> > >> FYI, in PgAdmin, there is an Option which determines if a _physical row >> count_ should be perfor

Re: [GENERAL] What does Rows Counted mean

2016-04-05 Thread Melvin Davidson
an and > > the Bitmap Heap Scan, due to the above taking place in an open > transaction > > where the 117 'deleted' rows are still in play until I either commit or > > rollback. > > > > > > Unless the table is getting absolutely no activity a row count is going > to > > be tied to a point in time. > > > >> > >> thanks > >> > >> > > > > > > -- > > Adrian Klaver > > adrian.kla...@aklaver.com > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > FYI, in PgAdmin, there is an Option which determines if a _physical row count_ should be performed if the _estimated_ row count is less than a specified amount. It defaults to 2000. To change it, Click on File, Options and under Browser click Properties. There you can change the default. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Is it possible to delete a single value from an enum type?

2016-03-31 Thread Melvin Davidson
On Thu, Mar 31, 2016 at 10:25 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Melvin Davidson <melvin6...@gmail.com> writes: > > On Thu, Mar 31, 2016 at 9:24 AM, Nik Mitev <n...@mitev.eu> wrote: > >>> In summary, I am looking for the opposite functionality

Re: [GENERAL] Is it possible to delete a single value from an enum type?

2016-03-31 Thread Melvin Davidson
mtypid = t.oid WHERE t.typtype = 'e' AND e.enumlabel = '' ORDER BY 1, enumsortorder; Then, you can either do: DELETE FROM pg_enum WHERE enumtypid = {enumtypid_from_above} AND enumsortorder = {enumsortorder_from_above}; OR DELETE FROM pg_enum WHERE enumtypid = {enumtypid_from_above} AND enumlabel = ''; That being said "ENUMS are EVIL"! As others have said, it is much better to just just Foriegn Keys for value integrity. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Plpsql connecting to more than one database?

2016-03-30 Thread Melvin Davidson
eferences Oracle's language. It is called pl/SQL there. > Neither one has "plpsql". > > David J. > > Have you looked at the dblink extension? That certainly give you the possibility to connect to more than one db. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] More correlated (?) index woes

2016-03-29 Thread Melvin Davidson
> > I might just set enable_seqscan to false and leave it at that. It makes me > unhappy though. > > Geoff > > > ​ > >I might just set enable_seqscan to false Geoff, that has worked for me in the past. It forces the use of index if available, but if there is no suitable index, it

Re: [GENERAL] View deleted records in a table

2016-03-26 Thread Melvin Davidson
-- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > >I want to view deleted records in table from a week ago i The accepted method for handling deleted (or updated) recor

Re: [GENERAL] Way to get at parsed trigger 'WHEN' clause expression?

2016-03-25 Thread Melvin Davidson
On Thu, Mar 24, 2016 at 6:58 PM, Melvin Davidson <melvin6...@gmail.com> wrote: > > > On Thu, Mar 24, 2016 at 4:05 PM, James Robinson <jlrob...@socialserve.com> > wrote: > >> Folks, >> >> I see that psql's \d displays trigg

Re: [GENERAL] Partitioning and ORM tools

2016-03-22 Thread Melvin Davidson
> http://www.postgresql.org/mailpref/pgsql-general > I highly suspect this is a problem with trigger function design, constraint conflict or a bad insert statement, but since no details have been provided, it cannot be resolved. IOW, all they said was "It don't work", but they have not provided proof. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Partitioning and ORM tools

2016-03-22 Thread Melvin Davidson
nserted in the parent table when >configured as per the example in the docs. Yes, you have declared a problem, but without providing actual detailed information (as previously requested), there is no way we can duplicate your problem to debug it and provide a solution. To the best of my knowledge, t

Re: [GENERAL] Partitioning and ORM tools

2016-03-22 Thread Melvin Davidson
> > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] vacuum - reclaiming disk space.

2016-03-19 Thread Melvin Davidson
c ON (c.oid = i.relid) JOIN pg_namespace n ON (n.oid = c.relnamespace) JOIN pg_index idx ON (idx.indexrelid = i.indexrelid ) WHERE i.idx_scan = 0 AND NOT idx.indisprimary AND NOT idx.indisunique ORDER BY 1, 2, 3; Then drop any index that shows up! -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Partition

2016-03-19 Thread Melvin Davidson
e >= '2015-01-01' AND NEW.date_time <= '2015-12-31'THEN INSERT INTO log2(idlog, date_time, log) VALUES ( NEW.idlog, NEW.date_time, NEW.log ); ELSE INSERT INTO log3(idlog, date_time, log) VALUES ( NEW.idlog, NEW.date_time, NEW.log ); END I

Re: [GENERAL] Schema Size - PostgreSQL 9.2

2016-03-19 Thread Melvin Davidson
relname NOT LIKE 'sql_%' AND relkind IN ('r') GROUP BY 1 ORDER BY 3 DESC, 1, 2; -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Drop only temporary table

2016-03-19 Thread Melvin Davidson
e closing (= > > dropping of temporary table). > > How to I force "drop only temporary"? Prefix, option, etc. > > > > Thanks for your help! > > > > dd > > > > -- > Best regards, > Aleksander Alekseev > http://eax.me/ > > > -

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread Melvin Davidson
op immediately. In interactive mode, psql will return to the command prompt; otherwise, psql will exit, returning error code 3 to distinguish this case from fatal error conditions, which are reported using error code 1. In either case, any currently running scripts (the top-level script, if any, and any other scripts which it may have in invoked) will be terminated immediately. If the top-level command string contained multiple SQL commands, processing will stop with the current command. " So just SET ON_ERROR_STOP = ON before any other statements -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] enum bug

2016-03-14 Thread Melvin Davidson
typid = t.oid WHERE t.typtype = 'e' AND t.typname = {the enum name} ORDER BY 1, enumsortorder; However, IMHO, enums are archaic and Foreign Keys (Parent/Child) is the better way to go. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] enum bug

2016-03-13 Thread Melvin Davidson
Herrera <alvhe...@2ndquadrant.com> wrote: > Melvin Davidson wrote: > > > Enums are evil! > > http://www.lornajane.net/posts/2010/is-enum-evil > > ??? > > This post is about MySQL's enums, which aren't really related to > Postgres enums: > > &quo

Re: [GENERAL] Distributed Table Partitioning

2016-03-13 Thread Melvin Davidson
. Ramé <l.r...@griensu.com> wrote: > El 13/03/16 a las 10:04, Peter J. Holzer escribió: > >> On 2016-03-12 21:19:11 -0500, Melvin Davidson wrote: >> >>> - Original Message - >>> From: "Leonardo M. Ramé" <l.r...@griens

Re: [GENERAL] Distributed Table Partitioning

2016-03-12 Thread Melvin Davidson
t_data() if timestamp > {specified time} insert into child1 else insert into child2 endif On Sat, Mar 12, 2016 at 9:19 PM, Melvin Davidson <melvin6...@gmail.com> wrote: > > > On Sat, Mar 12, 2016 at 8:33 PM, Alvaro Aguayo Garcia-Rada < >

Re: [GENERAL] Distributed Table Partitioning

2016-03-12 Thread Melvin Davidson
d tg function to handle inserts eg: {note: below is psuedo code} child {master} (SSD) NO ROWS33 child1 (SSD) CONSTRAINT timestamp > {specified time} tg_insert_child1 on insert execute tgf_split_data child2 (SATA) CONSTRAINT timestamp <= {specified time} tg_insert_chil

Re: [GENERAL] Q: extract database name from directory dump

2016-03-12 Thread Melvin Davidson
k' is in fact the name of the database. But I doubt > the format of this toc.dat file is guaranteed to be immutable > > > > -- > john r pierce, recycling bits in santa cruz > > > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to

Re: [GENERAL] Q: extract database name from directory dump

2016-03-12 Thread Melvin Davidson
hmmm, let's see. You haven't specified PostgreSQL version or O/S as is common sense and courtesy, so I will choose one for you. You are using PostgreSQL version 8.4 on Ubuntu 14.04 Since pg_dump requires an output file, and the database you are dumping must be known, just just the db name in the

Re: [GENERAL] enum bug

2016-03-11 Thread Melvin Davidson
gresql.org/mailpref/pgsql-general > Enums are evil! http://www.lornajane.net/posts/2010/is-enum-evil enums are from before there were foreign keys You are better off just making a foreign key contraint. Things will be a lot simpler. eg: CREATE TABLE rainbow_colors ( valid_color varchar(15),

Re: [GENERAL] pg_restore without dropping db/table

2016-03-10 Thread Melvin Davidson
2PM -0500, Melvin Davidson wrote: > > > The best way to accomplish what you want is to create a table with the > same > > structure in the first database as the one you want to restore to. Then > you > > can truncate that table, restore the data from the other db into it,

Re: [GENERAL] pg_restore without dropping db/table

2016-03-10 Thread Melvin Davidson
psql -d first_db -c truncate dup_table 5. edit your_dump.dmp and change all occurrences of orig_table to dup_table. 6. pg_restore -a -d first_db -t dup_table your_dump.dmp 7. psql -d first_db 8. INSERT INTO orig_table SELECT * FROM dup_table WHERE dup.prime_key NOT IN (SELECT prime_key FROM orig_table); -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Exclude pg_largeobject form pg_dump

2016-03-08 Thread Melvin Davidson
gt; > > Probably you need to redesign the schema. Move the blobs to a new/separate child table. Then you can exclude them. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] pg_restore man page question

2016-03-07 Thread Melvin Davidson
items consist of definitions of indexes, triggers, > rules and constraints other than validated check constraints. Pre-data > items consist of all other data definition items. > > >> Karsten >> >> > > -- > Adrian Klaver > adrian.kla...@aklaver.com > > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] query reboot pgsql 9.5.1

2016-03-04 Thread Melvin Davidson
rent >> versions I do not see an issue. The question to ask here is whether the >> above are actually from the different Postgres instances? >> >> > yes these are differents > >> >> >>> >> So is each Postgres instance running in a separate contai

Re: [GENERAL] String literal doesn't autocast to text type

2016-03-04 Thread Melvin Davidson
o world > (1 row) > > But why we don't have this type cast by default in Postgres? Is there any > fundamental restriction on that or there is some reasons for that? > > > -- > Alex Ignatov > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > &g

Re: [GENERAL] PostgreSQL flavors

2016-02-23 Thread Melvin Davidson
sions of PostgreSQL by EnterpriseDB.com, However, there is a maintenance fee for the EDB Advanced Server. PostgreSQL Plus is a Cloud based version of PostgreSQL, and I believe there is also a fee involved for that too. Your best path is to evaluate how much memory and storage is currently used

Re: [GENERAL] Get the date of creation of objects in the database

2016-02-22 Thread Melvin Davidson
ill be added in a future version. See the link below. Add relcreated to pg_class catalog <https://postgresql.uservoice.com/forums/21853-general/suggestions/5587129-add-relcreated-timestamp-column-to-pg-class-cata> -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Read-only tables to avoid row visibility check

2016-02-22 Thread Melvin Davidson
ere > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Multiple databases and shared_buffers

2016-02-18 Thread Melvin Davidson
other ways > of achieving it (like killing all sessions and revoking grant priv), but > if there is an easier > way to knock out a db temporarily, it will be great. > > -Original Message- > From: Melvin Davidson <melvin6...@gmail.com> > To: Rakesh Kumar <dcrunch.

Re: [GENERAL] Multiple databases and shared_buffers

2016-02-18 Thread Melvin Davidson
databases. PostgreSQL just uses it to make queries more efficient. There is no security problem because users in one database cannot request buffer information about another. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Multiple databases and shared_buffers

2016-02-18 Thread Melvin Davidson
pools for each db independently. > That's why I brought this up. Personally I don't think this is a serious > limitation at all. > > > > > -----Original Message- > From: Melvin Davidson <melvin6...@gmail.com> > To: pgsql-general <pgsql-general@postgresql.org>

Re: [GENERAL] Multiple databases and shared_buffers

2016-02-17 Thread Melvin Davidson
run multiple instances if you feel you need that level > of control over shared_buffers. > > > -- > john r pierce, recycling bits in santa cruz > > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Proper use of Groups and Users (Roles).

2016-02-16 Thread Melvin Davidson
t;vv.li...@wanadoo.fr> wrote: > On Mon, 15 Feb 2016 12:06:28 -0500 > Melvin Davidson <melvin6...@gmail.com> wrote: > > > I wrote a short article to explain the proper use of Group and Userss in > the database. > > Hi Melvin, > > Thanks for the explanatio

Re: [GENERAL] Postgresql Server Upgarde

2016-02-15 Thread Melvin Davidson
e to have a valid pg_dump/backup before proceeding with pg_upgrade. pg_upgrade is faster than a reload, but in the event of unexplained problems, a backup is always good to have as a last resort. Also, practice upgrading in a development environment before attempting to do so in production. -- *Melvin Da

[GENERAL] Proper use of Groups and Users (Roles).

2016-02-15 Thread Melvin Davidson
this was not implemented properly. Since I am not found of Wiki's, I've attached it here for sharing. -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you. Clarifying the use of Groups and Roles, First, a little backgrond history

Re: [GENERAL] Optimize Query

2016-02-10 Thread Melvin Davidson
e_id=bill_item.invoice_id LEFT JOIN dm.billables AS billable ON billable.billable_id=note.billable_id LEFT JOIN dm.labors AS labs ON labs.billable_id = billable.billable_id JOIN ja_mobiusers AS "user" ON "user".id = note.mobiuserid JOIN ja_status AS status ON status.id = job.status_label_id JOIN ja_role AS ROLE ON ROLE.id="user".user_type WHERE note.note_type::text = ANY (ARRAY[ ('time'::CHARACTER VARYING)::text, ('part'::CHARACTER VARYING)::text ]) AND bill_item.for_invoicing = TRUE GROUP BY customer ORDER BY revenue DESC; -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] four template0 databases after vacuum

2016-02-07 Thread Melvin Davidson
orrupt. SELECT n.nspname as schema, i.relname as table, i.indexrelname as index, i.idx_scan, i.idx_tup_read, i.idx_tup_fetch, CASE WHEN idx.indisprimary THEN 'pkey' WHEN idx.indisunique THEN 'uidx' ELSE 'i

Re: [GENERAL] Is it possible to select index values ?

2016-02-02 Thread Melvin Davidson
Have you given any thought to pulling index column stats from the pg_stats view? -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] strange sql behavior

2016-02-02 Thread Melvin Davidson
quot;Execution time: 3779.368 ms" > > > For large table. > "Index Scan using data2011_01_ixtime on data2011_01 (cost=0.57..78012.46 > rows=110204 width=55) (actual time=43.765..709.985 rows=104617 loops=1)" > " Index Cond: (("time" >= '2011-0

Re: [GENERAL] strange sql behavior

2016-02-01 Thread Melvin Davidson
;time"" > " Sort Method: quicksort Memory: 7753kB" > " Buffers: shared hit=2 read=7543" > " -> Bitmap Heap Scan on data2011_01 (cost=1520.29..246672.53 > rows=65512 width=55) (actual time=36.935..5017.463 rows=44204 loops=1)" > " Rec

Re: [GENERAL] strange sql behavior

2016-02-01 Thread Melvin Davidson
>>> I copied the result from PGAdmin directly, here it is again.: >>> >>> public;"data2011_01";784236864;784236885;0;0;"";"";"";"2016-01-19 >>> 17:31:08-06";156847423 >>> public;"data2013_01w";300786432;300786

Re: [GENERAL] PL/pgSQL debugger

2016-01-29 Thread Melvin Davidson
gAdminIII > > The necessary extension can 8 years old - it implements communication > between client and server side code and this is long time without change > > http://www.pgadmin.org/docs/1.8/debugger.html > > Regards > > Pavel > > >> Thanks, >> >> Dane >> > > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

[GENERAL] BRIN indexes

2016-01-28 Thread Melvin Davidson
ed in the documentation, instead of implied? -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] BRIN indexes

2016-01-28 Thread Melvin Davidson
mutually non-adjacent pages. Therefore, it actually would be good to state that in the documentation, even it were just a comment. On Thu, Jan 28, 2016 at 12:31 PM, David Rowley <david.row...@2ndquadrant.com > wrote: > On 29 January 2016 at 06:10, Melvin Davidson <melvin6...@gmai

Re: [GENERAL] A motion

2016-01-25 Thread Melvin Davidson
respite from the details... I'll deal with the noise... by > skipping it. Adrian - a contributor.. apparently by leaving (at least > temporarily). > > Roxanne > (Returning to stealth mode...) > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] 9.5 new features

2016-01-23 Thread Melvin Davidson
pgsql-general mailing list (pgsql-general@postgresql.org) To > make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Let's Do the CoC Right

2016-01-23 Thread Melvin Davidson
unt of protection we need. > > SteveT > > Steve Litt > January 2016 featured book: Twenty Eight Tales of Troubleshooting > http://www.troubleshooters.com/28 > > > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] How to stop autovacuum for daily partition old tables

2016-01-20 Thread Melvin Davidson
wrote: > But, will it not create transaction wraparound for those table? > > Thanks. > > On Wed, Jan 20, 2016 at 4:44 PM, Melvin Davidson <melvin6...@gmail.com> > wrote: > >> >> ALTER TABLE your_schema.your_table SET (autovacuum_enabled = false, >> toast.autovacuu

Re: [GENERAL] How to stop autovacuum for daily partition old tables

2016-01-20 Thread Melvin Davidson
of data. > Often I experience that autovacuum process is busy with old tables where > there is no change. How can I stop it? > Please advice. > > Thanks. > > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Error in Update and Set statement

2016-01-20 Thread Melvin Davidson
eleat...@gmail.com>: > >> Boss !! >> >> I am using postgres 9.4, so how to handle this. >> >> > I don't know Ora2Pg - try to find some option to generate in old format - > or manually rewrite to supported syntax > > UPDATE tab SET a = x.a, ... FROM x >

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Melvin Davidson
Joseph Krogh* > CTO / Partner - Visena AS > Mobile: +47 909 56 963 > andr...@visena.com > www.visena.com > <https://www.visena.com> > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Melvin Davidson
ast echo "" echo "**TABLESPACES CHANGED**" fyi, revised from http://stackoverflow.com/questions/28244869/creating-a-table-in-single-user-mode-in-postgres On Sun, Jan 10, 2016 at 10:01 AM, Andreas Joseph Krogh <andr...@visena.com> wrote: > På søndag 10. ja

Re: [GENERAL] Schemas, Roles & Search Path

2016-01-09 Thread Melvin Davidson
pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-06 Thread Melvin Davidson
ut converts). Not that I matter, but I would feel a huge blow if I > could no longer tell people to use it. > > Jim > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-06 Thread Melvin Davidson
er, but I would feel a huge blow if I could no > longer tell people to use it. > > Jim > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To > make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

[GENERAL] Submitting to this list

2016-01-06 Thread Melvin Davidson
constantly being added with each new release, so something previously impossible (or done another way) in a previous version, may now be simplified with the implementation of a new function/feature. I encourage additional suggestions as to what should be included when submitting queries to this list

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-05 Thread Melvin Davidson
eral mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Convert 2 foreign key values within the same SELECT

2016-01-04 Thread Melvin Davidson
mple but I can't >> think of a JOIN which will do the trick. >> >> gvim >> >> >> Join to user table twice, once for you once for me? > > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Question -- Session Operations - Feasibility Of Proposed Synchronization Method?

2016-01-03 Thread Melvin Davidson
Block all other access to table sql_table_01. >>| */ >> *sup.2* | >> *LOCK TABLE sql_table_01 IN ACCESS EXCLUSIVE MODE;* | ... >>| ... (change operational state of table sql_table_01 >>| ... >>| ... e.g. *TRUNCATE ONLY TABLE

Re: [GENERAL] Happy New Year

2016-01-01 Thread Melvin Davidson
gt; +1. > -- > Michael > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Melvin Davidson
ms_assign set intro=regexp_replace(intro, '/([^/]*)\" > title=$', '=\1') where intro like '% > https://owncloud.porterchester.edu%' and course=18 and id=55413; > > and the result puts the = in the wrong place (at the end of the whole > string). > > > Any suggestions? > > > Thanks! > > -Chris > > > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread Melvin Davidson
d id=55413; > > and the result puts the = in the wrong place (at the end of the whole > string). > > > Any suggestions? > > > Thanks! > > -Chris > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread Melvin Davidson
, 2015 at 2:42 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Mon, Dec 28, 2015 at 12:25 PM, Melvin Davidson <melvin6...@gmail.com> > wrote: > >> Will this work? >> >> UPDATE your_table >>SET your_column =

Re: [GENERAL] Calling function (table_name, schema_name) within event trigger

2015-12-27 Thread Melvin Davidson
"tg_table_name" does not exist > SQL state: 42703 > Context: PL/pgSQL function insert_history_master() line 3 at SQL statement > > > > > -- > > Susan E Hurst > Principal Consultant > Email: susan.hu...@brookhurstda

Re: [GENERAL] Strange syntax with select

2015-12-25 Thread Melvin Davidson
the below: > > DO > $$ > DECLARE > var_1 integer; > BEGIN > SELECT INTO var_1 sum(cell_per) FROM cell_per; > RAISE NOTICE 'Sum is %', var_1; > END > $$ LANGUAGE plpgsql; > > NOTICE: Sum is 193 > > > > > -- > Adrian Klaver > adri

Re: [GENERAL] Strange syntax with select

2015-12-25 Thread Melvin Davidson
ists > > select sum(vlr_saldo_inicial) as saldo_ini > into v_saldo_ini > from contas; > > > ERROR: relation "v_saldo_ini" already exists > > > I'm using version below PostgreSQL. > > PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (Debian > 4.9.2-10) 4.9.2, 64-bit > > -- > Edson > > > > via pgadmin not accept this syntax. > You have any other way to do? > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Melvin Davidson
at 16hr in >> the postgresql/bin folder >> > > So how are you determining it is running and that it is not doing anything? > > What does the Postgres log for the 9.4 instance show? > > >> >> >> >> >> >> >> >> >> >> -- >> Adrian Klaver >> adrian.kla...@aklaver.com <mailto:adrian.kla...@aklaver.com> >> <mailto:adrian.kla...@aklaver.com >> <mailto:adrian.kla...@aklaver.com>> >> >> >> >> >> -- >> Adrian Klaver >> adrian.kla...@aklaver.com <mailto:adrian.kla...@aklaver.com> >> >> >> > > -- > Adrian Klaver > adrian.kla...@aklaver.com > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Melvin Davidson
Do not stop the active restore. Just run psql from the command shell in the Bitnami binary directory and use -U postgres and -p 5532 flags. On Wed, Dec 23, 2015 at 2:22 PM, Killian Driscoll <killiandrisc...@gmail.com > wrote: > On 23 December 2015 at 20:19, Melvin Davidson <melvin6.

Re: [GENERAL] Shared system resources

2015-12-23 Thread Melvin Davidson
onged to. Obviously there is a known algorithm for satisfying the >> page requests, but the set of free pages includes both code and data >> and depends on the history of system activity. There's no guarantee >> to get anything useful. >> >> I'm not sure any of this really

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Melvin Davidson
rent contents of the restored database?* On Wed, Dec 23, 2015 at 3:06 PM, Killian Driscoll <killiandrisc...@gmail.com > wrote: > On 23 December 2015 at 20:59, Melvin Davidson <melvin6...@gmail.com> > wrote: > >> >OK - I see the logs there - the last log was almost 12 hrs ago,

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Melvin Davidson
.com>> >>> <mailto:adrian.kla...@aklaver.com >>> <mailto:adrian.kla...@aklaver.com> >>> <mailto:adrian.kla...@aklaver.com >>> <mailto:adrian.kla...@aklaver.com>>> >>> >>> >>

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Melvin Davidson
23, 2015 at 2:50 PM, Killian Driscoll <killiandrisc...@gmail.com > wrote: > On 23 December 2015 at 20:38, Melvin Davidson <melvin6...@gmail.com> > wrote: > >> You can rREDIRECT the output to a file! EG: psql -U postgres -p 5532 > >> your_output.txt >> then

Re: [GENERAL] Table with seemingly duplicated primary key values

2015-12-22 Thread Melvin Davidson
first two > queries above), > but this results in an error: > > # update some_table >set field2 = field1 > where >field1 is not null >and field2 is null >and ts between '2015-12-01' and '2015-12-02'; > > ERROR: duplicate key value violates unique

Re: [GENERAL] Table with seemingly duplicated primary key values

2015-12-22 Thread Melvin Davidson
.na...@bluetreble.com> wrote: > On 12/22/15 1:31 PM, Melvin Davidson wrote: > >> The fact that you have rows with an identical id of 2141750 verifies a >> corrupted primary index. >> To correct it, you need to decide which row to keep. >> >> So review the results

Re: [GENERAL] Table with seemingly duplicated primary key values

2015-12-22 Thread Melvin Davidson
The fact that you have rows with an identical id of 2141750 verifies a corrupted primary index. To correct it, you need to decide which row to keep. So review the results of SELECT * FROM some_table WHERE ctid = (79664,59) OR ctid = (79772,23) DELETE FROM some_table WHERE id = 2147150 AND

Re: [GENERAL] Session Identifiers

2015-12-21 Thread Melvin Davidson
backend() would be the only solution. > > Those settings aren't for controlling idle timeout of a connection. > > pg_terminate_backend() will work and could be run out of a cronjob. > > Thanks! > > Stephen > -- *Melvin Davidson* I reserve the right to fantasize. Whether o

Re: [GENERAL] Session Identifiers

2015-12-20 Thread Melvin Davidson
ata related to >>> sessions are stored in shared memory - in array of PGPROC structures. >>> Postgres invalidates these data immediately when process is destroyed. >>> Search PGPROC in our code. Look to postmaster.c, where these operations are >>> described. >>&

Re: [GENERAL] Session Identifiers

2015-12-20 Thread Melvin Davidson
ware such as SSL. > > regards, tom lane > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.

<    1   2   3   4   5   6   7   >