настроен он следующим образом:
ну так похоже, что у тебя постгря слушает только unix socket, а не tcp-- Create a temporary table
CREATE TEMPORARY TABLE temp_location
(
mytable_key serial primary key,
id int,
...
)
ON COMMIT DELETE ROWS;
1. Похожи ли они между собой?под капотом - сильно
2. Что посоветуете покурить в этом направлении.базовый синтаксис аналогичный. Все остальное гуглится с полпинка
3. Стоит ли вообще переходить.да, однозначно.
А хотелось бы, если не реалтаймовой обработки, то задержки не больше часа и отсуствие линейной сложности от кол-ва постгрессов.такое наврятли получится без всяких хадупов
truncate table tableA;
insert into tableA
select *
from dblink('dbname=postgres hostaddr=xxx.xxx.xxx.xxx dbname=mydb user=postgres',
'select a,b from tableA')
as t1(a text,b text);
Безопасно ли?в общем случае - нет
Ограничивать размер поля?нет смисла
Ограничивать количество кастомных полей?нет смисла
Зачем это нужно?разве что кеширование. и чтоб показать, что постгря круче монго
Скорость работы и выборки?vibhorkumar.wordpress.com/2014/05/15/write-operati...
Может лучше обычную строку сделать, внутри текстовый json и парсить при помощи javascript'a?если все вот ето не будет использоваться, то да
# TYPE DATABASE USER ADDRESS METHOD
local railshelloDB railshelloPG ident map=railshelloMAP
#local all railshelloPG ident map=railshelloMAP
# MAPNAME SYSTEM-USERNAME PG-USERNAME
railshelloMAP railshello railshelloPG
psql
Options.unique_together
Sets of field names that, taken together, must be unique:
unique_together = (("driver", "restaurant"),)
This is a tuple of tuples that must be unique when considered together. It’s used in the Django admin and is enforced at the database level (i.e., the appropriate UNIQUE statements are included in the CREATE TABLE statement).
For convenience, unique_together can be a single tuple when dealing with a single set of fields:
unique_together = ("driver", "restaurant")
class TTest(models.Model):
t1 = models.IntegerField()
t2 = models.IntegerField()
class Meta:
unique_together = ('t1', 't2')
$python manage.py sql ttest
BEGIN;
CREATE TABLE "ttest_ttest" (
"id" integer NOT NULL PRIMARY KEY,
"t1" integer NOT NULL,
"t2" integer NOT NULL,
UNIQUE ("t1", "t2")
)
;
COMMIT;