[GENERAL] typmod for custom type

2014-02-16 Thread James Harper
I have created a custom type called my_numeric, which is roughly the same as the existing numeric type. I have declared in, out, typmod_in, and typmod_out functions. I create a table like: CREATE TABLE test (col1 my_numeric(6, 3)); And then do \d test and can see that col1 is declared as (6, 3)

[GENERAL] Toast and slice of toast

2014-02-16 Thread Rémi Cura
Hey Dear List, could somebody point me to some ressources about getting only parts of toasted data? I have a very big custom type and I would like to take blocks of it (like byte A to B then byte C to D then... ). I found a function in http://doxygen.postgresql.org/tuptoaster_8c.html#called toas

Re: [GENERAL] Restore postgresql data directory to tablespace on new host? Or swap tablespaces?

2014-02-16 Thread Francisco Olarte
Hi Jason: On Sat, Feb 15, 2014 at 10:55 PM, Antman, Jason (CMG-Atlanta) wrote: > The short answer is... due to too much technical debt, and some perhaps > bad decisions made in the past... yeah. We've dug ourselves into this > hole, and there's no feasible way out. The more I read about your pro

Re: [GENERAL] Restore postgresql data directory to tablespace on new host? Or swap tablespaces?

2014-02-16 Thread Francisco Olarte
Hi Jason: On Sat, Feb 15, 2014 at 11:17 PM, Antman, Jason (CMG-Atlanta) wrote: > the best we'll be able to do is try to run multiple postgres instances > on each host, and manage the whole "service postgresql-9.0-24 stop" > craziness that comes with that... Just a sugestion, I would not try to i

Re: [GENERAL] Restore postgresql data directory to tablespace on new host? Or swap tablespaces?

2014-02-16 Thread Francisco Olarte
Hi: On Sun, Feb 16, 2014 at 1:02 AM, Antman, Jason (CMG-Atlanta) wrote: > ones to expire out of cache. I.e. we have hardware with 192G of RAM. If > each database is only queried, say, for 10 seconds out of each 5 minute > interval, how do we maximize resource utilization / squeeze as many DBs >

Re: [GENERAL] Restore postgresql data directory to tablespace on new host? Or swap tablespaces?

2014-02-16 Thread Francisco Olarte
Hi Jason: On Sun, Feb 16, 2014 at 1:30 AM, Antman, Jason (CMG-Atlanta) wrote: > I think I jumped on this without really understanding what you were > saying, or the implications of it. If I run N postgres server instances > on the same physical host, I can do away with the overhead of running > e

Re: [GENERAL] typmod for custom type

2014-02-16 Thread Adrian Klaver
On 02/16/2014 12:12 AM, James Harper wrote: I have created a custom type called my_numeric, which is roughly the same as the existing numeric type. I have declared in, out, typmod_in, and typmod_out functions. I create a table like: CREATE TABLE test (col1 my_numeric(6, 3)); And then do \d te

Re: [GENERAL] typmod for custom type

2014-02-16 Thread Tom Lane
James Harper writes: > I have created a custom type called my_numeric, which is roughly the same as > the existing numeric type. I have declared in, out, typmod_in, and typmod_out > functions. I create a table like: > CREATE TABLE test (col1 my_numeric(6, 3)); > And then do \d test and can see

[GENERAL] Using pg_trigger.tgqual

2014-02-16 Thread Ondřej Bouda
Hello, I was interested in reading pg_trigger.tgqual from the system catalogs to get a trigger WHEN expression. E.g., for CREATE TRIGGER tr_example BEFORE UPDATE ON example FOR EACH ROW WHEN (NEW.num > 5) EXECUTE PROCEDURE tr_example_fn(); I would love to receive t

[GENERAL] Using pg_trigger.tgqual

2014-02-16 Thread Ondřej Bouda
Hello, I was interested in reading pg_trigger.tgqual from the system catalogs to get a trigger WHEN expression. E.g., for CREATE TRIGGER tr_example BEFORE UPDATE ON example FOR EACH ROW WHEN (NEW.num > 5) EXECUTE PROCEDURE tr_example_fn(); I would love to receive t

Re: [GENERAL] Toast and slice of toast

2014-02-16 Thread Haribabu Kommi
On Sun, Feb 16, 2014 at 9:38 PM, Rémi Cura wrote: > Hey Dear List, > could somebody point me to some ressources about getting only parts of > toasted data? > > I have a very big custom type and I would like to take blocks of it (like > byte A to B then byte C to D then... ). > > I found a functi

[GENERAL] avoiding file system caching of a table

2014-02-16 Thread Gabriel Sánchez Martínez
Is there a way of asking PostgreSQL to read the files of a table directly off the disk, asking the OS not to use the file cache? I am running PostgreSQL 9.1 on Ubuntu Server 64-bit. The server in question has the maximum amount of RAM it supports, but the database has grown much larger. Most