[GENERAL] Shared Constants in PLPGSQL

2017-08-01 Thread Tim Uckun
What's the best way to deal with global constants in PLPGSQL. Currently I am putting them in a function with out parameters and then calling that function from every other function that needs them like this. CREATE OR REPLACE FUNCTION hashids.constants( OUT min_alphabet_length integer,

Re: [GENERAL] Question about loading up a table

2017-08-01 Thread Alex Samad
Hi So just to go over what i have server A (this is the original pgsql server 9.2) Server X and Server Y ... PGSQL 9.6 in a cluster - streaming replication with hot standby. I have 2 tables about 2.5T of diskspace. I want to get the date from A into X and X will replicate into Y. I am

Re: [GENERAL] PGpool question

2017-08-01 Thread Tatsuo Ishii
> This may be the wrong list, but I am not sure where it needs to go. I am > trying to set up pgpool, and I keeping on getting this message: > > NOTICE: add node from hostname:"xxx" port:9000 pgpool_port: > rejected. > Jul 28 22:11:49 xx pgpool[10768]: [172-2] 2017-07-28 22:11:49:

Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions

2017-08-01 Thread Jeff Janes
On Tue, Aug 1, 2017 at 9:24 AM, Dmitry Lazurkin wrote: > On 08/01/2017 07:13 PM, Jeff Janes wrote: > > I think that HashSet is a Java-specific term. It is just a hash table in > which there is no data to store, just the key itself (and probably a cash > of the hashcode of

Re: [GENERAL] Not able to create collation on Windows

2017-08-01 Thread Tom Lane
Murtuza Zabuawala writes: > I am trying to create collation on windows using default POSIX collation > with pgAdmin3 but I am getting error as shown in screenshot, Can someone > suggest how to fix this? > *Syntax:* > CREATE COLLATION public.test from

Re: [HACKERS] [GENERAL] Not able to create collation on Windows

2017-08-01 Thread Peter Eisentraut
On 8/1/17 10:53, Tom Lane wrote: > Murtuza Zabuawala writes: >> I am trying to create collation on windows using default POSIX collation >> with pgAdmin3 but I am getting error as shown in screenshot, Can someone >> suggest how to fix this? > >> *Syntax:* >>

Re: [GENERAL] Shared Constants in PLPGSQL

2017-08-01 Thread bto...@computer.org
- Original Message - > From: "Tim Uckun" > To: "pgsql-general" > Sent: Tuesday, August 1, 2017 5:56:02 AM > Subject: [GENERAL] Shared Constants in PLPGSQL > > What's the best way to deal with global constants in PLPGSQL. Currently I > am

[GENERAL] Logging in Code vs SQL-WHERE was: Row based permissions: at DB or at Application level?

2017-08-01 Thread Thomas Güttler
I have been thinking about this again. Doing perm checking in code (I use Python) has the advantage that you can do logging: def has_perm(item, user): if user.is_superuser: logger.debug('Access to %s for %s allowed, since user is superuser' % (item, user)) return True

Re: [GENERAL] Question about loading up a table

2017-08-01 Thread Scott Marlowe
On Mon, Jul 31, 2017 at 11:16 PM, Alex Samad wrote: > Hi > > I double checked and there is data going over, thought I would correct that. > > But it seems to be very slow. Having said that how do I / what tools do I > use to check through put Try the pg_current_xlog_location

Re: [GENERAL] Shared Constants in PLPGSQL

2017-08-01 Thread Tim Uckun
In my case I don't expect these constants to be changed on a regular basis. They will be set just once and that's it. I was thinking it would be just as easy to set them in a proc as it would be to set them in a table. By putting them in an immutable proc I can hopefully save a couple of compute

Re: [GENERAL] Shared Constants in PLPGSQL

2017-08-01 Thread Merlin Moncure
On Tue, Aug 1, 2017 at 8:04 AM, Merlin Moncure wrote: > re-evaluate. The main advantage over your approach is that you don't > have to modify multiple things every time you add a new config values; > just add a column and replace the function. This can be automated too, via

Re: [GENERAL] Shared Constants in PLPGSQL

2017-08-01 Thread Merlin Moncure
On Tue, Aug 1, 2017 at 4:56 AM, Tim Uckun wrote: > What's the best way to deal with global constants in PLPGSQL. Currently I am > putting them in a function with out parameters and then calling that > function from every other function that needs them like this. > > CREATE OR

Re: [GENERAL] Partitioned TEMP tables

2017-08-01 Thread Ed Behn
I tried that. I didn't seem to help. *Ed Behn */ Staff Engineer / Airline and Network Services Information Management Services 2551 Riva Road, Annapolis, MD 21401 USA Phone: (410)266-4426 / Cell: (240)696-7443 ed.b...@rockwellcollins.com www.rockwellcollins.com On Mon, Jul 31, 2017 at 4:16

Re: [HACKERS] [GENERAL] Not able to create collation on Windows

2017-08-01 Thread Tom Lane
Murtuza Zabuawala writes: > Yes, I was able to create collation using "C" instead of "POSIX" on windows, > CREATE COLLATION public.test from pg_catalog."C"; Yeah, I thought that might happen. So the point basically is that in almost all of the collations

Re: [HACKERS] [GENERAL] Not able to create collation on Windows

2017-08-01 Thread Tom Lane
Peter Eisentraut writes: > On 8/1/17 10:53, Tom Lane wrote: >> I think this is actually a bug, because the collations code clearly >> means to allow clones of the C/POSIX locales --- see eg lc_collate_is_c, > You seem to say that we should support a "POSIX"

Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions

2017-08-01 Thread Dmitry Lazurkin
On 08/01/2017 07:13 PM, Jeff Janes wrote: > I think that HashSet is a Java-specific term. It is just a hash table > in which there is no data to store, just the key itself (and probably > a cash of the hashcode of that key), correct? Yes. And in Java HashSet implemented on top of HashMap (: >

Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions

2017-08-01 Thread Jeff Janes
On Mon, Jul 31, 2017 at 12:29 PM, Dmitry Lazurkin wrote: > On 31.07.2017 19:42, Jeff Janes wrote: > > I think it is simply because no one has gotten around to implementing it > that way. When you can just write it as a values list instead, the > incentive to make the regular

[GENERAL] Problem compiling a C function on Windows - not finding _palloc0@4

2017-08-01 Thread Dan Cooperstock at Software4Nonprofits
I'm trying to compile a C function into a DLL for use in PostgreSQL, with Visual Studio. I'm linking in postgres.lib, but when the linker runs, I'm getting "unresolved external symbol _palloc0@4 referenced in function _getSoundex@4". The code is just calling palloc0. I suspect it's something about

Re: [HACKERS] [GENERAL] Not able to create collation on Windows

2017-08-01 Thread Murtuza Zabuawala
Hi Tom, Yes, I was able to create collation using "C" instead of "POSIX" on windows, CREATE COLLATION public.test from pg_catalog."C"; -- Regards, Murtuza Zabuawala On Tue, Aug 1, 2017 at 9:09 PM, Tom Lane wrote: > Peter Eisentraut

Re: [GENERAL] standby database crash

2017-08-01 Thread Michael Paquier
On Mon, Jul 31, 2017 at 11:15 PM, Seong Son (US) wrote: > So my questions are, could an old WAL segment being resent through the > network cause crash like this? Shouldn’t Postgresql be able to handle out > of order WAL segments instead of just crashing? When the

Re: [GENERAL] Problem compiling a C function on Windows - not finding _palloc0@4

2017-08-01 Thread Dan Cooperstock at Software4Nonprofits
OK, I fixed it by changing to a 64-bit compile, which was necessary anyways because it has to work with a 64-bit install of PostgreSQL. I'm still curious about how I would have fixed that if I needed the 32-bit version though. Dan

Re: [GENERAL] Question about loading up a table

2017-08-01 Thread Alex Samad
Hi I double checked and there is data going over, thought I would correct that. But it seems to be very slow. Having said that how do I / what tools do I use to check through put A On 1 August 2017 at 08:56, Alex Samad wrote: > Hi > > I'm using pg_dump 9.6 to do the

Re: [GENERAL] Shared Constants in PLPGSQL

2017-08-01 Thread Merlin Moncure
On Tue, Aug 1, 2017 at 8:29 AM, Tim Uckun wrote: > In my case I don't expect these constants to be changed on a regular basis. > They will be set just once and that's it. I was thinking it would be just as > easy to set them in a proc as it would be to set them in a table. By