On Thu, Jun 2, 2016 at 5:44 PM, Kevin Grittner wrote:
> On Thu, Jun 2, 2016 at 3:23 PM, David G. Johnston
> wrote:
> > On Thu, Jun 2, 2016 at 4:11 PM, John R Pierce
> wrote:
> >> Thanks all the below seem to do the trick.
>
> I doubt it -- using NOT IN requires (per the SQL specification)
> han
On Thu, Jun 2, 2016 at 3:23 PM, David G. Johnston
wrote:
> On Thu, Jun 2, 2016 at 4:11 PM, John R Pierce wrote:
>> Thanks all the below seem to do the trick.
I doubt it -- using NOT IN requires (per the SQL specification)
handling NULLs in a way that probably does not give you the answer
you wan
On Thu, Jun 2, 2016 at 4:11 PM, John R Pierce wrote:
> On 6/2/2016 11:10 AM, Steve Clark wrote:
>
> Thanks all the below seem to do the trick.
>
> On 06/02/2016 01:58 PM, David G. Johnston wrote:
>
> select max(id) from yourtable where sts=0 and id not in (select ref_id
> from yourtable);
>
>
> s
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:
> pgsql-general-ow...@postgresql.org] On Behalf Of Steve Clark
> Sent: Thursday, June 2, 2016 9:56 AM
> To: pgsql
> Subject: [GENERAL] dumb question
>
> Hi List,
>
> I am a noob trying to do something that seems li
On 06/02/2016 04:07 PM, Dann Corbit wrote:
This is your request, translated directly into SQL
select max(id) from sometable where sts=0 and ref_id IS NULL
Looking at your sample, it seems that sts is always 1 when ref_id exists, so it
may possibly simplify to:
select max(id) f
7; ; pgsql
Subject: Re: [GENERAL] dumb question
This is your request, translated directly into SQL
select max(id) from sometable where sts=0 and ref_id IS NULL
Looking at your sample, it seems that sts is always 1 when ref_id exists, so it
may possibly simplify to:
select ma
On 6/2/2016 11:10 AM, Steve Clark wrote:
Thanks all the below seem to do the trick.
On 06/02/2016 01:58 PM, David G. Johnston wrote:
select max(id) from yourtable where sts=0 and id not in (select
ref_id from yourtable);
select max(id) from yourtable where sts=0 and id not in (select ref_id
This is your request, translated directly into SQL
select max(id) from sometable where sts=0 and ref_id IS NULL
Looking at your sample, it seems that sts is always 1 when ref_id exists, so it
may possibly simplify to:
select max(id) from sometable where sts=0
-Original Mess
Thanks all the below seem to do the trick.
On 06/02/2016 01:58 PM, David G. Johnston wrote:
select max(id) from yourtable where sts=0 and id not in (select ref_id from
yourtable);
select max(id) from yourtable where sts=0 and id not in (select ref_id from
yourtable);
--
Stephen Clark
On Thu, Jun 2, 2016 at 10:40 AM, Felipe Santos wrote:
>
>
> 2016-06-02 14:23 GMT-03:00 Steve Crawford
> :
>
>> Something like:
>>
>> select max(id) from yourtable where sts=0 and ref_id is null;
>>
>> That assumes that ref_id is null. It would help to see your table
>> structure and the query yo
On Thu, Jun 2, 2016 at 1:48 PM, Steve Crawford <
scrawf...@pinpointresearch.com> wrote:
> On Thu, Jun 2, 2016 at 10:40 AM, Felipe Santos
> wrote:
>
>> I think sts=0 means ref_id is null
>>
>> So, what I think he wants to achieve is:
>>
>> select max(id) from yourtable where sts=0 and id not in (s
2016-06-02 14:23 GMT-03:00 Steve Crawford :
> Something like:
>
> select max(id) from yourtable where sts=0 and ref_id is null;
>
> That assumes that ref_id is null. It would help to see your table
> structure and the query you tried that doesn't work. If ref_id is actually
> a character string th
Something like:
select max(id) from yourtable where sts=0 and ref_id is null;
That assumes that ref_id is null. It would help to see your table structure
and the query you tried that doesn't work. If ref_id is actually a
character string then you might need ref_id='' or coalesce(ref_id,'')='' if
On Thursday, June 2, 2016, Steve Clark wrote:
> Hi List,
>
> I am a noob trying to do something that seems like it should be easy but I
> can't figure it out.
>
> I have a table like so:
>
> id | ref_id | sts
> --
> 1 || 0
> 2 | 1 | 1
> 3 || 0
> 4 |
Jasen Betts wrote:
>On 2013-02-23, Raymond C. Rodgers wrote:
>> On 02/23/2013 05:26 AM, Tom Lane wrote:
>>> A "virtual" tsvector like that is probably going to be useless for
>>> searching as soon as you get a meaningful amount of data, because the
>>> only way the DB can implement a search is t
On 2013-02-23, Raymond C. Rodgers wrote:
> On 02/23/2013 05:26 AM, Tom Lane wrote:
>> A "virtual" tsvector like that is probably going to be useless for
>> searching as soon as you get a meaningful amount of data, because the
>> only way the DB can implement a search is to compute the tsvector
On 02/23/2013 05:26 AM, Tom Lane wrote:
A "virtual" tsvector like that is probably going to be useless for
searching as soon as you get a meaningful amount of data, because the
only way the DB can implement a search is to compute the tsvector
value for each table row and then examine it for the
Kevin Grittner writes:
> Raymond C. Rodgers wrote:
>> As I went to add a tsvector column, it occurred to me that it
>> might be possible to add a dynamic tsvector column through the
>> use of a view, so I created a temporary view with a command along
>> the lines of:
>>
>> CREATE TEMPORARY
Raymond C. Rodgers wrote:
> As I went to add a tsvector column, it occurred to me that it
> might be possible to add a dynamic tsvector column through the
> use of a view, so I created a temporary view with a command along
> the lines of:
>
> CREATE TEMPORARY VIEW ftstest AS SELECT id, field1
> -Original Message-
> From: Alvaro Herrera [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 11, 2007 1:11 PM
> To: Dann Corbit
> Cc: [EMAIL PROTECTED]; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Dumb question about binary cursors and
> #ifdefHAVE_INT6
> -Original Message-
> From: Alvaro Herrera [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 11, 2007 1:11 PM
> To: Dann Corbit
> Cc: [EMAIL PROTECTED]; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Dumb question about binary cursors and
> #ifdefHAVE_INT6
Dann Corbit wrote:
> If I create a binary cursor on a recent version of PostgreSQL, how can I
> tell if the timestamp data internally is an 8 byte double or an 8 byte
> integer?
>
> I see an #ifdef that changes the code path to compute timestamps as one
> type or the other, but I do not know how t
"Dann Corbit" <[EMAIL PROTECTED]> writes:
> If I create a binary cursor on a recent version of PostgreSQL, how can I
> tell if the timestamp data internally is an 8 byte double or an 8 byte
> integer?
PQparameterStatus(conn, "integer_datetimes")
regards, tom lane
Make sure you have stats collector enabled, if auto vacuum is doing the
analyze and vacuum it should be recording that info in this view. For
details on this you can have a look at -->
http://www.postgresql.org/docs/8.2/interactive/monitoring-stats.html
Just for a test try doing a VACUUM or ANALY
On 2/13/07, Walter Vaughan <[EMAIL PROTECTED]> wrote:
select last_autovacuum, last_autoanalyze from pg_stat_all_tables;
last_autovacuum | last_autoanalyze
-+--
|
...snip lots of identically blank lines...
|
Shoaib Mir wrote:
pg_stat_all_table view should help you:
select last_autovacuum, last_autoanalyze from pg_stat_all_tables;
select last_autovacuum, last_autoanalyze from pg_stat_all_tables;
last_autovacuum | last_autoanalyze
-+--
|
...snip lot
pg_stat_all_table view should help you:
select last_autovacuum, last_autoanalyze from pg_stat_all_tables;
--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)
On 2/9/07, Sic Transit Gloria Mundi <[EMAIL PROTECTED]> wrote:
Hi,
I couldnt find this on google, the archives, or the manual. But wit
Sic Transit Gloria Mundi <[EMAIL PROTECTED]> writes:
> I couldnt find this on google, the archives, or the manual. But with the
> changes to what the autovacuum daemon logs, how can we verify it's doing its
> thing? Is there a way to query the last time a table was vacuumed? But I
> don't see
On Feb 13, 2006, at 11:47 , Craig White wrote:
seems to be a lot of work just for this...the problem is trying to use
rubyonrails and their 'migrations' which cause this...
psql:db/development_structure.sql:211: ERROR: must be owner of schema
public
So how can I just 'munge' the system t
On Mon, 2006-02-13 at 11:39 +0900, Michael Glaesemann wrote:
> On Feb 13, 2006, at 11:27 , Craig White wrote:
>
> > th-db_test=> ALTER SCHEMA public OWNER TO tobyhouse;
> > ERROR: syntax error at or near "OWNER" at character 21
> >
> > # rpm -q postgresql-server
> > postgresql-server-7.4.8-1.RHEL
On Feb 13, 2006, at 11:27 , Craig White wrote:
th-db_test=> ALTER SCHEMA public OWNER TO tobyhouse;
ERROR: syntax error at or near "OWNER" at character 21
# rpm -q postgresql-server
postgresql-server-7.4.8-1.RHEL4.1
The docs I referred you to are for the current release. For earlier
relea
On Mon, 2006-02-13 at 11:07 +0900, Michael Glaesemann wrote:
> On Feb 13, 2006, at 10:29 , Craig White wrote:
>
> > How do I change the owner of a schema?
> >
> > ALTER SCHEMA "public" OWNER to "some_user"; #?
>
> http://www.postgresql.org/docs/current/interactive/sql-alterschema.html
>
> The
On Feb 13, 2006, at 10:29 , Craig White wrote:
How do I change the owner of a schema?
ALTER SCHEMA "public" OWNER to "some_user"; #?
http://www.postgresql.org/docs/current/interactive/sql-alterschema.html
The docs explain this very situation. HTML documentation ships with
the PostgreSQL
On Tue, Oct 11, 2005 at 02:22:23AM -0400, Tom Lane wrote:
> "Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> > Out of curiosity... why don't we have unsigned ints?
>
> Quick, is 42 an int or an unsigned int?
>
> I think it'd create a slew of new ambiguous cases in the
> numeric-datatype hierarchy, fo
On Mon, Oct 10, 2005 at 11:52:40PM -0700, Dann Corbit wrote:
> How about something like:
>
> CREATE DOMAIN unsigned_small AS smallint check (VALUE >= 0)
>
> CREATE DOMAIN unsigned_int AS integer check (VALUE >= 0)
>
> CREATE DOMAIN unsigned_big AS bigint check (VALUE >= 0)
>
> The objection mig
ostgresql.org
> Subject: Re: [GENERAL] Dumb question about serial's upper limit
>
> On Mon, Oct 10, 2005 at 10:59:03PM -0400, Tom Lane wrote:
> > CSN <[EMAIL PROTECTED]> writes:
> > > If integer's range is -2147483648 to +2147483647, why
> > > i
On Oct 11, 2005, at 15:12 , Jim C. Nasby wrote:
Out of curiosity... why don't we have unsigned ints? I for one would
certainly use them for id fields, as well as some other places where I
knew negative numbers weren't valid.
Check the archives. I know this has come up a number of times in the
"Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> Out of curiosity... why don't we have unsigned ints?
Quick, is 42 an int or an unsigned int?
I think it'd create a slew of new ambiguous cases in the
numeric-datatype hierarchy, for what is really pretty darn small gain.
We're already just barely getti
On Mon, Oct 10, 2005 at 10:59:03PM -0400, Tom Lane wrote:
> CSN <[EMAIL PROTECTED]> writes:
> > If integer's range is -2147483648 to +2147483647, why
> > is serial's range only 1 to 2147483647 instead of 1 to
> > about 4294967294?
>
> How are you going to stuff 4294967294 into an integer field, wh
On Oct 11, 2005, at 14:04 , CSN wrote:
I was thinking about the types in the C code behind
PostgreSQL, rather than types in PG itself. Been a
long time since I coded in C but I thought it had
unsigned ints and maybe data types could be mapped as
so (pardon my ignorance about C/PG's inner workin
--- Tom Lane <[EMAIL PROTECTED]> wrote:
> CSN <[EMAIL PROTECTED]> writes:
> > If integer's range is -2147483648 to +2147483647,
> why
> > is serial's range only 1 to 2147483647 instead of
> 1 to
> > about 4294967294?
>
> How are you going to stuff 4294967294 into an
> integer field, which as
> y
CSN <[EMAIL PROTECTED]> writes:
> If integer's range is -2147483648 to +2147483647, why
> is serial's range only 1 to 2147483647 instead of 1 to
> about 4294967294?
How are you going to stuff 4294967294 into an integer field, which as
you just stated has an upper limit of 2147483647?
If we had an
Mike Nolan <[EMAIL PROTECTED]> writes:
> The notes on participating in the 8.1 beta suggest creating a dump using
> both an old and new copy of pg_dump.
> Does this mean we can't use pg_dumpall or that we have to restore both
> dumps? (Or is that just a way of testing what works and what doesn'
Benjamin Smith wrote:
Now, I want to get a result like:
classroom | students | seats
101A 0 25
101B22 30
102A11 0
... etc.
Something somewhat akin to
select classroom.title,
count(students.id) AS students,
count(seats.id) AS seats
from classrooms, students, seats
wh
On Thu, Jul 21, 2005 at 10:09:07PM -0700, Benjamin Smith wrote:
> select classroom.title,
> count(students.id) AS students,
> count(seats.id) AS seats
> from classrooms, students, seats
> where classrooms.id=students.classrooms_id
> and classrooms.id=seats.id
>
> Except that it coun
45 matches
Mail list logo