Re: [GENERAL] Querying dead rows

2016-12-23 Thread Stephen Frost
* Rakesh Kumar (rakeshkumar...@outlook.com) wrote: > Is there a way to query dead rows (that is, rows which are dead and still not > cleaned up by Vacuum) using SQL. I am asking this just as an academical > question. CREATE EXTENSION pageinspect;

Re: [GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread rob stone
Hello, On Fri, 2016-12-23 at 16:44 +0100, Alessandro Baggi wrote: > Hi list, > sorry for this OT. > > I have a table on postgresql like this: > > id serial not null, > srcaddr varchar(16) not null > > I use this table to store ip address. I've used also inet type but  > changed to see if this

Re: [GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread Adrian Klaver
On 12/23/2016 08:03 AM, Alessandro Baggi wrote: Il 23/12/2016 16:52, David G. Johnston ha scritto: On Fri, Dec 23, 2016 at 8:44 AM, Alessandro Baggi >wrote: $query = pg_query_params($dbcon, "SELECT count(*) from bs_ipsource

Re: [GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread Adrian Klaver
On 12/23/2016 08:03 AM, Alessandro Baggi wrote: Il 23/12/2016 16:52, David G. Johnston ha scritto: On Fri, Dec 23, 2016 at 8:44 AM, Alessandro Baggi >wrote: $query = pg_query_params($dbcon, "SELECT count(*) from bs_ipsource

Re: [GENERAL] Er Data Modeller for PostgreSQL

2016-12-23 Thread Edmundo Robles
Maybe visual paradigm could help you, you can reverse and generate the database in postgresql. On Thu, Dec 22, 2016 at 11:50 PM, Günce Kaya wrote: > Hi All, > > I'm looking for an ER Data Modeller tool for postgresql. I use Navicat > Premium for postgresql and the tool

Re: [GENERAL] Bug? Netmask of CIDR as TEXT has trailing masklen

2016-12-23 Thread Tom Lane
no...@null.net writes: > Ah, I just noticed that the return value of the netmask() function is > of type 'inet' and that is (in my mind) where the actual issue is. A > netmask may have the same underlying form and space requirements as an > internet address or subnet, but it isn't really the same

[GENERAL] explain analyze showed improved results without changes, why?

2016-12-23 Thread Chris Richards
Howdy. I was noticing a significant problem with a query on one of my tables. I tried recreating the problem and wasn't able to do so on a different install, and so a few days later I ran the same query on the problem table. Lo' and behold, there wasn't a problem anymore. I'm at a loss to why. The

Re: [GENERAL] Bug? Netmask of CIDR as TEXT has trailing masklen

2016-12-23 Thread nomad
On Fri Dec 23, 2016 at 10:15:21AM -0500, Tom Lane wrote: > > Yes, it should be: that is the same as "text(netmask('1.1.1.0/24'))", > and the table of network functions specifically describes text(inet) > as "extract IP address and netmask length as text". If you only want > the IP address, use

Re: [GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread Alessandro Baggi
Hi Adrian, And what is the count? Reported is 1 How do you know it fails? Really I don't know if it fails but $query = pg_query_params(); if(!$query) { echo pg_last_error($dbcon); echo "ERROR"; } else { $row = pg_fetch_assoc($query); if(!$row)

Re: [GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread Alessandro Baggi
Il 23/12/2016 16:52, David G. Johnston ha scritto: On Fri, Dec 23, 2016 at 8:44 AM, Alessandro Baggi >wrote: $query = pg_query_params($dbcon, "SELECT count(*) from bs_ipsource where srcaddr = $1", array($ipsrc));

Re: [GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread Raymond O'Donnell
On 23/12/16 15:44, Alessandro Baggi wrote: Hi list, sorry for this OT. I have a table on postgresql like this: id serial not null, srcaddr varchar(16) not null I use this table to store ip address. I've used also inet type but changed to see if this solves my problem. From psql, I run:

Re: [GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread David G. Johnston
On Fri, Dec 23, 2016 at 8:44 AM, Alessandro Baggi < alessandro.ba...@gmail.com> wrote: > $query = pg_query_params($dbcon, "SELECT count(*) from bs_ipsource where > srcaddr = $1", array($ipsrc)); > if(!$query) { print error...} > > I don't understand why this query fails without error. I have

Re: [GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread Adrian Klaver
On 12/23/2016 07:44 AM, Alessandro Baggi wrote: Hi list, sorry for this OT. I have a table on postgresql like this: id serial not null, srcaddr varchar(16) not null I use this table to store ip address. I've used also inet type but changed to see if this solves my problem. From psql, I run:

[GENERAL] [OT] Postgresql and PHP

2016-12-23 Thread Alessandro Baggi
Hi list, sorry for this OT. I have a table on postgresql like this: id serial not null, srcaddr varchar(16) not null I use this table to store ip address. I've used also inet type but changed to see if this solves my problem. From psql, I run: select count(*) from bs_ipsource where srcaddr

Re: [GENERAL] Bug? Netmask of CIDR as TEXT has trailing masklen

2016-12-23 Thread Tom Lane
no...@null.net writes: > The following displays as I would expect: > mark=# select netmask('1.1.1.0/24'); > netmask > --- > 255.255.255.0 > (1 row) > However the following does not look right: > mark=# select netmask('1.1.1.0/24')::text; >

[GENERAL] Querying dead rows

2016-12-23 Thread Rakesh Kumar
Is there a way to query dead rows (that is, rows which are dead and still not cleaned up by Vacuum) using SQL. I am asking this just as an academical question. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Is there a reason the "-v/verbose" switch is not printed with pg_dumpall --help

2016-12-23 Thread Stephen Frost
Daniel, * Daniel Westermann (daniel.westerm...@dbi-services.com) wrote: > postgres@pgbox:/u01/app/postgres/local/dmk/ [PG961] pg_dumpall -V > pg_dumpall (PostgreSQL) 9.6.1 > postgres@pgbox:/u01/app/postgres/local/dmk/ [PG961] pg_dumpall --help > pg_dumpall extracts a PostgreSQL database

Re: [GENERAL] Er Data Modeller for PostgreSQL

2016-12-23 Thread Günce Kaya
Hi, Thank you for your response. This document is pretty good to use SchemasPy and thank you for your sharing but I could not integrate with our postgres yet. I'm looking for a database tool like Toad, DBVisualizer so on. It'll be more useful to me now. Regards, Gunce Kaya 2016-12-23 12:44

Re: [GENERAL] Is is safe to use SPI in multiple threads?

2016-12-23 Thread Peter J. Holzer
On 2016-12-09 16:52:05 +0800, Qiu Xiafei wrote: > I'm new to PG and want to implement my domain-specific system based on PG. I > wish to arrange my data as several tables in database and translate my DSL > into > SQL statements for query. Since one DSL statement may be mapped to several SQL >

[GENERAL] Bug? Netmask of CIDR as TEXT has trailing masklen

2016-12-23 Thread nomad
The following displays as I would expect: mark=# select netmask('1.1.1.0/24'); netmask --- 255.255.255.0 (1 row) However the following does not look right: mark=# select netmask('1.1.1.0/24')::text; netmask --

Re: [GENERAL] Er Data Modeller for PostgreSQL

2016-12-23 Thread Martijn Tonies (Upscene Productions)
Hello Gunce, Do you mean some sort of reverse engineering? Database Workbench supports that. With regards, Martijn Tonies Upscene Productions http://www.upscene.com Database Workbench - developer tool for Oracle, MS SQL Server, PostgreSQL, SQL Anywhere, MySQL, InterBase, NexusDB and Firebird.

Re: [GENERAL] Er Data Modeller for PostgreSQL

2016-12-23 Thread Andreas Joseph Krogh
På fredag 23. desember 2016 kl. 06:50:54, skrev Günce Kaya < guncekay...@gmail.com >: Hi All,   I'm looking for an ER Data Modeller tool for postgresql. I use Navicat Premium for postgresql and the tool has a modeller but I would like to display a database modeller

Re: [GENERAL] Er Data Modeller for PostgreSQL

2016-12-23 Thread Thomas Kellerer
Stephen Davies schrieb am 23.12.2016 um 10:08: I'm looking for an ER Data Modeller tool for postgresql. I use Navicat Premium for postgresql and the tool has a modeller but I would like to display a database modeller that belonging to a tables of an schema under a database. If I use Navicat for

Re: [GENERAL] Er Data Modeller for PostgreSQL

2016-12-23 Thread Stephen Davies
On 23/12/16 16:20, Günce Kaya wrote: Hi All, I'm looking for an ER Data Modeller tool for postgresql. I use Navicat Premium for postgresql and the tool has a modeller but I would like to display a database modeller that belonging to a tables of an schema under a database. If I use Navicat for

[GENERAL] Is there a reason the "-v/verbose" switch is not printed with pg_dumpall --help

2016-12-23 Thread Daniel Westermann
postgres@pgbox:/u01/app/postgres/local/dmk/ [PG961] pg_dumpall -V pg_dumpall (PostgreSQL) 9.6.1 postgres@pgbox:/u01/app/postgres/local/dmk/ [PG961] pg_dumpall --help pg_dumpall extracts a PostgreSQL database cluster into an SQL script file. Usage: pg_dumpall [OPTION]... General options: