Re: [GENERAL] Is it possible to define a constraint based on the values in other rows in the current table?

2017-07-19 Thread Glen Huang
> On 20 Jul 2017, at 5:26 AM, Hannes Erven wrote: > > Hi Glen, > > >> I'd like to enforce that in a transaction, after a couple inserts & > >> updates, a particular column has continuous values like 1, 2, 3, and > > never any gaps. Is it possible to do?> > I gave a concrete example here: >

Re: [GENERAL] Is it possible to define a constraint based on the values in other rows in the current table?

2017-07-19 Thread vinny
On 2017-07-19 13:37, Glen Huang wrote: Hi, I'd like to enforce that in a transaction, after a couple inserts & updates, a particular column has continuous values like 1, 2, 3, and never any gaps. Is it possible to do? I gave a concrete example here: https://stackoverflow.com/questions/45187113

[GENERAL] Is it possible to define a constraint based on the values in other rows in the current table?

2017-07-19 Thread Glen Huang
Hi, I'd like to enforce that in a transaction, after a couple inserts & updates, a particular column has continuous values like 1, 2, 3, and never any gaps. Is it possible to do? I gave a concrete example here: https://stackoverflow.com/questions/45187113

Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)

2017-01-17 Thread Karsten Hilbert
On Tue, Jan 17, 2017 at 09:25:38AM +0100, Thomas Kellerer wrote: > I recently stumbled over the need to use a wildcard escape character for a > condition that makes use of LIKE ANY, something like: > >select * >from some_table >where name like any (array['foo_bar%', 'bar_foo%']) esca

Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)

2017-01-17 Thread Tom Lane
Thomas Kellerer writes: > So my question is: Is there any way to specify an alternate wildcard escape > when using LIKE ANY (..)? No, not with ESCAPE. [ manfully resists temptation to run down SQL committee's ability to design composable syntax ... oops ] You could do what PG does under the h

[GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)

2017-01-17 Thread Thomas Kellerer
I recently stumbled over the need to use a wildcard escape character for a condition that makes use of LIKE ANY, something like: select * from some_table where name like any (array['foo_bar%', 'bar_foo%']) escape '/'; so that the underscore wouldn't be treated as a wildard (I can't real

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread rob stone
On Thu, 2016-07-21 at 00:12 +, Steve Langlois wrote: > > > On Jul 20, 2016, at 7:48 PM, Steve Langlois > om> wrote: > > > > > you never did answer my previous question, why are you messing > > > about with manually starting postgres from the wrong user > > > account, when it should be run as

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread John R Pierce
On 7/20/2016 5:12 PM, Steve Langlois wrote: Then I try to run psql and [20:01:11 slanglois@tron bin]$ psql psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432”? I would expe

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Steve Langlois
> On Jul 20, 2016, at 8:03 PM, John R Pierce wrote: > > On 7/20/2016 4:48 PM, Steve Langlois wrote: >> I am upgrading an existing system running CentOS 5.6 with Postgres 8.2.5 to >> CentOS 7 with 9.2.15. The original system modified the postgresql script to >> manually running postmaster to st

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Steve Langlois
On Jul 20, 2016, at 7:48 PM, Steve Langlois mailto:steve.langl...@tavve.com>> wrote: you never did answer my previous question, why are you messing about with manually starting postgres from the wrong user account, when it should be run as a system service with systemctl ? I am upgrading an

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread John R Pierce
On 7/20/2016 4:48 PM, Steve Langlois wrote: I am upgrading an existing system running CentOS 5.6 with Postgres 8.2.5 to CentOS 7 with 9.2.15. The original system modified the postgresql script to manually running postmaster to start the database under the current user control. So it is really f

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Steve Langlois
you never did answer my previous question, why are you messing about with manually starting postgres from the wrong user account, when it should be run as a system service with systemctl ? I am upgrading an existing system running CentOS 5.6 with Postgres 8.2.5 to CentOS 7 with 9.2.15. The orig

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Adrian Klaver
On 07/20/2016 10:44 AM, Steve Langlois wrote: Steve Langlois writes: I ran + /usr/bin/initdb --pgdata=/usr/xxx/databases/pgsql/data --auth=ident without issue however when I try to start the database it complains about the lockfile. FATAL: could not create lock file "/var/run/postgresql/.s.P

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread John R Pierce
On 7/20/2016 10:44 AM, Steve Langlois wrote: Why is the local connection not working without having to add host ::1/128 to the pg_hba.conf file. I thought specifying local all all trust would allow any local connection. local != localhost... on your system localhost is resolving to the ipv6

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Steve Langlois
Steve Langlois writes: > I ran > + /usr/bin/initdb --pgdata=/usr/xxx/databases/pgsql/data --auth=ident > without issue however when I try to start the database it complains about the > lockfile. > FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": > Permission denied

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-19 Thread John R Pierce
On 7/19/2016 3:35 PM, Steve Langlois wrote: >Presumably, you are working with a distro-modified version of Postgres, >because the stock sources don't use /var/run/postgresql as a socket >directory. You will likely find that your version of libpq.so also >expects /var/run/postgresql as the sock

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-19 Thread Steve Langlois
>Presumably, you are working with a distro-modified version of Postgres, >because the stock sources don't use /var/run/postgresql as a socket >directory. You will likely find that your version of libpq.so also >expects /var/run/postgresql as the socket directory, so you won't be >able to make non

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-19 Thread Tom Lane
Steve Langlois writes: > I ran > + /usr/bin/initdb --pgdata=/usr/xxx/databases/pgsql/data --auth=ident > without issue however when I try to start the database it complains about the > lockfile. > FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": > Permission denied T

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-19 Thread Adrian Klaver
On 07/19/2016 02:49 PM, Steve Langlois wrote: Using Postgres 9.2 with CentOS7. I ran + /usr/bin/initdb --pgdata=/usr/xxx/databases/pgsql/data --auth=ident without issue however when I try to start the database it complains about the lockfile. FATAL: could not create lock file "/var/run/pos

[GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-19 Thread Steve Langlois
Using Postgres 9.2 with CentOS7. I ran + /usr/bin/initdb --pgdata=/usr/xxx/databases/pgsql/data --auth=ident without issue however when I try to start the database it complains about the lockfile. FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied

Re: [GENERAL] Is it possible to use an EVENT TRIGGER to validate a TRIGGER?

2016-07-06 Thread Luís Eduardo Oliveira Lizardo
Hi Álvaro, thanks for your reaponse. Can you please give me a small example showing how to do this, or more hints? Thanks in advance, Luis Lizardo On Jul 6, 2016 00:02, "Alvaro Herrera" wrote: > Luís Eduardo Oliveira Lizardo wrote: > > Hi, > > > > Is it possible to use an EVENT TRIGGER to vali

Re: [GENERAL] Is it possible to use an EVENT TRIGGER to validate a TRIGGER?

2016-07-05 Thread Alvaro Herrera
Luís Eduardo Oliveira Lizardo wrote: > Hi, > > Is it possible to use an EVENT TRIGGER to validate a TRIGGER definition? > > What I want is to guarantee that the trigger is fired AFTER a STATEMENT, on > INSERT or UPDATE but not on DELETE, like the following example: What you can do with a C langu

[GENERAL] Is it possible to use an EVENT TRIGGER to validate a TRIGGER?

2016-07-05 Thread Luís Eduardo Oliveira Lizardo
Hi, Is it possible to use an EVENT TRIGGER to validate a TRIGGER definition? What I want is to guarantee that the trigger is fired AFTER a STATEMENT, on INSERT or UPDATE but not on DELETE, like the following example: CREATE TRIGGER mytrigger AFTER INSERT OR UPDATE ON mytable FOR EACH STAT

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Karsten Hilbert
On Sun, Apr 24, 2016 at 05:07:10PM +0100, Tomas J Stehlik wrote: >> Have you even tried a schema only dump from the original instance? > > That's an odd question. However, I understand that maybe a lot of beginners > come onto this mailing list. :-) > You can safely assume that I wrote the orig

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Adrian, > Then I am of no further use to this conversation. No problem at all. Thank you for your well considered input and ideas. Have a lovely day. Kindest regards, Tomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: ht

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Adrian Klaver
On 04/24/2016 09:07 AM, Tomas J Stehlik wrote: Hello Andrian, Thank you Have you even tried a schema only dump from the original instance? That's an odd question. However, I understand that maybe a lot of beginners come onto this mailing list. To the contrary, this is a non-trivial situatio

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Karsten, > In that case I must surely have missed it and feel I > can no longer be of any assistance, even if it only > amounted to but contributing leads to be investigated. > Sorry. No problem at all. I very much appreciate all your input and ideas. Thank you. Kindest regards, Toma

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Karsten, Thank you. > Like replacing (some of) the pg_* containing raw files with > those from an uncorrupted database (having been suggested > earlier this year) which may work if the corrupted blocks in > pg_* only affect data actually describing _that_ database > rather than establis

[GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread David G. Johnston
On Sunday, April 24, 2016, Karsten Hilbert > wrote: > On Sun, Apr 24, 2016 at 04:35:56PM +0100, Tomas J Stehlik wrote: > > >> Well if the corrupted raw files include the system information > >> then I think you are out of luck. > > > > Well, this topic is not about "luck". > > Surely, English isn'

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Karsten Hilbert
On Sun, Apr 24, 2016 at 04:58:48PM +0100, Tomas J Stehlik wrote: >>> The question potentially targets someone who could tell >>> whether something like this is possible. >> >> "possible" depends no the exact circumstances, the details of >> which people have been trying to tease out. > > All th

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Andrian, Thank you > Have you even tried a schema only dump from the original instance? That's an odd question. However, I understand that maybe a lot of beginners come onto this mailing list. To the contrary, this is a non-trivial situation. You can safely assume that I wrote the origin

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Karsten Hilbert
On Sun, Apr 24, 2016 at 04:42:21PM +0100, Tomas J Stehlik wrote: >> If I recall correctly, you stated that the data isn't >> important in this > > Yes, exactly. However, pages in blocks apparently store also the > representations of the database schemas. And those are also corrupt. In that case

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Karsten, Thank you. > I believe Adrian wanted to know whether you attempted a > schema or complete dump *after* the fact, like what he > suggested a mail ago or so. > > In case the FS corruption "only" affects raw files related to > user data (as opposed to also affecting data in pg_*

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Adrian Klaver
On 04/24/2016 08:54 AM, Karsten Hilbert wrote: On Sun, Apr 24, 2016 at 04:35:56PM +0100, Tomas J Stehlik wrote: Well if the corrupted raw files include the system information then I think you are out of luck. Well, this topic is not about "luck". Surely, English isn't my vernacular language

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Adrian Klaver
On 04/24/2016 08:35 AM, Tomas J Stehlik wrote: Hello Adrian, Thank you. So did you do a schema only dump or a complete dump? There is no dump. There are just raw files. Have you even tried a schema only dump from the original instance? Well if the corrupted raw files include the system

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Karsten Hilbert
On Sun, Apr 24, 2016 at 04:35:56PM +0100, Tomas J Stehlik wrote: >> Well if the corrupted raw files include the system information >> then I think you are out of luck. > > Well, this topic is not about "luck". Surely, English isn't my vernacular language - but "out of luck" has seemed to be an

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Karsten Hilbert
On Sun, Apr 24, 2016 at 04:35:56PM +0100, Tomas J Stehlik wrote: > > So did you do a schema only dump or a complete dump? > > There is no dump. There are just raw files. I believe Adrian wanted to know whether you attempted a schema or complete dump *after* the fact, like what he suggested a mai

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Karsten, > If I recall correctly, you stated that the data isn't > important in this Yes, exactly. However, pages in blocks apparently store also the representations of the database schemas. And those are also corrupt. A tiny bit only but still corrupt. Therefore the overall information

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Adrian, Thank you. > So did you do a schema only dump or a complete dump? There is no dump. There are just raw files. > Well if the corrupted raw files include the system information > then I think you are out of luck. Well, this topic is not about "luck". The question potentially ta

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Melvin, Thank you. Your reply is similar to the first one in that it makes assumptions to the contrary of my original e-mail. Therefore I shall tackle only the relevant bits: 1. This is not related to any existing bug. It was a corruption of the file system. 2. OID of the corrupt databas

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Karsten Hilbert
On Sun, Apr 24, 2016 at 04:16:10PM +0100, Tomas J Stehlik wrote: > Please note that I mentioned previously that the database is corrupt. Given the facts that Adrian attempted to engage in a solution-bound conversation all the while mentioning that he doesn't know how to recover the schema from th

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Adrian Klaver
On 04/24/2016 08:16 AM, Tomas J Stehlik wrote: Please note that I mentioned previously that the database is corrupt. "pg_class" table can be queried but it is not possible to dump the database in question as some of the pages in blocks are missing. So did you do a schema only dump or a complet

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Melvin Davidson
On Sun, Apr 24, 2016 at 11:16 AM, Tomas J Stehlik wrote: > Please note that I mentioned previously that the database is corrupt. > > "pg_class" table can be queried but it is not possible to dump the database > in question as some of the pages in blocks are missing. > > In this case, it is necess

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Please note that I mentioned previously that the database is corrupt. "pg_class" table can be queried but it is not possible to dump the database in question as some of the pages in blocks are missing. In this case, it is necessary to rely on raw files only. Thanks. T -- Sent via pgsql-gener

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Adrian Klaver
On 04/24/2016 07:09 AM, Karsten Hilbert wrote: On Sun, Apr 24, 2016 at 03:00:09PM +0100, Tomas J Stehlik wrote: What happened if you connected to another database in the cluster? That's irrelevant. I dare assume Adrian asked for a reason :-) Yes, the reason being that the OP was asking ab

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Karsten Hilbert
On Sun, Apr 24, 2016 at 03:00:09PM +0100, Tomas J Stehlik wrote: > > What happened if you connected to another database in the cluster? > > That's irrelevant. I dare assume Adrian asked for a reason :-) Karsten -- GPG key ID E4071346 @ eu.pool.sks-keyservers.net E167 67FD A291 2BEA 73BD 4537

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Adrian, > So to be clear, all that remains of the database cluster are the files > you copied out from the data directory, correct? Yes and no. For the purpose of this discussion, it may be better to say "yes" though. > That would imply that the server actually started, is that the case?

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Adrian Klaver
On 04/24/2016 03:54 AM, Tomas J Stehlik wrote: Hello Venkata, Thank you for your reply. You are stating the obvious though. If those conditions were met, I would have formulated my question differently. So to be clear, all that remains of the database cluster are the files you copied out fr

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Venkata, Thank you for your reply. You are stating the obvious though. If those conditions were met, I would have formulated my question differently. Kind regards, Tomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http:/

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-23 Thread Venkata Balaji N
On Sun, Apr 24, 2016 at 2:30 AM, Tomas J Stehlik wrote: > Hello, > > There was a corruption to the file system due to sudden shutdown of Windows > 7. > > The attempt to connect to one of the databases results in multiple errors, > like the following one: > ERROR: invalid page in block 58 of rela

[GENERAL] Is it possible to recover the schema from the raw files?

2016-04-23 Thread Tomas J Stehlik
Hello, There was a corruption to the file system due to sudden shutdown of Windows 7. The attempt to connect to one of the databases results in multiple errors, like the following one: ERROR: invalid page in block 58 of relation base/161326/233745 Several raw files were completely lost (zeroed)

Re: [GENERAL] Is it possible to call Postgres directly?

2016-04-21 Thread david
6 11:57 PM > To: da...@andl.org > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Is it possible to call Postgres directly? > > writes: > > So the question is: Can a C program link to the Postgres DLL and call > > SPI directly, rather than through a language function?

Re: [GENERAL] Is it possible to call Postgres directly?

2016-04-21 Thread Tom Lane
writes: > So the question is: Can a C program link to the Postgres DLL and call SPI > directly, rather than through a language function? No, there is no provision for non-server usage of the code. If that's what you're after you might be happier with SQLite or something similar.

Re: [GENERAL] Is it possible to call Postgres directly?

2016-04-21 Thread John R Pierce
On 4/20/2016 10:59 PM, da...@andl.org wrote: So the question is: Can a C program link to the Postgres DLL and call SPI directly, rather than through a language function? Is there a way to launch a Thrift server or a Web server and call SPI directly? no, those can only be called from the conte

Re: [GENERAL] Is it possible to call Postgres directly?

2016-04-20 Thread david
> > I would like to be able to execute SQL queries by a direct call into > > Postgres, without going through either (1) the language call handler > > or (2) a 'wire' protocol. > > What would you consider to be "directly"? What advantage would you hope to > gain from a different API? The aim is t

Re: [GENERAL] Is it possible to call Postgres directly?

2016-04-20 Thread John R Pierce
On 4/20/2016 7:27 PM, da...@andl.org wrote: Re (1): At present I can do it like this: SELECT * FROM COMPILE($$ $$); But I would like to avoid the outer SQL SQL wrapper. so all your top level application queries are of the form SELECT * from FUNCTION() ? thats not going to do a very good

Re: [GENERAL] Is it possible to call Postgres directly?

2016-04-20 Thread Tom Lane
writes: > I would like to be able to execute SQL queries by a direct call into > Postgres, without going through either (1) the language call handler or (2) > a 'wire' protocol. What would you consider to be "directly"? What advantage would you hope to gain from a different API? FWIW, it seems

[GENERAL] Is it possible to call Postgres directly?

2016-04-20 Thread david
I am attempting to create a new language implementation. The language is Andl (see http://www.andl.org/2016/04/postgres-meet-andl/). I would like to be able to execute SQL queries by a direct call into Postgres, without going through either (1) the language call handler or (2) a 'wire' protocol.

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 wrote: > Melvin Davidson writes: > > On Thu, Mar 31, 2016 at 9:24 AM, Nik Mitev wrote: > >>> In summary, I am looking for the opposite functionality to 'ALTER TYPE > >>> typename ADD VALUE IF NOT EXISTS new_value' > >>> e.g. 'ALTER TYPE typename DELETE

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

2016-03-31 Thread Tom Lane
Melvin Davidson writes: > On Thu, Mar 31, 2016 at 9:24 AM, Nik Mitev wrote: >>> In summary, I am looking for the opposite functionality to 'ALTER TYPE >>> typename ADD VALUE IF NOT EXISTS new_value' >>> e.g. 'ALTER TYPE typename DELETE VALUE IF NOT USED unused_value'. > It is not easy to delete

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 9:24 AM, Nik Mitev wrote: > > > On 31/03/16 14:14, Sándor Daku wrote: > > On 31 March 2016 at 14:35, Nik Mitev wrote: > >> Hi, >> >> In summary, I am looking for the opposite functionality to 'ALTER TYPE >> typename ADD VALUE IF NOT EXISTS new_value' >> e.g. 'ALTER TYPE t

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

2016-03-31 Thread Nik Mitev
On 31/03/16 14:14, Sándor Daku wrote: > On 31 March 2016 at 14:35, Nik Mitev > wrote: > > Hi, > > In summary, I am looking for the opposite functionality to 'ALTER TYPE > typename ADD VALUE IF NOT EXISTS new_value' > e.g. 'ALTER TYPE typename DELETE VALUE IF

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

2016-03-31 Thread Sándor Daku
On 31 March 2016 at 14:35, Nik Mitev wrote: > Hi, > > In summary, I am looking for the opposite functionality to 'ALTER TYPE > typename ADD VALUE IF NOT EXISTS new_value' > e.g. 'ALTER TYPE typename DELETE VALUE IF NOT USED unused_value'. The > [IF NOT USED] condition is optional, I can work arou

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

2016-03-31 Thread Nik Mitev
Hi, In summary, I am looking for the opposite functionality to 'ALTER TYPE typename ADD VALUE IF NOT EXISTS new_value' e.g. 'ALTER TYPE typename DELETE VALUE IF NOT USED unused_value'. The [IF NOT USED] condition is optional, I can work around it and externally check whether the value is used in t

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] Is it possible to select index values ?

2016-02-02 Thread Jonathan Vanasco
On Feb 1, 2016, at 6:58 PM, David G. Johnston wrote: > You can query the statistics portion of the database to get some basic > statistics of the form mentioned. Yeah, i didn't think there would be support. The stats collector doesn't have the info that I want... it's focused on how the data

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

2016-02-01 Thread David G. Johnston
On Mon, Feb 1, 2016 at 4:29 PM, Jonathan Vanasco wrote: > Is it possible to select index values ? > > I haven't found any documentation that says "No", but I haven't found > anything that says "Yes" either. > > The reason - I have a few function indexes that are working as partial > indexes. I'd

[GENERAL] Is it possible to select index values ?

2016-02-01 Thread Jonathan Vanasco
Is it possible to select index values ? I haven't found any documentation that says "No", but I haven't found anything that says "Yes" either. The reason - I have a few function indexes that are working as partial indexes. I'd like to run some analytics on them (to determine uniqueness of valu

Re: [GENERAL] Is it possible to set a timeout for optimization in PostgreSQL?

2014-11-03 Thread Andreas Kretschmer
> Zhan Li hat am 4. November 2014 um 03:01 geschrieben: > > > Hi all, > > In PostgreSQL is there a timeout when the optimizer stops the optimization > process and returns the least expensive plan it has found so far? Is it > possible to change its value? > > Thanks, > Zhan Please read http://w

[GENERAL] Is it possible to set a timeout for optimization in PostgreSQL?

2014-11-03 Thread Zhan Li
Hi all, In PostgreSQL is there a timeout when the optimizer stops the optimization process and returns the least expensive plan it has found so far? Is it possible to change its value? Thanks, Zhan

Re: [GENERAL] Is it possible to create an index without keeping the indexed data in a column?

2014-07-31 Thread Amit Langote
On Fri, Aug 1, 2014 at 2:50 PM, Amit Langote wrote: > > Not sure exactly if it applies here; Re-reading the OP again, perhaps it doesn't. Sorry about the noise -- Amit -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgr

Re: [GENERAL] Is it possible to create an index without keeping the indexed data in a column?

2014-07-31 Thread Amit Langote
On Fri, Aug 1, 2014 at 10:48 AM, Michael Paquier wrote: > On Fri, Aug 1, 2014 at 4:47 AM, Larry White wrote: >> Is there a way to get Postgres to index the table as if the JSON were there, >> but not actually put the data in the table? >> I could either store the docs >> elsewhere and keep a refe

Re: [GENERAL] Is it possible to create an index without keeping the indexed data in a column?

2014-07-31 Thread Michael Paquier
On Fri, Aug 1, 2014 at 4:47 AM, Larry White wrote: > Is there a way to get Postgres to index the table as if the JSON were there, > but not actually put the data in the table? > I could either store the docs > elsewhere and keep a reference, or compress them and put them in the table > in compress

[GENERAL] Is it possible to create an index without keeping the indexed data in a column?

2014-07-31 Thread Larry White
Hi, I would like to create a GIN index on a set of JSON documents. Right now I'm storing the data in a JSONB column. The current index looks like this: CREATE INDEX document_payload_idx ON document USING gin (payload jsonb_path_ops); The index is pretty small, but the actual data takes up

Re: [GENERAL] Is it possible to load two different versions of the JDBC driver in the same application?

2014-04-11 Thread Dave Cramer
Ya, they probably don't like that we use server side prepared statements Might be possible to just mess with classpath's to get it done. Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On 11 April 2014 17:39, Rob Sargent wrote: > On 04/11/2014 03:31 PM, Tecno Brain wrote:

Re: [GENERAL] Is it possible to load two different versions of the JDBC driver in the same application?

2014-04-11 Thread Rob Sargent
On 04/11/2014 03:31 PM, Tecno Brain wrote: I have a Java application that is using Postgres 9.1, and we use the latest 9.1 JDBC driver. The same Java app requires access now to a Redshift cluster. Amazon recommends to use a Postgres 8 JDBC driver for connecting to Redshift. Can I load both dri

[GENERAL] Is it possible to load two different versions of the JDBC driver in the same application?

2014-04-11 Thread Tecno Brain
I have a Java application that is using Postgres 9.1, and we use the latest 9.1 JDBC driver. The same Java app requires access now to a Redshift cluster. Amazon recommends to use a Postgres 8 JDBC driver for connecting to Redshift. Can I load both drivers in the same application ? I currently use

Re: [GENERAL] Is it possible to "pip" pg_dump output into new db ?

2014-03-27 Thread Frank
Ray, Alan, thanks for your replies. We have tested the dump/restore procedure with a few smaller databases and it worked fine. We had a few smaller hiccups with the large database as it required a few modules and special tablespaces before it would start actually copying data. But not a real prob

Re: [GENERAL] Is it possible to "pip" pg_dump output into new db ?

2014-03-25 Thread Alan Hodgson
On Tuesday, March 25, 2014 02:56:48 PM Frank Foerster wrote: > Hi, > > we are currently in the process of upgrading a production/live 1 TB > database from 9.2 to 9.3 via pg_dump, which is quite a lengthy process. > > Fortunately we have a capable spare-server so we can restore into a clean, > fre

Re: [GENERAL] Is it possible to "pip" pg_dump output into new db ?

2014-03-25 Thread Raymond O'Donnell
On 25/03/2014 13:56, Frank Foerster wrote: > > Hi, > > we are currently in the process of upgrading a production/live 1 TB > database from 9.2 to 9.3 via pg_dump, which is quite a lengthy process. > > Fortunately we have a capable spare-server so we can restore into a > clean, freshly setup mac

[GENERAL] Is it possible to "pip" pg_dump output into new db ?

2014-03-25 Thread Frank Foerster
Hi, we are currently in the process of upgrading a production/live 1 TB database from 9.2 to 9.3 via pg_dump, which is quite a lengthy process. Fortunately we have a capable spare-server so we can restore into a clean, freshly setup machine. I just wondered wether the intermediate step of writin

Re: [GENERAL] Is it possible that session lock is not released

2013-12-11 Thread Tom Lane
T writes: > Now transaction goes to default state, then this backend is killed or some > FATAL error happens, > AbortOutOfAnyTransaction() in ShutdownPostgres() will do nothing since > transaction is in default > state, and session lock on heaprelid is still held after ShutdownPostgres(), > so

[GENERAL] Is it possible that session lock is not released

2013-12-11 Thread T
Hi, I just found that ShutdownPostgres() only releases USER_LOCKMETHOD locks, so why not release DEFAULT_LOCKMETHOD locks? Check if this is possible: We are doing a CREATE INDEX CONCURRENTLY, and codes runs to LockRelationIdForSession(&heaprelid, ShareUpdateExclusiveLock); PopAct

[GENERAL] Is it possible to avoid the VACUUM FREEZE when upgrading to 9.3.2?

2013-12-07 Thread Torsten Förtsch
Hi, can the VACUUM FREEZE be skipped if a) txid_current < vacuum_freeze_min_age or if b) txid_current < vacuum_freeze_table_age or if c) txid_current < autovacuum_freeze_max_age and no manual VACUUM has been done? Or is the operation perhaps only necessary for tables matching select n.nspnam

[GENERAL] Is it possible for Postgresql to interact with Transaction Manager (TM like Tuxedo) as a Ressource Manager (RM) ?

2013-04-30 Thread Ramiro Arraya
Is there anyone knows about this question made by Alain if its possible to work with PostgreSQL with tuxedo, someone could help me. BR Ramiro Arraya Mediation Architect Mobile (BO): +591 70305291 skype: ramiro.arraya [cid:image001.png@01CE4585.88D79600] www.TrilogySoftwareBolivia.co

Re: [GENERAL] Is it possible to migrate database from Postgresql 8.2 to 9.2 using pg_upgrade?

2013-02-04 Thread Steve Crawford
On 02/04/2013 12:06 PM, AI Rumman wrote: Is it possible to migrate database from Postgresql 8.2 to 9.2 using pg_upgrade? Thanks. Per http://www.postgresql.org/docs/9.2/static/pgupgrade.html "...pg_upgrade supports upgrades from 8.3.X and later to the current major release of PostgreSQL..."

[GENERAL] Is it possible to migrate database from Postgresql 8.2 to 9.2 using pg_upgrade?

2013-02-04 Thread AI Rumman
Is it possible to migrate database from Postgresql 8.2 to 9.2 using pg_upgrade? Thanks.

Re: [GENERAL] Is it possible to create row-wise indexable condition for special case...

2012-08-06 Thread François Beausoleil
Le 2012-08-06 à 01:39, Maxim Boguk a écrit : > I know that for condition like ((field1>value1) or (field1=value1 and > field2>value2)) I could built index on (field1, field2) and use indexable > condition like (field1, field2) > (value1, value2). > > However, I have very tricky query whic

[GENERAL] Is it possible to create row-wise indexable condition for special case...

2012-08-05 Thread Maxim Boguk
Hi, I know that for condition like ((field1>value1) or (field1=value1 and field2>value2)) I could built index on (field1, field2) and use indexable condition like (field1, field2) > (value1, value2). However, I have very tricky query which requires an indexable condition like (field1>value1

Re: [GENERAL] Is it possible to send data in client end?

2012-06-20 Thread John R Pierce
On 06/20/12 9:13 PM, AI Rumman wrote: I am using Postgresql 9.1. I know that COPY is used to export data as csv. But COPY creates file in server end. I need to create a file in client end. My application uses php. Is there any tool for it? use COPY blahblah TO STDOUT; in php, you can use pg

[GENERAL] Is it possible to send data in client end?

2012-06-20 Thread AI Rumman
I am using Postgresql 9.1. I know that COPY is used to export data as csv. But COPY creates file in server end. I need to create a file in client end. My application uses php. Is there any tool for it?

Re: [GENERAL] Is it possible to call other functions inside plpythonu?

2012-05-04 Thread Stuart Bishop
On Fri, May 4, 2012 at 4:09 PM, Stuart Bishop wrote: > On Fri, Apr 27, 2012 at 4:42 PM, Frank Lanitz wrote: >> Hi folks, >> >> Just looking for a nice server side solution to implement some >> fundamental logic for an application. plpythonu looks in this tmers very >> well as I'm liking the synta

Re: [GENERAL] Is it possible to call other functions inside plpythonu?

2012-05-04 Thread Stuart Bishop
On Fri, Apr 27, 2012 at 4:42 PM, Frank Lanitz wrote: > Hi folks, > > Just looking for a nice server side solution to implement some > fundamental logic for an application. plpythonu looks in this tmers very > well as I'm liking the syntax of Python. However, an very old blog post > at [1] made me

[GENERAL] Is it possible to call other functions inside plpythonu?

2012-04-27 Thread Frank Lanitz
Hi folks, Just looking for a nice server side solution to implement some fundamental logic for an application. plpythonu looks in this tmers very well as I'm liking the syntax of Python. However, an very old blog post at [1] made me unsure whether really to use it. Is it still (or has it ever been

Re: [GENERAL] Is it possible to speed up addition of "not null"?

2012-02-02 Thread Andrew Sullivan
On Thu, Feb 02, 2012 at 02:20:59PM +0100, hubert depesz lubaczewski wrote> > Sure. But at least theoretically, it could use index - for example, if > I had index "where column is null". To build that index, you had to visit every row too. But I see what your problem is. > But this should be nea

Re: [GENERAL] Is it possible to speed up addition of "not null"?

2012-02-02 Thread Florian Weimer
* hubert depesz lubaczewski: > procedure would look like: > 1. update pg_attribute set attnotnull = true where attrelid = > 'my_table'::regclass and attname = 'not-null-column'; > 2. delete from my_table where not-null-column is null; -- this shouldn't >do anything, as I know that there are n

Re: [GENERAL] Is it possible to speed up addition of "not null"?

2012-02-02 Thread hubert depesz lubaczewski
On Thu, Feb 02, 2012 at 02:08:51PM +, Florian Weimer wrote: > * hubert depesz lubaczewski: > > > I tried with some indexes, but I can't get the time to something > > reasonable, so here is my question: is there any way I could make the > > "not null" constraint *fast*? > > You coul patch pg_a

Re: [GENERAL] Is it possible to speed up addition of "not null"?

2012-02-02 Thread Florian Weimer
* hubert depesz lubaczewski: > I tried with some indexes, but I can't get the time to something > reasonable, so here is my question: is there any way I could make the > "not null" constraint *fast*? You coul patch pg_attribute directly. I'm not sure if that's still safe in current versions, tho

Re: [GENERAL] Is it possible to speed up addition of "not null"?

2012-02-02 Thread hubert depesz lubaczewski
On Thu, Feb 02, 2012 at 07:26:15AM -0500, Andrew Sullivan wrote: > > I need to add not null on one of the columns, but it seems to require > > full table scan. > Of course it does. If you want a constraint added to the table, the > first thing it ought to do is check that all your data actually >

Re: [GENERAL] Is it possible to speed up addition of "not null"?

2012-02-02 Thread Andrew Sullivan
On Thu, Feb 02, 2012 at 12:48:04PM +0100, hubert depesz lubaczewski wrote > I need to add not null on one of the columns, but it seems to require > full table scan. Of course it does. If you want a constraint added to the table, the first thing it ought to do is check that all your data actually

  1   2   3   >