"Glen M. Witherington" writes:
> And here's the query I want to do, efficiently:
> SELECT * FROM c
> JOIN b ON b.id = c.b_id
> JOIN a ON a.id = b.a_id
> WHERE a.id = 3
> ORDER BY b.created_at DESC
> LIMIT 10
At least for that dummy data, this seems sufficient:
regression=# create index on b
When I create a table with a column whose type is date the type gets forced to
timestamp without timezone after it gets created
ops=# CREATE TABLE test (
ops(# namevarchar(40) NOT NULL,
ops(# start date NOT NULL
ops(# );
CREATE TABLE
ops=# \d test;
Table "public.
On Sat, May 30, 2015, at 11:33 PM, David G. Johnston wrote:
> This is one problem with using made up surrogate keys...
>
> The PK of A is a component of both the PK of B and the PK of C but you throw
> that information away by using serial fields for PKs instead. You should
> have unique ind
On Saturday, May 30, 2015, Glen M. Witherington wrote:
> Sorry about the horrendous subject, let me explain by example:
>
> Let's take this schema:
>
>
> ```
> CREATE TABLE a (
> id bigserial PRIMARY KEY,
> created_at timestamp with time zone NOT NULL DEFAULT NOW()
> );
>
> CREATE TABLE b(
Hi,
On the one of databases under my support I found very curious case of the
almost endless index bloat (index size stabilises around 100x of the
original size).
Graph of one index size history attached (other indexes have an similar
time/size graphs).
The table have 5 indexes and they all have
Sorry about the horrendous subject, let me explain by example:
Let's take this schema:
```
CREATE TABLE a (
id bigserial PRIMARY KEY,
created_at timestamp with time zone NOT NULL DEFAULT NOW()
);
CREATE TABLE b(
id bigserial PRIMARY KEY,
a_id bigint NOT NULL REFERENCES a(id),
create
On 2015-05-30 00:52:37 -0300, Alvaro Herrera wrote:
> Andres Freund wrote:
>
> > I considered for a second whether the solution for that could be to not
> > truncate while inconsistent - but I think that doesn't solve anything as
> > then we can end up with directories where every single offsets/me
- Original Message -
> From: Andreas Kretschmer
> To: pgsql-general@postgresql.org
> Cc:
> Sent: Saturday, 30 May 2015, 13:10
> Subject: Re: [GENERAL] replacing jsonb field value
>
> Michael Paquier wrote:
>
>>
>> Append the new value to it the existing field, jsonb has as proper
>select obj_description('table1'::regclass, 'pg_class');
That will only show the table comment.
My query shows that table comment AND any column comments!
On Sat, May 30, 2015 at 9:37 AM, Adrian Klaver
wrote:
> On 05/30/2015 04:48 AM, Bob Futrelle wrote:
>
>> Using pgAdmin3 I've tried this and
On 05/30/2015 04:48 AM, Bob Futrelle wrote:
Using pgAdmin3 I've tried this and variations on it. All are rejected.
select COMMENT ON TABLE articlestats
No answer here,
http://www.postgresql.org/docs/9.3/static/sql-comment.html
pgAdmin3 had no problem with entering a comment:
This will give the comment on your table and any column:
SELECT DISTINCT ON (c.relname)
n.nspname as schema,
c.relname,
a.rolname as owner,
0 as col_seq,
'' as column,
d.description as comment
FROM pg_class c
LEFT JOIN pg_attribute col ON (col.attrelid
Michael Paquier wrote:
>
> Append the new value to it the existing field, jsonb has as property
> to enforce key uniqueness, and uses the last value scanned for a given
> key.
can you show a simple example, how to append a jsonb to an jsonb-field?
Maybe i'm blind, but i can't find how it works.
Hi
you can call function obj_description
http://stackoverflow.com/questions/11493978/how-to-retrieve-the-comment-of-a-postgresql-database
http://www.postgresql.org/docs/9.1/static/functions-info.html
For tables
SELECT pg_catalog.obj_description('tablename'::regclass, 'pg_class') as
"Description
Using pgAdmin3 I've tried this and variations on it. All are rejected.
select COMMENT ON TABLE articlestats
No answer here,
http://www.postgresql.org/docs/9.3/static/sql-comment.html
pgAdmin3 had no problem with entering a comment:
COMMENT ON TABLE articlestats IS 'Comprehensive data for e
On Sat, May 30, 2015 at 11:52 AM, john.tiger wrote:
> using 9.4.2
>
> suppose we have
> create table test (id serial primary key, data jsonb);
> insert into test (data) values ({"a":1, "b":2})
>
> want to replace "b" with 3
>
> okay, we are retrieving entire record
> res = select * from test where
15 matches
Mail list logo